Part Number Hot Search : 
T493X337 AK8778 D4NK8 102MH TZ20B IPW60 120CA 25616
Product Description
Full Text Search
 

To Download UPD70F3474GJA-GAE-G Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  to our customers, old company name in catalogs and other documents on april 1 st , 2010, nec electronics corporation merged with renesas technology corporation, and renesas electronics corporation took over all the business of both companies. therefore, although the old company name remains in this document, it is a valid renesas electronics document. we appreciate your understanding. renesas electronics website: http://www.renesas.com april 1 st , 2010 renesas electronics corporation issued by: renesas electronics corporation (http://www.renesas.com) send any inquiries to http://www.renesas.com/inquiry.
notice 1. all information included in this document is current as of the date this document is issued. such information, however, is subject to change without any prior notice. before purchasing or using any renesas el ectronics products li sted herein, please confirm the latest product information with a renesas electronics sales office. also , please pay regular and careful attention to additional and different information to be disclosed by rene sas electronics such as that disclosed through our website. 2. renesas electronics does not assume any liability for infringeme nt of patents, copyrights, or other intellectual property ri ghts of third parties by or arising from the use of renesas electroni cs products or techni cal information descri bed in this document . no license, express, implied or otherwise, is granted hereby under any patents, copyri ghts or other intell ectual property right s of renesas electronics or others. 3. you should not alter, modify, copy, or otherwise misappropriate any re nesas electronics product, wh ether in whole or in part . 4. descriptions of circuits, software and other related informat ion in this document are provided only to illustrate the operat ion of semiconductor products and application examples. you are fully re sponsible for the incorporation of these circuits, software, and information in the design of your equipment. renesas electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits, software, or information. 5. when exporting the products or technology described in this doc ument, you should comply with the applicable export control laws and regulations and follow the proc edures required by such laws and re gulations. you should not use renesas electronics products or the technology described in this docum ent for any purpose relating to mil itary applicati ons or use by the military, including but not l imited to the development of weapons of mass de struction. renesas electronics products and technology may not be used for or incor porated into any products or systems whose manufacture, us e, or sale is prohibited under any applicable dom estic or foreign laws or regulations. 6. renesas electronics has used reasonable care in preparing th e information included in this document, but renesas electronics does not warrant that such information is error free. renesas electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein. 7. renesas electronics products ar e classified according to the following three quality grades: ?standard?, ?high quality?, an d ?specific?. the recommended applications for each renesas electronics product de pends on the product?s quality grade, as indicated below. you must check the qua lity grade of each renesas electronics pr oduct before using it in a particular application. you may not use any renesas electronics produc t for any application categorized as ?speci fic? without the prior written consent of renesas electronics. further, you may not use any renesas electronics product for any application for which it is not intended without the prior written consent of renesas electronics. re nesas electronics shall not be in any way liable for any damages or losses incurred by you or third partie s arising from the use of any renesas electronics product for a n application categorized as ?specific? or for which the product is not intende d where you have failed to obtain the prior writte n consent of renesas electronics. the quality grade of each renesas electronics product is ?standard? unless otherwise expressly specified in a renesas electr onics data sheets or data books, etc. ?standard?: computers; office equipmen t; communications e quipment; test and measurement equipment; audio and visual equipment; home electronic a ppliances; machine tools; personal electronic equipmen t; and industrial robots. ?high quality?: transportation equi pment (automobiles, trains, ships, etc.); traffic control systems; anti-disaster systems; an ti- crime systems; safety equipment; and medical equipment not specif ically designed for life support. ?specific?: aircraft; aerospace equipment; submersible repeaters; nuclear reactor control systems; medical equipment or systems for life support (e.g. artificial life support device s or systems), surgical im plantations, or healthcare intervention (e.g. excision, etc.), and any other applicati ons or purposes that pose a di rect threat to human life. 8. you should use the renesas electronics pr oducts described in this document within the range specified by renesas electronics , especially with respect to the maximum ra ting, operating supply voltage range, movement power volta ge range, heat radiation characteristics, installation and other product characteristics. renesas electronics shall have no liability for malfunctions o r damages arising out of the use of renesas electronics products beyond such specified ranges. 9. although renesas electronics endeavors to improve the quality and reliability of its produc ts, semiconductor products have specific characteristics such as the occurrence of failure at a certain rate a nd malfunctions under certain use conditions. fur ther, renesas electronics products are not subject to radiation resistance design. please be sure to implement safety measures to guard them against the possibility of physic al injury, and injury or damage caused by fire in the event of the failure of a renesas electronics product, such as safe ty design for hardware and software in cluding but not limited to redundancy, fire control and malfunction prevention, appropri ate treatment for aging degradation or an y other appropriate measures. because the evaluation of microcomputer software alone is very difficult , please evaluate the safety of the final products or system manufactured by you. 10. please contact a renesa s electronics sales office for details as to environmental matters such as the environmental compatibility of each renesas electronics product. please use renesas electronics products in compliance with all applicable laws and regulations that regul ate the inclusion or use of c ontrolled substances, including wi thout limitation, the eu rohs directive. renesas electronics assumes no liability for damage s or losses occurring as a result of your noncompliance with applicable laws and regulations. 11. this document may not be reproduced or duplicated, in any form, in w hole or in part, without prio r written consent of renes as electronics. 12. please contact a renesa s electronics sales office if you have any questi ons regarding the informat ion contained in this document or renesas electroni cs products, or if you have any other inquiries. (note 1) ?renesas electronics? as used in this document means renesas electronics corporation and also includes its majority- owned subsidiaries. (note 2) ?renesas electronics product(s)? means any product developed or manufactured by or for renesas electronics.
document no. u19201ej3v0ud00 (3rd edition) date published november 2009 n user?s manual v850e/sj3-h, v850e/sk3-h 32-bit single-chip microcontrollers hardware 2008 v850e/sj3-h: pd70f3474 pd70f3475 pd70f3476 pd70f3477 pd70f3478 pd70f3479 pd70f3931 pd70f3932 pd70f3933 pd70f3934 pd70f3935 pd70f3936 pd70f3937 pd70f3938 pd70f3939 v850e/sk3-h: pd70f3480 pd70f3481 pd70f3482 pd70f3486 pd70f3487 pd70f3488 pd70f3925 pd70f3926 pd70f3927
user?s manual u19201ej3v0ud 2 [memo]
user?s manual u19201ej3v0ud 3 notes for cmos devices (1) voltage application waveform at input pin: wa veform distortion due to input noise or a reflected wave may cause malfunction. if the input of the cm os device stays in the ar ea between vil (max) and vih (min) due to noise, etc., the device may malfunction. take care to prevent chattering noise from entering the device when the input level is fixed, and also in the transition period when the i nput level passes through the area between vil (max) and vih (min). (2) handling of unused input pins: unconnected cm os device inputs can be cause of malfunction. if an input pin is unconnected, it is possible that an internal input le vel may be generated due to noise, etc., causing malfunction. cmos devices behave differently t han bipolar or nmos devices. input levels of cmos devices must be fixed high or low by using pull-up or pull-down circuitry. each unused pin should be connected to vdd or gnd via a resistor if there is a possibility that it will be an output pin. all handling related to unused pins must be judged separately for each device and according to related specifications governing the device. (3) precaution against esd: a strong electric fiel d, when exposed to a mos dev ice, can cause destruction of the gate oxide and ultimately degr ade the device operation. steps mu st be taken to stop generation of static electricity as much as possible, and quickly dissi pate it when it has occurred. environmental control must be adequate. when it is dry, a humidifier should be used. it is recommended to avoid using insulators that easily build up static electric ity. semiconductor devices must be stored and transported in an anti-static container, static shielding bag or conductive material. all test and measurement tools including work benches and floors should be grounded. the operat or should be grounded using a wrist strap. semiconductor devices must not be touched with bare hands. similar precautions need to be taken for pw boards with mounted semiconductor devices. (4) status before initialization: power-on does not nece ssarily define the initial st atus of a mos device. immediately after the power source is turned on, devic es with reset functions have not yet been initialized. hence, power-on does not guar antee output pin levels, i/o settings or cont ents of registers. a device is not initialized until the reset signal is received. a rese t operation must be executed immediately after power-on for devices with reset functions. (5) power on/off sequence: in the case of a device t hat uses different power supplies for the internal operation and external interface, as a rule, switch on t he external power supply after switching on the internal power supply. when switching the power supply off, as a rule, switch off the external power supply and then the internal power supply. use of the reverse power on/off sequences may result in the application of an overvoltage to the internal element s of the device, causing malfuncti on and degradation of internal elements due to the passage of an abnormal current. the correct power on/off sequence must be judged separately for each device and according to related spec ifications governing the device. (6) input of signal during power off state : do not input signals or an i/o pull-up power supply while the device is not powered. the current injection that results from input of such a signal or i/o pull-up power supply may cause malfunction and the abno rmal current that passes in the device at this time may cause degradation of internal elements. input of signals during the power o ff state must be judged separately for each device and according to related s pecifications gover ning the device.
user?s manual u19201ej3v0ud 4 caution: this product uses superflash ? technology licensed from silicon storage technology, inc. iecube is a registered trademark of nec el ectronics corporation in japan and germany. minicube is a registered tradem ark of nec electronics corporati on in japan and germany or a trademark in the united states of america. eeprom, iebus, and inter equipment bus are trademarks of nec electronics corporation. windows and windows nt are either re gistered trademarks or trademarks of microsoft corporation in the united states and/or other countries. pc/at is a trademark of internati onal business machines corporation. sparcstation is a trademark of sparc international, inc. solaris and sunos are trademar ks of sun microsystems, inc. superflash is a registered trademark of silicon st orage technology, inc. in several countries including the united states and japan. ? the information in this document is curr ent as of september, 2009. the information is subject to change without notice. for actual design-in, refer to the latest publications of nec el ectronics data sheets or data books, etc., for the most up-to-date specifications of nec el ectronics products. not all products and/or types are av ailable in every country. please check with a n nec electronics sales representative for av ailability and additional information. ? no part of this document may be copied or reproduced in any form or by any means without the pr ior written consent of nec electronics. nec electronics assumes no responsibility for any errors that may appear in this document. ? nec electronics does not assume any liability for infringement of patents, copyrights or other intellectual property rights o f third parties by or arising from the use of nec electronics pr oducts listed in this document or any other liability arising fro m the use of such products. no licens e, express, implied or otherwise, is granted under any patents, copyrights or other intellectua l property rights of nec electronics or others. ? descriptions of circuits, software and other related information in this document are provided for illustrative purposes in semiconductor product operation and app lication examples. the incorporation of these circuits, software and information in the design of a customer's equipment shall be done under the full responsibility of the customer. nec electronics assumes no responsibility for any losses incurred by customers or third par ties arising from the use of these circuits, software and information. ? while nec electronics endeavors to enhance the quality, reliab ility and safety of nec electronics products, customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. to mini mize risks of damage to property or injury (including death) to persons arising from def ects in nec electronics products, cust omers must incorporate sufficient safety measures in their design, such as redundancy, fire-containment and anti-failure features. ? nec electronics products are cl assified into the following three quality grades: "standard", "special" and "specific". the "specific" quality grade applies only to nec electronics products developed based on a cu stomer-designated "quality assurance program" for a specific app lication. the recommended applications of an nec electronics product depend on its quality grade, as indicated below. custom ers must check the quality grade of each ne c electronics product before using it in a particular application. "standard": computers, office equipm ent, communications equipment, test and measurement equipment, audio and visual equipment, home electronic appliances, ma chine tools, personal electronic equipment and industrial robots. "special": transportation equipment (automobiles, trains, ships, etc.), traffic control system s, anti-disaster systems, anti- crime systems, safety equipment and medical equipment (not specifically designed for life support). "specific": aircraft, aerospace equipmen t, submersible repeaters, nuclear reacto r control systems, life support systems and medical equipment for life support, etc. the quality grade of nec electronics products is "standard" unless otherwise expre ssly specified in nec electronics data sheets or data books, etc. if customers wish to use nec elec tronics products in applications not intended by nec electronics, they must contact an nec electronics sales representative in advance to determine nec electronics' willingness to support a given application. (note 1) "nec electronics" as used in th is statement means nec electronics corpor ation and also includes its majority-owned subsidiaries. (note 2) "nec electronics products" m eans any product developed or manufactured by or for nec electronics (as defined above). (m8e0909)
user?s manual u19201ej3v0ud 5 preface readers this manual is intended for users who wish to understand the functions of the v850e/sj3-h and v850e/sk3-h and des ign application systems using the v850e/sj3-h and v850e/sk3-h. purpose this manual is intended to give users an understanding of the har dware functions of the v850e/sj3-h and v850e/sk3-h shown in the organization below. organization the manual of these products is divided into two volumes: hardware (this volume) and architecture ( v850e1 architecture user?s manual ). hardware architecture ? pin functions ? data types ? cpu function ? register set ? on-chip peripheral functions ? instruction format and instruction set ? flash memory programming ? interrupts and exceptions ? electrical specifications ? pipeline operation how to read this manual it is assumed that the readers of this m anual have general knowledge in the fields of electrical engineering, logic circuits, and microcontrollers. caution the application examples in th is manual apply to ?standard? quality grade products for general electr onic systems. when using an example in this manual for an app lication that requires a ?special? quality grade product, thoroughly evalua te the component and circuit to be actually used to see if they satisfy the special quality grade. to understand the overall functions of the v850e/sj3-h and v850e/sk3-h read this manual according to the contents . to find the details of a regi ster where the name is known use appendix b register index . register format the name of the bit whose number is in angle brackets (<>) in the figure of the register format of each register is defi ned as a reserved word in the device file. to understand the details of an instruction function refer to the v850e1 architecture user?s manual available separately. to know the electrical specificati ons of the v850e/sj3-h and v850e/sk3-h see chapter 35 electrical specifications . the ?yyy bit of the xxx register? is described as the ?xxx.yyy bit? in this manual. note with caution that if ?xxx. yyy? is described as is in a program, however, the compiler/assembler cannot recognize it correctly.
user?s manual u19201ej3v0ud 6 the mark shows major revised point s. the revised points can be easily searched by copying an ?? in the pdf file and specifying it in the ?find what:? field. conventions data significance: higher digits on the left and lower digits on the right active low representation: xxx (ove rscore over pin or signal name) memory map address: higher addresse s on the top and lower addresses on the bottom note : footnote for item marked with note in the text caution : information requiring particular attention remark : supplementary information numeric representation: binary ... xxxx or xxxxb decimal ... xxxx hexadecimal ... xxxxh prefix indicating power of 2 (address space, memory capacity): k (kilo): 2 10 = 1,024 m (mega): 2 20 = 1,024 2 g (giga): 2 30 = 1,024 3
user?s manual u19201ej3v0ud 7 related documents the related documents indicated in this pub lication may include preliminary versions. however, preliminary versions are not marked as such. documents related to v850e/sj3-h, v850e/sk3-h document name document no. v850e1 architecture user?s manual u14559e v850e/sj3-h, v850e/sk3-h hardwa re user?s manual this manual documents related to development tools document name document no. ie-v850e1-cd-nw (pcmcia card ty pe on-chip debug emulator) u16647e qb-v850esx3h (in-circuit emulator) to be prepared qb-v850mini (on-chip debug emulator) u17638e qb-mini2 (on-chip debug emulator with programming function) u18371e qb-programmer programming gui operation u18527e operation u18512e c language u18513e assembly language u18514e ca850 ver. 3.20 c compiler package link directives u18515e pm+ ver. 6.30 project manager u18416e id850qb ver. 3.40 integrated debugger operation u18604e tw850 ver. 2.00 performance analysis tuning tool u17241e basics u13430e installation u17419e technical u13431e rx850 ver. 3.20 real-time os task debugger u17420e basics u18165e in-structure u18164e rx850 pro ver. 3.21 real-time os task debugger u17422e az850 ver. 3.30 system performance analyzer u17423e pg-fp5 flash memory programmer u18865e
user?s manual u19201ej3v0ud 8 contents chapter 1 introduction ...................................................................................................... .......... 22 1.1 general ........................................................................................................................ ...............22 1.2 features ....................................................................................................................... ..............25 1.3 application fields ............................................................................................................. ........27 1.4 ordering information ........................................................................................................... .....28 1.4.1 v850e/s j3-h.................................................................................................................... ...........28 1.4.2 v850e/ sk3-h .................................................................................................................... ..........29 1.5 pin configuration (top vi ew)................................................................................................... 29 1.5.1 v850e/s j3-h.................................................................................................................... ...........29 1.5.2 v850e/ sk3-h .................................................................................................................... ..........32 1.6 function block configuration............................................. .....................................................3 5 1.6.1 internal bl ock di agram ......................................................................................................... ........35 1.6.2 internal units ................................................................................................................. ...............39 chapter 2 pin functio ns .................................................................................................... ........... 43 2.1 list of pin functions.......................................................................................................... .......43 2.2 port sharing of alternate functions ............................... ........................................................60 2.3 pin states ..................................................................................................................... ..............65 2.4 pin i/o circuit types, i/o buffer power suppli es and connection of unused pins...........66 2.5 cautions ....................................................................................................................... ..............73 chapter 3 cpu functio n ..................................................................................................... ........... 74 3.1 features ....................................................................................................................... ..............74 3.2 cpu register set............................................................................................................... ........75 3.2.1 program regi ster set ........................................................................................................... .........76 3.2.2 system regi ster set............................................................................................................ ..........77 3.3 operation modes ................................................................................................................ .......84 3.3.1 specifying oper ation mode ...................................................................................................... ....84 3.4 address space .................................................................................................................. ........85 3.4.1 cpu address space.............................................................................................................. .......85 3.4.2 wraparound of cpu addr ess spac e ............................................................................................86 3.4.3 memory map..................................................................................................................... ...........87 3.4.4 areas .......................................................................................................................... .................91 3.4.5 recommended use of address s pace .......................................................................................100 3.4.6 peripheral i/o regist ers....................................................................................................... .......104 3.4.7 programmable peripheral i/o regist ers......................................................................................123 3.4.8 special r egister s .............................................................................................................. ..........124 3.4.9 cauti ons ....................................................................................................................... .............128 chapter 4 port functio ns ................................................................................................... ...... 133 4.1 features ....................................................................................................................... ............133 4.1.1 v850e/s j3-h.................................................................................................................... .........133 4.1.2 v850e/ sk3-h .................................................................................................................... ........133 4.2 basic port configuration....................................................................................................... .134
user?s manual u19201ej3v0ud 9 4.2.1 v850e/s j3-h.................................................................................................................... ......... 134 4.2.2 v850e/ sk3-h .................................................................................................................... ........ 135 4.3 port configuration ......................................................... .................................................... .....136 4.3.1 port 0......................................................................................................................... ................ 141 4.3.2 port 1......................................................................................................................... ................ 145 4.3.3 port 2 (v850e/ sk3-h only) ...................................................................................................... . 146 4.3.4 port 3......................................................................................................................... ................ 148 4.3.5 port 4......................................................................................................................... ................ 157 4.3.6 port 5......................................................................................................................... ................ 161 4.3.7 port 6......................................................................................................................... ................ 167 4.3.8 port 7......................................................................................................................... ................ 175 4.3.9 port 8......................................................................................................................... ................ 177 4.3.10 port 9......................................................................................................................... ................ 182 4.3.11 port 13 (v850e/ sk3-h only) ..................................................................................................... . 190 4.3.12 port 14 (v850e/ sk3-h only) ..................................................................................................... . 191 4.3.13 port 15 (v850e/ sk3-h only) ..................................................................................................... . 192 4.3.14 port cd ........................................................................................................................ ............. 194 4.3.15 port cm ........................................................................................................................ ............. 196 4.3.16 port cs........................................................................................................................ .............. 198 4.3.17 port ct........................................................................................................................ .............. 200 4.3.18 port dh ........................................................................................................................ ............. 202 4.3.19 port dl ........................................................................................................................ .............. 204 4.4 block diagrams................................................................................................................. ......207 4.5 port register settings when alternate function is used ..................................................270 4.6 cautions....................................................................................................................... ............284 4.6.1 cautions on se tting port pins .................................................................................................. ... 284 4.6.2 cautions on bit manipulation instru ction for port n r egister (pn) ................................................ 287 4.6.3 cautions on on-ch ip debug pi ns ................................................................................................ 2 88 4.6.4 cautions on p05/in tp2/drst pin ............................................................................................ 288 4.6.5 cautions on p53 pin when power is tu rned on .......................................................................... 288 4.6.6 hysteresis char acterist ics..................................................................................................... ..... 288 4.6.7 cautions on separ ate bus mode................................................................................................ 28 9 4.6.8 cautions on reading port n registers (pn: n = 3 to 5, 8) (v 850e/sj3-h only) ............................ 289 4.6.9 cautions on setting port n mode control r egisters (pmcn: n = 3 to 5, 8) ................................... 289 chapter 5 bus control function.............................. .............................................................2 90 5.1 features ....................................................................................................................... ............290 5.2 bus control pins............................................................................................................... ......291 5.2.1 pin status when internal rom, internal ra m, on-chip peripheral i/o, or expanded internal ram is a ccessed................................................................................................................ ....... 292 5.2.2 pin status in eac h operation mode ............................................................................................ 29 2 5.3 memory block function .........................................................................................................2 93 5.3.1 chip select c ontrol f unction ................................................................................................... .... 296 5.4 external bus interface mode control function ......... ..........................................................301 5.5 bus access..................................................................................................................... .........302 5.5.1 number of clo cks for a ccess .................................................................................................... . 302 5.5.2 bus size setti ng func tion...................................................................................................... ...... 303 5.5.3 access by bus si ze............................................................................................................. ....... 304
user?s manual u19201ej3v0ud 10 5.6 wait function.................................................................................................................. .........311 5.6.1 programmable wa it func tion ..................................................................................................... .311 5.6.2 external wait func tion ......................................................................................................... .......314 5.6.3 relationship between programmabl e wait and exte rnal wa it ..................................................... 315 5.6.4 programmable address wait func tion .........................................................................................316 5.7 idle state insertion func tion.................................................................................................. 318 5.8 bus hold function .............................................................................................................. ....319 5.8.1 functional outlin e ............................................................................................................. .........319 5.8.2 bus hold pr ocedur e ............................................................................................................. ......320 5.8.3 operation in power save mode..................................................................................................3 20 5.9 bus priority ................................................................................................................... ...........321 5.10 bus timing..................................................................................................................... ..........322 chapter 6 clock generation function .................... .......................................................... 328 6.1 overview ....................................................................................................................... ...........328 6.2 clock mode ..................................................................................................................... .........329 6.2.1 clock m ode 1 ................................................................................................................... ..........332 6.2.2 clock m ode 2 ................................................................................................................... ..........335 6.2.3 clock m ode 3 ................................................................................................................... ..........338 6.2.4 clock m ode 4 ................................................................................................................... ..........341 6.2.5 clock mode setti ng ............................................................................................................. .......344 6.3 registers ...................................................................................................................... ............345 6.4 operation ...................................................................................................................... ...........355 6.4.1 operation of each cl ock ........................................................................................................ .....355 6.4.2 clock output functi on .......................................................................................................... .......356 6.4.3 procedure for setting clock generation f unction for using clock m ode 1 ....................................357 6.4.4 procedure for setting clock generation function for using clock modes 2, 3, and 4 ....................360 chapter 7 16-bit timer/event counter p (tmp) . ............................................................... 364 7.1 overview ....................................................................................................................... ...........364 7.1.1 tmp0 to tmp6 ................................................................................................................... .......364 7.1.2 tmp7 and tmp8 .................................................................................................................. .....364 7.2 functions ...................................................................................................................... ...........365 7.2.1 tmp0 to tmp6 ................................................................................................................... .......365 7.2.2 tmp7 and tmp8 .................................................................................................................. .....365 7.3 configuration.................................................................................................................. .........366 7.3.1 tmp0 to tmp6 ................................................................................................................... .......366 7.3.2 tmp7 and tmp8 .................................................................................................................. .....369 7.4 registers ...................................................................................................................... ............372 7.5 timer output operati ons........................................................................................................ 394 7.6 operation ...................................................................................................................... ...........395 7.6.1 interval timer mode (tpnmd2 to tpnmd0 bi ts = 000)............................................................... 404 7.6.2 external event count mode (tpn md2 to tpnmd0 bits = 001)................................................... 416 7.6.3 external trigger pulse output mode (tpnmd2 to tpnmd0 bits = 010) .......................................425 7.6.4 one-shot pulse output mode (tpn md2 to tpnmd0 bits = 011) ................................................ 437 7.6.5 pwm output mode (tpnmd2 to tpnmd0 bi ts = 100)................................................................ 444 7.6.6 free-running timer mode (tpnmd2 to tpnmd0 bi ts = 101) ...................................................... 453 7.6.7 pulse width measurement mode (tpn md2 to tpnmd0 bits = 110) .......................................... 471
user?s manual u19201ej3v0ud 11 7.6.8 encoder count function (onl y for tmp7 and tmp8 )................................................................... 477 7.6.9 encoder compare mode (tpmmd 3 to tpmmd0 bi ts = 1000) ................................................... 491 7.7 selector function.............................................................................................................. ......499 7.8 cautions....................................................................................................................... ............501 chapter 8 16-bit timer/event counter q (tmq) ... .............................................................502 8.1 overview ....................................................................................................................... ...........502 8.2 functions ...................................................................................................................... ...........502 8.3 configuration .................................................................................................................. ........503 8.4 registers...................................................................................................................... ............506 8.5 timer output operations ............................................. ..........................................................5 21 8.6 operation ...................................................................................................................... ...........522 8.6.1 interval timer mode (tq0md2 to tq0md0 bi ts = 000).............................................................. 530 8.6.2 external event count mode (tq0 md2 to tq0md0 bits = 001).................................................. 541 8.6.3 external trigger pulse output mode (tq0md2 to tq0md0 bits = 010) ...................................... 551 8.6.4 one-shot pulse output mode (tq0 md2 to tq0md0 bits = 011) ............................................... 564 8.6.5 pwm output mode (tq0md2 to tq0md0 bi ts = 100)............................................................... 573 8.6.6 free-running timer mode (tq0md2 to tq0md0 bi ts = 101) ..................................................... 584 8.6.7 pulse width measurement mode (tq0 md2 to tq0md0 bits = 110) ......................................... 605 8.7 selector function.............................................................................................................. ......610 8.8 cautions....................................................................................................................... ............611 chapter 9 16-bit interval timer m (tmm).......... ...................................................................612 9.1 overview ....................................................................................................................... ...........612 9.2 configuration .................................................................................................................. ........613 9.3 register....................................................................................................................... .............615 9.4 operation ...................................................................................................................... ...........616 9.4.1 interval ti mer m ode............................................................................................................ ........ 616 9.4.2 cauti ons ....................................................................................................................... ............. 620 chapter 10 watch functions ..................................... ............................................................ ...621 10.1 overview ....................................................................................................................... ...........621 10.2 configuration .................................................................................................................. ........622 10.3 prescaler 3 .................................................................................................................... ...........623 10.3.1 functi on ....................................................................................................................... ............. 623 10.3.2 configur ation .................................................................................................................. ........... 623 10.3.3 regist ers ...................................................................................................................... ............. 624 10.4 watch timer functions .......................................................................................................... 626 10.4.1 functi ons...................................................................................................................... ............. 626 10.4.2 configur ation .................................................................................................................. ........... 626 10.4.3 control r egister s.............................................................................................................. ......... 628 10.4.4 operat ion ...................................................................................................................... ............ 630 10.5 real-time counter (rtc) ... ..................................................................................................... 632 10.5.1 functi on ....................................................................................................................... ............. 632 10.5.2 configur ation .................................................................................................................. ........... 633 10.5.3 regist ers ...................................................................................................................... ............. 636 10.5.4 operat ion ...................................................................................................................... ............ 649
user?s manual u19201ej3v0ud 12 chapter 11 functions of watchdog timer 2 .. ................................................................. 661 11.1 functions ...................................................................................................................... ...........661 11.2 configuration.................................................................................................................. .........662 11.3 registers ...................................................................................................................... ............663 11.4 operation ...................................................................................................................... ...........667 chapter 12 real-time output function (rto).. ................................................................. 668 12.1 function ....................................................................................................................... ............668 12.2 configuration.................................................................................................................. .........669 12.3 registers ...................................................................................................................... ............671 12.4 operation ...................................................................................................................... ...........673 12.5 usage.......................................................................................................................... ..............674 12.6 cautions ....................................................................................................................... ............674 chapter 13 a/d converter ................................................................................................... ...... 675 13.1 overview ....................................................................................................................... ...........675 13.2 functions ...................................................................................................................... ...........675 13.3 configuration.................................................................................................................. .........676 13.4 registers ...................................................................................................................... ............679 13.5 operation ...................................................................................................................... ...........690 13.5.1 basic oper ation................................................................................................................ ..........690 13.5.2 conversion operat ion ti ming .................................................................................................... ..691 13.5.3 trigger mode ................................................................................................................... ..........692 13.5.4 operati on m ode................................................................................................................. ........694 13.5.5 power-fail co mpare mode........................................................................................................ ..698 13.6 cautions ....................................................................................................................... ............703 13.7 how to read a/d converter characteristics table .... .........................................................708 chapter 14 d/a converter ................................................................................................... ...... 712 14.1 functions ...................................................................................................................... ...........712 14.2 configuration.................................................................................................................. .........712 14.3 registers ...................................................................................................................... ............713 14.4 operation ...................................................................................................................... ...........715 14.4.1 operation in normal mode ....................................................................................................... ..715 14.4.2 operation in real-t ime output mode ...........................................................................................71 5 14.4.3 cauti ons ....................................................................................................................... .............716 chapter 15 asynchronous serial interface a (uarta) ............................................. 717 15.1 port settings of uarta0 to uarta5............................... .....................................................717 15.1.1 for v850e /sj3-h ................................................................................................................ ......717 15.1.2 for v850e /sk3-h................................................................................................................ ......719 15.2 features ....................................................................................................................... ............721 15.3 configuration.................................................................................................................. .........722 15.4 registers ...................................................................................................................... ............725 15.5 interrupt request signals ................................................... ................................................... 732 15.6 operation ...................................................................................................................... ...........733 15.6.1 data fo rmat.................................................................................................................... ............733
user?s manual u19201ej3v0ud 13 15.6.2 sbf transmission/rec eption fo rmat ........................................................................................... 735 15.6.3 sbf trans missi on ............................................................................................................... ....... 737 15.6.4 sbf rec epti on.................................................................................................................. .......... 738 15.6.5 uart trans missi on .............................................................................................................. ..... 739 15.6.6 continuous transmi ssion proc edure .......................................................................................... 740 15.6.7 uart rec eptio n................................................................................................................. ........ 742 15.6.8 reception errors............................................................................................................... ......... 743 15.6.9 parity types and operat ions .................................................................................................... ... 745 15.6.10 receive data noi se f ilter ...................................................................................................... ...... 746 15.7 dedicated baud rate generator................................... .........................................................747 15.8 cautions....................................................................................................................... ............757 chapter 16 asynchronous serial interface b (uartb) ..............................................759 16.1 features ....................................................................................................................... ............759 16.2 configuration .................................................................................................................. ........760 16.3 control registers.............................................................................................................. ......764 16.4 interrupt request signals ............................................ .......................................................... 784 16.5 control modes .................................................................................................................. .......787 16.6 operation ...................................................................................................................... ...........791 16.6.1 data fo rmat .................................................................................................................... ........... 791 16.6.2 transmit oper ation ............................................................................................................. ....... 792 16.6.3 continuous transmi ssion operat ion ........................................................................................... 795 16.6.4 receive oper ation .............................................................................................................. ....... 796 16.6.5 reception error................................................................................................................ .......... 799 16.6.6 parity types and corre sponding operat ion ................................................................................. 800 16.6.7 receive data noi se f ilter ...................................................................................................... ...... 801 16.7 dedicated baud rate generator (brg) ................... .............................................................803 16.8 control flow ................................................................................................................... .........809 16.9 cautions....................................................................................................................... ............818 chapter 17 3-wire variable-length serial i/o b (csib)................................................820 17.1 port settings of csib0 to csib5 ...........................................................................................820 17.1.1 for v850e /sj3-h ................................................................................................................ ...... 820 17.1.2 for v850e /sk3-h................................................................................................................ ...... 822 17.2 features ....................................................................................................................... ............824 17.3 configuration .................................................................................................................. ........825 17.4 registers...................................................................................................................... ............828 17.5 interrupt request signals ............................................ .......................................................... 836 17.6 operation ...................................................................................................................... ...........837 17.6.1 single transfer mode (master mode, transmi ssion m ode) ......................................................... 837 17.6.2 single transfer mode (master mode, recept ion m ode) .............................................................. 839 17.6.3 single transfer mode (master mode, transmission/rec eption m ode) ......................................... 842 17.6.4 single transfer mode (slave mode, transmi ssion m ode)............................................................ 845 17.6.5 single transfer mode (slave mode, recept ion m ode) ................................................................. 847 17.6.6 single transfer mode (slave mode, transmission/rec eption m ode) ............................................ 849 17.6.7 continuous transfer mode (master mode, transmi ssion m ode) ................................................. 851 17.6.8 continuous transfer mode (master mode, recept ion m ode) ...................................................... 854 17.6.9 continuous transfer mode (master m ode, transmission/re ception mode) ................................. 857
user?s manual u19201ej3v0ud 14 17.6.10 continuous transfer mode (slave mode, transmi ssion m ode).................................................... 861 17.6.11 continuous transfer mode (slave mode, recept ion m ode) ......................................................... 863 17.6.12 continuous transfer mode (slave m ode, transmission/re ception mode) ....................................866 17.6.13 reception error................................................................................................................ ..........870 17.6.14 clock ti ming ................................................................................................................... ............871 17.7 output pins .................................................................................................................... ..........873 17.8 baud rate generator ............................................................................................................ ..874 17.8.1 baud rate generatio n ........................................................................................................... ......876 17.9 cautions ....................................................................................................................... ............877 chapter 18 3-wire variable-length serial i/o e (csie) ............................................... 878 18.1 port setting of csie0 and csie1 ...........................................................................................878 18.1.1 v850e/sj3-h (other than pd70f3931, 70f3932, 70f3933) ...................................................878 18.1.2 v850e/ sk3-h .................................................................................................................... ........879 18.2 features ....................................................................................................................... ............880 18.3 configuration.................................................................................................................. .........881 18.4 control registers .............................................................................................................. ......885 18.5 baud rate generator n (brgn) .............................................................................................895 18.6 operation ...................................................................................................................... ...........897 18.7 how to use..................................................................................................................... ..........918 18.8 cautions ....................................................................................................................... ............925 chapter 19 i 2 c bus ......................................................................................................................... . 926 19.1 port settings of i 2 c00 to i 2 c05................................................................................................927 19.1.1 for v850e /sj3-h ................................................................................................................ ......927 19.1.2 for v850e /sk3-h................................................................................................................ ......929 19.2 features ....................................................................................................................... ............931 19.3 configuration.................................................................................................................. .........932 19.4 registers ...................................................................................................................... ............936 19.5 i 2 c bus mode functions .........................................................................................................95 4 19.5.1 pin confi guratio n.............................................................................................................. ..........954 19.6 i 2 c bus definitions and control methods ....................... ......................................................955 19.6.1 start c onditi on................................................................................................................ ............956 19.6.2 addre sses...................................................................................................................... ............957 19.6.3 transfer direction specific ation ............................................................................................... ...958 19.6.4 ack ............................................................................................................................ ...............959 19.6.5 stop condi tion................................................................................................................. ...........960 19.6.6 wait state ..................................................................................................................... .............961 19.6.7 wait state canc ellation method................................................................................................. .963 19.7 i 2 c interrupt request signals (intiicn)........................... ......................................................964 19.7.1 master devic e operat ion ........................................................................................................ ....965 19.7.2 slave device operation (when receiving slave address (addr ess matc h)) .................................968 19.7.3 slave device operation (when re ceiving extens ion c ode) .......................................................... 972 19.7.4 operation without communica tion .............................................................................................976 19.7.5 arbitration loss operation (operation as slave after arbi tration loss) ..........................................977 19.7.6 operation when arbitration loss occurs ( no communication after arbitrati on loss) .....................979 19.8 interrupt request signal (intiicn) generation ti ming and wait control .........................986 19.9 address match detection method ..... ....................................................................................987
user?s manual u19201ej3v0ud 15 19.10 error detection................................................................................................................ ........987 19.11 extension code................................................................................................................. ......988 19.12 arbitration.................................................................................................................... ............989 19.13 wakeup function ................................................................................................................ ....990 19.14 communication reservation ........................................... ......................................................991 19.14.1 when communication reservation function is enabled (iicfn.iicr svn bit = 0)......................... 991 19.14.2 when communication reservation function is disabled (iicfn.ii crsvn bit = 1) ........................ 995 19.15 cautions....................................................................................................................... ............996 19.16 communication operations...................................................................................................998 19.16.1 master operation in si ngle master system ................................................................................. 999 19.16.2 master operation in multimaste r system .................................................................................. 1000 19.16.3 slave oper ation ................................................................................................................ ....... 1003 19.17 timing of data communication.................................... .......................................................1007 chapter 20 iebus controller..................................... ........................................................... ..1014 20.1 functions ...................................................................................................................... .........1014 20.1.1 communication protoc ol of i ebus ........................................................................................... 1014 20.1.2 determination of bus mast ership (arb itrati on).......................................................................... 1015 20.1.3 communicati on m ode ............................................................................................................. 1015 20.1.4 communicati on addres s.......................................................................................................... 1015 20.1.5 broadcast comm unicati on ....................................................................................................... 1 016 20.1.6 transfer format of iebus ....................................................................................................... .. 1016 20.1.7 transfer data .................................................................................................................. ......... 1026 20.1.8 bit fo rmat..................................................................................................................... ............ 1028 20.2 configuration .................................................................................................................. ......1029 20.3 registers...................................................................................................................... ..........1031 20.4 interrupt operations of iebus cont roller ...........................................................................1061 20.4.1 interrupt cont rol bl ock........................................................................................................ ...... 1061 20.4.2 example of ident ifying in terrupt ............................................................................................... 1063 20.4.3 interrupt s ource list.......................................................................................................... ........ 1066 20.4.4 communication error sour ce processi ng list ............................................................................ 1067 20.5 interrupt request signal generation timing and main cpu processing .......................1069 20.5.1 master tr ansmissi on ............................................................................................................ .... 1069 20.5.2 master re ceptio n............................................................................................................... ....... 1071 20.5.3 slave trans missi on ............................................................................................................. ..... 1073 20.5.4 slave rec eptio n................................................................................................................ ........ 1075 20.5.5 interval of occurrence of interrupt request signal for iebus cont rol ......................................... 1077 20.6 caution........................................................................................................................ ...........1081 chapter 21 can controller ......................................... ......................................................... ..1082 21.1 overview ....................................................................................................................... .........1082 21.1.1 featur es ....................................................................................................................... ........... 1082 21.1.2 overview of func tions .......................................................................................................... .... 1083 21.1.3 configur ation .................................................................................................................. ......... 1084 21.2 can protocol................................................................................................................... ......1085 21.2.1 frame fo rmat................................................................................................................... ........ 1085 21.2.2 frame types .................................................................................................................... ........ 1086 21.2.3 data frame and re mote fr ame ................................................................................................. 108 6
user?s manual u19201ej3v0ud 16 21.2.4 error fr ame .................................................................................................................... ..........1094 21.2.5 overload frame................................................................................................................. .......1095 21.3 functions ...................................................................................................................... ........ 1096 21.3.1 determining bus prio rity....................................................................................................... ....1096 21.3.2 bit stu ffing................................................................................................................... .............1096 21.3.3 multi ma sters .................................................................................................................. .........1096 21.3.4 multi cast ..................................................................................................................... ............1096 21.3.5 can sleep mode/can st op mode func tion ..............................................................................1097 21.3.6 error contro l func tion ......................................................................................................... ......1097 21.3.7 baud rate cont rol func tion..................................................................................................... ...1104 21.4 connection with target system . ........................................................................................ 1108 21.5 internal registers of can contro ller ................................................................................. 1109 21.5.1 can controller c onfigurat ion................................................................................................... .1109 21.5.2 register a ccess ty pe ........................................................................................................... ....1110 21.5.3 register bit c onfigurat ion ..................................................................................................... ....1144 21.6 registers ...................................................................................................................... ......... 1148 21.7 bit set/clear function......................................................................................................... . 1184 21.8 can controller initializat ion ............................................................................................... 118 6 21.8.1 initialization of can m odule................................................................................................... ..1186 21.8.2 initialization of message buffer ............................................................................................... .1186 21.8.3 redefinition of message bu ffer ................................................................................................1 186 21.8.4 transition from initializati on mode to operat ion m ode.............................................................. 1187 21.8.5 resetting error counter cn erc of can module ...................................................................... 1188 21.9 message reception.............................................................................................................. 1189 21.9.1 message rec eptio n .............................................................................................................. ....1189 21.9.2 reading recept ion dat a......................................................................................................... ...1190 21.9.3 receive history list func tion .................................................................................................. ...1191 21.9.4 mask func tion .................................................................................................................. ........1193 21.9.5 multi buffer receive block func tion ...........................................................................................1 195 21.9.6 remote frame recept ion ......................................................................................................... .1196 21.10 message transmission........................................................................................................ 119 7 21.10.1 message trans missi on ........................................................................................................... ..1197 21.10.2 transmit history list func tion ................................................................................................. ...1199 21.10.3 automatic block tr ansmission ( abt)........................................................................................1201 21.10.4 transmission abor t proc ess..................................................................................................... 1203 21.10.5 remote frame transmissi on.....................................................................................................1 204 21.11 power saving modes ........................................................................................................... 12 05 21.11.1 can sleep mode ................................................................................................................. ....1205 21.11.2 can stop mode .................................................................................................................. .....1207 21.11.3 example of using pow er saving modes ...................................................................................1208 21.12 interrupt function ............................................................................................................. ... 1209 21.13 diagnosis functions and special operational mode s ..................................................... 1210 21.13.1 receive-onl y m ode.............................................................................................................. ....1210 21.13.2 single-shot mode............................................................................................................... ......1211 21.13.3 self-tes t mode ................................................................................................................. ........1212 21.13.4 transmission/reception operati on in each operat ion m ode ..................................................... 1213 21.14 time stamp function........................................................................................................... 1 214 21.14.1 time stamp functi on ............................................................................................................ ....1214
user?s manual u19201ej3v0ud 17 21.15 baud rate settings ............................................................................................................. ..1216 21.15.1 bit rate setti ng condi tions .................................................................................................... .... 1216 21.15.2 representative examples of baud rate settings ....................................................................... 1220 21.16 operation of can controller ............. ..................................................................................1224 chapter 22 dma function (dma controller) ..... .............................................................1250 22.1 features ....................................................................................................................... ..........1250 22.2 configuration .................................................................................................................. ......1251 22.3 registers...................................................................................................................... ..........1252 22.4 transfer targets............................................................. .................................................. .....1261 22.5 transfer modes ................................................................................................................. ....1261 22.6 transfer types ................................................................................................................. .....1262 22.7 dma channel priorities ........................................................................................................1 263 22.8 time related to dma transfer .................................... ........................................................1263 22.9 dma transfer start factors ......................................... ........................................................1264 22.10 dma abort factors .............................................................................................................. .1265 22.11 end of dma transfer ............................................................................................................ 1265 22.12 operation timing ............................................................................................................... ...1265 22.13 cautions....................................................................................................................... ..........1270 chapter 23 crc functio n .................................................................................................... ......1273 23.1 functions ...................................................................................................................... .........1273 23.2 configuration .................................................................................................................. ......1273 23.3 registers...................................................................................................................... ..........1274 23.4 operation ...................................................................................................................... .........1275 23.5 usage method ................................................................................................................... ....1276 chapter 24 interrupt/exception processing f unction .............................................1278 24.1 features ....................................................................................................................... ..........1278 24.2 non-maskable interrupts.................... ..................................................................................12 84 24.2.1 operat ion ...................................................................................................................... .......... 1286 24.2.2 restore........................................................................................................................ ............ 1287 24.2.3 np fl ag ........................................................................................................................ ............ 1288 24.3 maskable interrupts ............................................................................................................ ..1289 24.3.1 operat ion ...................................................................................................................... .......... 1289 24.3.2 restore........................................................................................................................ ............ 1291 24.3.3 priorities of ma skable inte rrupts .............................................................................................. 1292 24.3.4 interrupt control r egister ( xxicn)............................................................................................. . 1296 24.3.5 interrupt mask registers 0 to 6, 7l (imr0 to im r6, imr 7l)..................................................... 1300 24.3.6 in-service priority register (ispr) ............................................................................................ 1303 24.3.7 id flag........................................................................................................................ .............. 1304 24.3.8 watchdog timer mode regi ster 2 (w dtm2) ............................................................................. 1304 24.4 software exception............................................................................................................. ..1305 24.4.1 operat ion ...................................................................................................................... .......... 1305 24.4.2 restore........................................................................................................................ ............ 1306 24.4.3 ep fl ag........................................................................................................................ ............. 1307 24.5 exception trap ................................................................................................................. .....1308 24.5.1 illegal opcode definit ion ...................................................................................................... ..... 1308
user?s manual u19201ej3v0ud 18 24.5.2 debug tr ap..................................................................................................................... ..........1310 24.6 external interrupt request input pins (nmi a nd intp0 to intp9) ................................... 1312 24.6.1 noise elim inatio n .............................................................................................................. .......1312 24.6.2 edge detec tion................................................................................................................. ........1312 24.7 interrupt acknowledge time of cpu.................................................................................. 1323 24.8 periods in which interrupts are not acknowledge d by cpu.......................................... 1325 24.9 cautions ....................................................................................................................... ......... 1325 chapter 25 key interrupt function ....................... ............................................................ 1326 25.1 function ....................................................................................................................... ......... 1326 25.2 register ....................................................................................................................... .......... 1327 25.3 cautions ....................................................................................................................... ......... 1327 chapter 26 standby function ................................................................................................ 1329 26.1 overview ....................................................................................................................... ........ 1329 26.2 registers ...................................................................................................................... ......... 1330 26.3 halt mode ...................................................................................................................... ..... 1334 26.3.1 setting and operat ion st atus ................................................................................................... .1334 26.3.2 releasing ha lt m ode............................................................................................................ .1334 26.4 idle1 mode..................................................................................................................... ...... 1336 26.4.1 setting and operat ion st atus ................................................................................................... .1336 26.4.2 releasing id le1 m ode........................................................................................................... .1336 26.5 idle2 mode..................................................................................................................... ...... 1339 26.5.1 setting and operat ion st atus ................................................................................................... .1339 26.5.2 releasing id le2 m ode........................................................................................................... .1340 26.5.3 securing setup time when releasing id le2 m ode ................................................................... 1342 26.6 stop mode ...................................................................................................................... ..... 1343 26.6.1 setting and operat ion st atus ................................................................................................... .1343 26.6.2 releasing st op m ode ............................................................................................................ 1343 26.6.3 securing oscillation stabilization ti me when releasi ng stop mode .........................................1346 26.7 subclock operation mode................................................................................................... 1347 26.7.1 setting and operat ion st atus ................................................................................................... .1347 26.7.2 releasing subclock operation mode ........................................................................................1347 26.8 sub-idle mode.................................................................................................................. ... 1350 26.8.1 setting and operat ion st atus ................................................................................................... .1350 26.8.2 releasing sub- idle m ode.......................................................................................................1 351 26.9 status transition diag ram .................................................................................................. 1354 chapter 27 reset functions ................................................................................................. .. 1358 27.1 overview ....................................................................................................................... ........ 1358 27.2 registers to check reset source ................................ ...................................................... 1360 27.3 operation ...................................................................................................................... ........ 1361 27.3.1 reset operation vi a reset pin ...............................................................................................136 1 27.3.2 reset operation by watc hdog timer 2 (w dt2res) .................................................................1363 27.3.3 reset operation by low-vo ltage detector (lvir es) ................................................................. 1365 27.3.4 reset operation by clo ck monitor (c lmres) ..........................................................................1366 27.3.5 operation after reset re lease .................................................................................................. .1368 27.3.6 reset function operation flow .................................................................................................. 1369
user?s manual u19201ej3v0ud 19 chapter 28 clock monitor ......................................... .......................................................... ....1370 28.1 functions ...................................................................................................................... .........1370 28.2 configuration .................................................................................................................. ......1370 28.3 register....................................................................................................................... ...........1371 28.4 operation ...................................................................................................................... .........1372 chapter 29 low-voltage detector........................... ...........................................................1375 29.1 functions ...................................................................................................................... .........1375 29.2 configuration .................................................................................................................. ......1375 29.3 registers...................................................................................................................... ..........1376 29.4 operation ...................................................................................................................... .........1378 29.4.1 to use for internal re set signal (l vires) ................................................................................ 1378 29.4.2 to use for inte rrupt (intlvi) .................................................................................................. . 1379 29.5 ram retention voltage detection operation ......... ...........................................................1380 29.6 emulation function ............................................................................................................. .1381 chapter 30 regulator ........................................................................................................ ........1382 30.1 overview ....................................................................................................................... .........1382 30.2 operation ...................................................................................................................... .........1383 chapter 31 rom correction function .................... ...........................................................1384 31.1 overview ....................................................................................................................... .........1384 31.2 registers...................................................................................................................... ..........1385 31.3 rom correction operation and program flow.......... ........................................................1388 31.4 cautions....................................................................................................................... ..........1390 chapter 32 flash memory.................................................................................................... .....1391 32.1 features ....................................................................................................................... ..........1391 32.2 memory configuration................................... .......................................................................1 392 32.3 functional outline ............................................................................................................. ...1394 32.4 rewriting by dedicated flash memory programmer . .......................................................1397 32.4.1 programming env ironment ...................................................................................................... 13 97 32.4.2 communicati on m ode ............................................................................................................. 1398 32.4.3 flash memory cont rol........................................................................................................... ... 1406 32.4.4 selection of comm unication mode ........................................................................................... 1407 32.4.5 communication commands ..................................................................................................... 1408 32.4.6 pin connec tion................................................................................................................. ........ 1409 32.5 rewriting by self programming ........ ..................................................................................1414 32.5.1 overvi ew ....................................................................................................................... .......... 1414 32.5.2 featur es ....................................................................................................................... ........... 1415 32.5.3 standard self progr amming fl ow.............................................................................................. 141 8 32.5.4 flash f uncti ons ................................................................................................................ ........ 1419 32.5.5 pin proc essi ng................................................................................................................. ........ 1419 32.5.6 internal res ources used........................................................................................................ ... 1420 chapter 33 option byte function............................ .............................................................14 21 33.1 option byte (0000007ah).............................................. .......................................................142 2
user?s manual u19201ej3v0ud 20 33.2 option byte (0000007 bh) .................................................................................................... 1423 chapter 34 on-chip debug function ....................... ............................................................ 1425 34.1 debugging with dcu ........................................................................................................... 14 26 34.1.1 connection circui t exam ple..................................................................................................... .1426 34.1.2 interface signal s .............................................................................................................. ........1427 34.1.3 maskable f uncti ons............................................................................................................. .....1429 34.1.4 regist er ....................................................................................................................... ............1429 34.1.5 operat ion...................................................................................................................... ...........1431 34.1.6 cauti ons ....................................................................................................................... ...........1432 34.2 debugging without using dcu ........................................ .................................................. 1433 34.2.1 circuit connecti on exam ples.................................................................................................... 1433 34.2.2 maskable f uncti ons............................................................................................................. .....1435 34.2.3 securement of us er resour ces.................................................................................................14 36 32.2.4 c auti ons ............................................................................................................... ......................1443 34.3 rom security function ....................................................................................................... 144 4 34.3.1 security id .................................................................................................................... ...........1444 34.3.2 setti ng ........................................................................................................................ .............1445 chapter 35 electrical specifications ....................... ........................................................ 1447 35.1 absolute maximum ratings ................................................................................................ 1447 35.2 capacitance .................................................................................................................... ...... 1449 35.3 operating conditions .......................................................................................................... 1 449 35.4 oscillator characteristi cs.................................................................................................... 1 450 35.4.1 main clock oscillator characteri stics.........................................................................................1 450 35.4.2 subclock oscillator c haracterist ics ...........................................................................................1 453 35.4.3 pll characte ristics ............................................................................................................ ......1454 35.4.4 sscg characte ristics ........................................................................................................... ...1454 35.4.5 internal oscillator characteri stics............................................................................................ ..1454 35.5 regulator characteristics ................................................................................................... 145 5 35.6 dc characteristics ............................................................................................................. .. 1456 35.6.1 i/o level ...................................................................................................................... .............1456 35.6.2 supply cu rrent ................................................................................................................. ........1458 35.7 data retention characteristics... ........................................................................................ 1459 35.8 ac characteristics ............................................................................................................. .. 1460 35.8.1 clkout output timi ng ........................................................................................................... .1461 35.8.2 bus ti ming..................................................................................................................... ...........1462 35.9 basic operation................................................................................................................ .... 1475 35.10 flash memory programming characteristics ............. ...................................................... 1486 chapter 36 package drawings .............................................................................................. 14 88 chapter 37 recommended soldering conditions. ........................................................ 1490 appendix a development tools............................................................................................. 14 92 a.1 software package ............................................................................................................... . 1497 a.2 language processing software ......................................................................................... 1497
user?s manual u19201ej3v0ud 21 a.3 control software ............................................................................................................... ....1497 a.4 debugging tools (hardware)........................................... ....................................................1498 a.4.1 when using iecube qb-v850esx3 h.................................................................................... 1498 a.4.2 when using on-chip debug emul ator ie-v850e 1-cd-nw ....................................................... 1501 a.4.3 when using minicu be qb-v850m ini .................................................................................... 1502 a.4.4 when using minicu be2 qb-mi ni2 ........................................................................................ 1503 a.5 debugging tools (software) ............................................ ....................................................1504 a.6 embedded software .............................................................................................................1 505 a.7 flash memory writing tools................................................................................................1506 appendix b register index .................................................................................................. ......1507 appendix c instruction set list........................................................................................... .1527 c.1 conventions .................................................................................................................... ......1527 c.2 instruction set (in alphabetical order).................... ...........................................................1530 appendix d list of cautions............................................................................................... .....1537 appendix e revision history ................................................................................................ ....1592 e.1 major revisions in this edition................................... ........................................................1592 e.2 revision history of previous editions........................ ........................................................1596
user?s manual u19201ej3v0ud 22 chapter 1 introduction the v850e/sj3-h and v850e/sk3-h are the products in the nec electronics v850 single-chip microcontrollers designed for real-time control applications. 1.1 general the v850e/sj3-h and v850e/sk3-h are 32-bit single-chip microcontrollers that include the v850e1 cpu core and peripheral functions such as rom/ram, a timer/counter, seri al interfaces, an a/d converter, and a d/a converter. as for automotive lan, the v850e/sj3-h a nd v850e/sk3-h are provided with iebus tm (inter equipment bus tm ), and some of the models are also provided with can (controller area network). in addition to high real-time response characteristics a nd 1-clock-pitch basic instructions, the v850e/sj3-h and v850e/sk3-h feature multiply in structions, saturated operation instructions, bi t manipulation instructions, etc., realized by a hardware multiplier, as optimum instructions for digital servo control applications. moreover, as a real-time control system, the v850e/sj3-h and v850e/sk3-h enable extremely high cost performan ce for automotive-use multimedia equipment such as car audio systems. table 1-1 lists the products of the v850e/sj3-h and v850e/sk3-h. a model of the v850e/sj3-h and v850e/sk3-h with reduced i/o, timer/counter, and serial interface functions, v850es/sj3, is also available. see table 1-2 list of v850es/sj3 products .
chapter 1 introduction user?s manual u19201ej3v0ud 23 table 1-1. v850e/sj3-h and v850e/sk3-h products (1/2) (a) v850e/sj3-h (144-pin plastic lqfp (20 20)) rom maskable interrupts function part number type size ram size (+ expanded internal ram size) operating frequency (max.) i 2 c automotive lan external internal non- maskable interrupts pd70f3474 iebus: 1 ch 94 pd70f3475 iebus/can: 1 ch 98 pd70f3476 1280 kb iebus/can: 1 ch, can: 1 ch 102 pd70f3477 iebus: 1 ch 94 pd70f3478 iebus/can: 1 ch 98 pd70f3479 1536 kb 60 kb (+ 32 kb) iebus/can: 1 ch, can: 1 ch 102 pd70f3931 iebus: 1 ch 88 pd70f3932 iebus/can: 1 ch 92 pd70f3933 512 kb 60 kb (none) iebus/can: 1 ch, can: 1 ch 96 pd70f3934 iebus: 1 ch 94 pd70f3935 iebus/can: 1 ch 98 pd70f3936 768 kb iebus/can: 1 ch, can: 1 ch 102 pd70f3937 iebus: 1 ch 94 pd70f3938 iebus/can: 1 ch 98 pd70f3939 flash memory 1024 kb 60 kb (+16 kb) 48 mhz on-chip iebus/can: 1 ch, can: 1 ch 10 102 2 remark also read caution and remark on the next page.
chapter 1 introduction user?s manual u19201ej3v0ud 24 table 1-1. v850e/sj3-h and v850e/sk3-h products (2/2) (b) v850e/sk3-h (176-pin plastic lqfp (24 24)) rom maskable interrupts function part number type size ram size (+ expanded internal ram size) operating frequency (max.) i 2 c automotive lan external internal non- maskable interrupts pd70f3480 iebus: 1 ch 94 pd70f3481 iebus: 1 ch, can: 1 ch 98 pd70f3482 1536 kb iebus: 1 ch, can: 2 ch 102 pd70f3486 iebus: 1 ch 94 pd70f3487 iebus: 1 ch, can: 1 ch 98 pd70f3488 1280 kb 60 kb (+ 32 kb) iebus: 1 ch, can: 2 ch 102 pd70f3925 iebus: 1 ch 94 pd70f3926 iebus: 1 ch, can: 1 ch 98 pd70f3927 flash memory 1024 kb 60 kb (+ 16 kb) 48 mhz on-chip iebus: 1 ch, can: 2 ch 10 102 2 caution note with caution that in addition to the contents of the above table, the pd70f3931, 70f3932, and 70f3933 also differ from the other products in terms of the following functions. part number csie i 2 c pd70f3931, 70f3932, 70f3933 none 4 ch other than pd70f3931, 70f3932, and 70f3933 on-chip (2 ch) 6 ch remark the part numbers of the v850e/sj3-h and v850e/sk3-h are shown as follows in this manual. ? can controller version pd70f3475, 70f3476, 70 f3478, 70f3479, 70f3481, 70f3482, 70f3487, 70f3488, 70f3926, 70f3927, 70f3932, 70f3933, 70f3935, 70f3936, 70f3938, and 70f3939 ? can controller (2-channel) version pd70f3476, 70f3479, 70f3482, 70f3488, 70f3927, 70f3933, 70f3936, and 70f3939 ? expanded internal ram version pd70f3474, 70f3475, 70 f3476, 70f3477, 70f3478, 70f3479, 70f3480, 70f3481, 70f3482, 70f3486, 70f3487, 70f3 488, 70f3925, 70f3926, 70f3927, 70f 3934, 70f3935, 70f3936, 70f3937, 70f3938, and 70f3939
chapter 1 introduction user?s manual u19201ej3v0ud 25 table 1-2. v850es/sj3 products rom maskable interrupts function part number type size ram size operating frequency (max.) i 2 c automotive lan external internal non- maskable interrupts pd70f3344 384 kb 32 kb pd70f3345 512 kb 40 kb pd70f3346 640 kb 48 kb pd70f3347 768 kb 60 kb pd70f3348 1024 kb 60 kb iebus: 1 ch pd70f3354 384 kb 32 kb pd70f3355 512 kb 40 kb pd70f3356 640 kb 48 kb pd70f3357 768 kb 60 kb pd70f3358 1024 kb 60 kb iebus/can: 1 ch 64 pd70f3364 384 kb 32 kb pd70f3365 512 kb 40 kb pd70f3366 640 kb 48 kb pd70f3367 768 kb 60 kb pd70f3368 flash memory 1024 kb 60 kb 32 mhz on-chip iebus/can: 1 ch, can: 1 ch 9 68 2 1.2 features minimum instruction execution time: 20.8 ns (operating with 48 mhz) general-purpose registers: 32 bits 32 registers cpu features: signed multiplication (16 16 32): 1 or 2 clocks signed multiplication (32 32 64): 1 or 2 clocks saturated operations (overflow and underflow detection functions included) 32-bit shift instruction: 1 clock bit manipulation instructions load/store instructions with long/short format signed load instruction memory space: 64 mb of linear address space (for programs and data) external expansion: up to approximately 30 mb ? internal memory: ram: 60 kb (see table 1-1 ) expanded internal ram: 16/32 kb (see table 1-1 ) flash memory: 512/768/1024/1280/1536 kb (see table 1-1 ) ? external bus interface: separate bus/multiplexed bus output selectable 8-/16-bit data bus sizing function wait function ? programmable wait function ? external wait function idle state function bus hold function
chapter 1 introduction user?s manual u19201ej3v0ud 26 interrupts and exceptions: non-maskable interrupts: 2 sources maskable interrupts: 98/10 2/104/106/108/112 sources (see table 1-1 ) software exceptions: 32 sources exception trap: 2 sources i/o lines: i/o ports: 128 (v850e/sj3-h) 156 (v850e/sk3-h) timer function: 16-bit interval timer m (tmm): 3 channels 16-bit timer/event counter p (tmp): 9 channels (tmp7 and tmp8 include the encoder count function) 16-bit timer/event counter q (tmq): 1 channel watch timer: 1 channel real-time counter (rtc) 1 channel watchdog timer: 1 channel real-time output port: 6 bits 2 channels serial interface: asynchronous serial interface a (uarta): 6 channels asynchronous serial interface b (uartb): 2 channels 3-wire variable length serial interface b (csib): 6 channels 3-wire variable length serial interface e (csie): 2 channels (other than pd70f3931(v850e/sj3-h), 70f39 32 (v850e/sj3-h), and 70f3933 (v850e/sj3-h)) 0 channels ( pd70f3931 (v850e/sj3-h), 70f3932 (v850e/ sj3-h), and 70f3933 (v850e/sj3-h) only) i 2 c bus interface (i 2 c): 6 channels (other than pd70f3931 (v850e/sj3-h), 70f393 2 (v850e/sj3-h), and 70f3933 (v850e/sj3-h)) 4 channels ( pd70f3931 (v850e/sj3-h), 70f3932 (v850e/ sj3-h), and 70f3933 (v850e/sj3-h) only) uarta: 1 channel uartb: 2 channels csib: 3 channels note csie: 1 channel (other than pd70f3931 (v850e/sj3-h), 70f39 32 (v850e/sj3-h), and 70f3933 (v850e/sj3-h)) 0 channels ( pd70f3931(v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h) only) i 2 c: 2 channels (other than pd70f3931 (v850e/sj3-h), 70f393 2 (v850e/sj3-h), and 70f3933 (v850e/sj3-h)) 1 channel ( pd70f3931 (v850e/sj3-h), 70f3932 (v850e/ sj3-h), and 70f3933 (v850e/sj3-h) only) csib/i 2 c: 1 channel uarta/csib: 1 channel uarta/csie: 1 channel (other than pd70f3931 (v850e/sj3-h), 70f39 32 (v850e/sj3-h), and 70f3933 (v850e/sj3-h)) 0 channels ( pd70f3931 (v850e/sj3-h), 70f3932 (v 850e/sj3-h), and 70f3933 (v850e/sj3-h) only) uarta/ i 2 c: 2 channels note
chapter 1 introduction user?s manual u19201ej3v0ud 27 uarta/csib/i 2 c: 1 channel (other than pd70f3931 (v850e/sj3-h), 70f39 32 (v850e/sj3-h), and 70f3933 (v850e/sj3-h)) 0 channels ( pd70f3931 (v850e/sj3-h), 70f3932 (v 850e/sj3-h), and 70f3933 (v850e/sj3-h) only) note these channels can also be used in the following combinations. csib: 2 channels uarta/i 2 c: 1 ch csib (reception only)/uarta/i 2 c: 1 channel caution in the v850e/sk3-h, serial in terfaces can also be used in the following combinations. uarta: 5 channels uartb: 2 channels csib: 3 channels csie: 2 channels i 2 c: 4 channels csib/i 2 c: 2 channels uarta/csib: 1 channel iebus controller: 1 channel can controller: 1/2 channels (can controller version only) a/d converter: 10-bit resolution: 16 channels d/a converter: 8-bit resolution: 2 channels dma controller: 4 channels crc function: generates 16-bit error detection code for data in 8-bit units dcu (debug control unit): jtag interface rom correction: 8 correct ion addresses specifiable clock generator: during main clock or subclock operation 7-level cpu clock (f xx , f xx /2, f xx /4, f xx /8, f xx /16, f xx /32, f xt ) clock-through mode/pll mode/sscg mode selectable clock generation function selectable by setting the option byte internal oscillation clock: 220 khz (typ.) power-save functions: halt/idle1/idle2/stop/subclock/sub-idle mode package: 144-pin plastic lqfp (fine pitch) (20 20) (v850e/sj3-h) 176-pin plastic lqfp (fine pitch) (24 24) (v850e/sk3-h) 1.3 application fields automotive-use multimedia such as car audio systems
chapter 1 introduction user?s manual u19201ej3v0ud 28 1.4 ordering information 1.4.1 v850e/sj3-h part number package internal rom (flash memory) quality grade pd70f3474gja-gae-g pd70f3475gja-gae-g pd70f3476gja-gae-g 1280 kb pd70f3477gja-gae-g pd70f3478gja-gae-g pd70f3479gja-gae-g 1536 kb pd70f3931gja-gae-g pd70f3932gja-gae-g pd70f3933gja-gae-g 512 kb pd70f3934gja-gae-g pd70f3935gja-gae-g pd70f3936gja-gae-g 768 kb pd70f3937gja-gae-g pd70f3938gja-gae-g pd70f3939gja-gae-g 144-pin plastic lqfp (fine pitch) (20 20) 1024 kb (a) remark the v850e/sj3-h microcontrollers are lead-free products. please refer to "quality grades on nec semiconductor devices" (document no. c11531e) published by nec electronics corporation to know t he specification of quality grade on the devices and its recommended applications.
chapter 1 introduction user?s manual u19201ej3v0ud 29 1.4.2 v850e/sk3-h part number package internal rom (flash memory) quality grade pd70f3480gma-gar-g pd70f3481gma-gar-g pd70f3482gma-gar-g 1536 kb pd70f3486gma-gar-g pd70f3487gma-gar-g pd70f3488gma-gar-g 1280 kb pd70f3925gma-gar-g pd70f3926gma-gar-g pd70f3927gma-gar-g 176-pin plastic lqfp (fine pitch) (24 24) 1024 kb (a) remark the v850e/sk3-h microcontrollers are lead-free products. please refer to "quality grades on nec semiconductor devices" (document no. c11531e) published by nec electronics corporation to know t he specification of quality grade on the devices and its recommended applications. 1.5 pin configuration (top view) 1.5.1 v850e/sj3-h 144-pin plastic lqfp (fine pitch) (20 20) pd70f3474gja-gae-g pd70f3476gja-gae-g pd70f3478gja-gae-g pd70f3475gja-gae-g pd70f3477gja-gae-g pd70f3479gja-gae-g pd70f3931gja-gae-g pd70f3932gja-gae-g pd70f3933gja-gae-g pd70f3934gja-gae-g pd70f3935gja-gae-g pd70f3936gja-gae-g pd70f3937gja-gae-g pd70f3938gja-gae-g pd70f3939gja-gae-g
chapter 1 introduction user?s manual u19201ej3v0ud 30 pdl3/ad3 pdl2/ad2 pdl1/ad1 pdl0/ad0 bv dd bv ss pct7 pct6/astb pct5 pct4/rd pct3 pct2 pct1/wr1 pct0/wr0 pcs7 pcs6 pcs5 pcs4 pcm5 pcm4 pcm3/hldrq pcm2/hldak pcm1/clkout pcm0/wait pcs3/cs3 pcs2/cs2 pcs1/cs1 pcs0 pcd3/txdb1 pcd2/rxdb1 pcd1/txdb0 pcd0/rxdb0 p915/a15 note 7 /intp6/tip50/top50 p914/a14 note 7 /intp5/tip51/top51 p913/a13 note 7 /intp4 p912/a12 note 7 /sckb3 av ref0 av ss p10/ano0 p11/ano1 av ref1 p00/tip61/top61/sda04 note 1 p01/tip60/top60/scl04 note 1 flmd0 note 2 v dd regc note 3 v ss x1 x2 reset xt1 xt2 p02/nmi p03/intp0/adtrg p04/intp1 p05/intp2/drst note 4 p06/intp3 p40/sib0/sda01 p41/sob0/scl01 p42/sckb0/intp2 p30/txda0/sob4 p31/rxda0/intp7/sib4 p32/ascka0/sckb4/tip00/top00 p33/tip01/top01/ctxd1 note 5 p34/tip10/top10/crxd1 note 5 p35/tip11/top11 p36/ctxd0 note 6 /ietx0 p37/crxd0 note 6 /ierx0 ev ss ev dd p38/txda2/sda00/sib2 p39/rxda2/scl00/sckb2 p50/kr0/tiq01/toq01/rtp00 p51/intp7/kr1/tiq02/toq02/rtp01 p52/kr2/tiq03/toq03/rtp02/ddi p53/sib2/kr3/tiq00/toq00/rtp03/ddo p54/sob2/kr4/rtp04/dck p55/sckb2/kr5/rtp05/dms p60/rtp10/rxda4/sie0 note 1 p61/rtp11/txda4/soe0 note 1 p62/rtp12/scke0 note 1 p63/rtp13/sie1 note 1 /kr4 p64/rtp14/soe1 note 1 /kr5 p65/rtp15/scke1 note 1 /kr2/tiq03/toq03 p66/sib5/intp9/kr3/tiq00/toq00 p67/sob5/rxda5/sda05 note 1 p68/sckb5/txda5/scl05 note 1 p69/tip70/top70/tenc70 p610/tip71/tenc71 p611/top71/tecr7 p612/tip80/top80/tenc80 p613/tip81/top81/tenc81 p614/sda03/tecr8 p615/scl03 p80/rxda3/intp8/rc1ck1hz p81/txda3/rc1cko/rc1ckdiv p90/a0 note 7 /kr6/txda1/sda02 p91/a1 note 7 /kr7/rxda1/kr7/scl02 p92/a2 note 7 /tip41/top41 p93/a3 note 7 /tip40/top40/intp8 p94/a4 note 7 /tip31/top31 p95/a5 note 7 /tip30/top30/intp5 p96/a6 note 7 /tip21/top21 p97/a7 note 7 /sib1/tip20/top20 p98/a8 note 7 /sob1 p99/a9 note 7 /sckb1 p910/a10 note 7 /sib3 p911/a11 note 7 /sob3 p70/ani0 note 8 p71/ani1 note 8 p72/ani2 note 8 p73/ani3 note 8 p74/ani4 note 8 p75/ani5 note 8 p76/ani6 note 8 p77/ani7 note 8 p78/ani8 note 8 p79/ani9 note 8 p710/ani10 note 8 p711/ani11 note 8 p712/ani12 note 8 p713/ani13 note 8 p714/ani14 note 8 p715/ani15 note 8 pdh7/a23 pdh6/a22 pdh5/a21 pdh4/a20 pdh3/a19 pdh2/a18 pdh1/a17 pdh0/a16 pdl15/ad15 pdl14/ad14 pdl13/ad13 pdl12/ad12 pdl11/ad11 pdl10/ad10 pdl9/ad9 pdl8/ad8 pdl7/ad7 pdl6/ad6 pdl5/ad5/flmd1 pdl4/ad4 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 notes 1. sie0, soe0, scke0, sie1, soe1, scke1, scl04, sda04, scl05, and sda05 are available only in products other than the pd70f3931 (v850e/sj3-h), 70f393 2 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). 2. set this pin to low level in the normal operation mode. 3. connect the regc pin to v ss via a 4.7 f capacitor. 4. fix this pin to the low level from when the reset status has been released until the ocdm.ocdm0 bit is cleared (0) when the on-chip debug func tion is not used. for details, see 4.6.3 cautions on on-chip debug pins . in addition, this pin incorporates a pull-down re sistor and it can be disc onnected by clearing the ocdm.ocdm0 bit. 5. ctxd1 and crxd1 are valid only in t he can controller (2-channel) version. 6. ctxd0 and crxd0 are valid only in the can controller version. 7. port 9 cannot be used as port pins or other alter nate-function pins when the a0 to a15 pins are used in the separate bus mode. 8. to use port 7 (p70/ani0 to p715/ani15) as a/d conv erter function pins and port i/o pins in mix, be sure to observe usage cautions (see 13.6 (4) alternate i/o ).
chapter 1 introduction user?s manual u19201ej3v0ud 31 pin names a0 to a23: ad0 to ad15: adtrg: ani0 to ani15: ano0, ano1: ascka0: astb: av ref0 , av ref1 : av ss : bv dd : bv ss : clkout: crxd0, crxd1: cs1 to cs3: ctxd0, ctxd1: dck: ddi: ddo: dms: drst: ev dd : ev ss : flmd0, flmd1: hldak: hldrq: ierx0: ietx0: intp0 to intp9: kr0 to kr7: nmi: p00 to p06: p10, p11: p30 to p39: p40 to p42: p50 to p55: p60 to p615: p70 to p715: p80, p81: p90 to p915: pcd0 to pcd3: pcm0 to pcm5: pcs0 to pcs7: pct0 to pct7: pdh0 to pdh7: pdl0 to pdl15: rc1ck1hz, rc1ckdiv, rc1cko: address bus address/data bus a/d trigger input analog input analog output asynchronous serial clock address strobe analog reference voltage analog v ss power supply for bus interface ground for bus interface clock output can receive data chip select can transmit data debug clock debug data input debug data output debug mode select debug reset power supply for port ground for port flash programming mode hold acknowledge hold request iebus receive data iebus transmit data external interrupt input key return non-maskable interrupt request port 0 port 1 port 3 port 4 port 5 port 6 port 7 port 8 port 9 port cd port cm port cs port ct port dh port dl real-time counter clock output rd: regc: reset: rtp00 to rtp05, rtp10 to rtp15: rxda0 to rxda5, rxdb0, rxdb1: sckb0 to sckb5, scke0, scke1: scl00 to scl05: sda00 to sda05: sib0 to sib5, sie0, sie1: sob0 to sob5, soe0, soe1: tecr7, tecr8: tenc70, tenc71, tenc80, tenc81: tip00, tip01, tip10, tip11, tip20, tip21, tip30, tip31, tip40, tip41, tip50, tip51, tip60, tip61, tip70, tip71, tip80, tip81, tiq00 to tiq03: top00, top01, top10, top11, top20, top21, top30, top31, top40, top41, top50, top51, top60, top61, top70, top71, top80, top81, toq00 to toq03: txda0 to txda5, txdb0, txdb1: v dd : v ss : wait: wr0: wr1: x1, x2: xt1, xt2: read strobe regulator control reset real-time output port receive data serial clock serial clock serial data serial input serial output timer encoder clear input timer encoder input timer input timer output transmit data power supply ground wait lower byte write strobe upper byte write strobe crystal for main clock crystal for subclock
chapter 1 introduction user?s manual u19201ej3v0ud 32 1.5.2 v850e/sk3-h 176-pin plastic lqfp (fine pitch) (24 24) pd70f3480gma-gar-g pd70f3481gma-gar-g pd70f3482gma-gar-g pd70f3486gma-gar-g pd70f3487gma-gar-g pd70f3488gma-gar-g pd70f3925gma-gar-g pd70f3926gma-gar-g pd70f3927gma-gar-g
chapter 1 introduction user?s manual u19201ej3v0ud 33 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 pdl3/ad3 pdl2/ad2 pdl1/ad1 pdl0/ad0 p133 p132 p131 p130 bv dd bv ss pct7 pct6/astb pct5 pct4/rd pct3 pct2 pct1/wr1 pct0/wr0 pcs7 pcs6 pcs5 pcs4 pcm5 pcm4 pcm3/hldrq pcm2/hldak pcm1/clkout pcm0/wait pcs3/cs3 pcs2/cs2 pcs1/cs1 pcs0 pcd3/txdb1 pcd2/rxdb1 pcd1/txdb0 pcd0/rxdb0 p153/intp6 p152/intp9 p151/txda1 p150/rxda1/kr7 p915/a15 note 6 /intp6/tip50/top50 p914/a14 note 6 /intp5/tip51/top51 p913/a13 note 6 /intp4 p912/a12 note 6 /sckb3 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 p70/ani0 note 7 p71/ani1 note 7 p72/ani2 note 7 p73/ani3 note 7 p74/ani4 note 7 p75/ani5 note 7 p76/ani6 note 7 p77/ani7 note 7 p78/ani8 note 7 p79/ani9 note 7 p710/ani10 note 7 p711/ani11 note 7 p712/ani12 note 7 p713/ani13 note 7 p714/ani14 note 7 p715/ani15 note 7 p145 p144 p143 p142 p141 p140 bv ss bv dd pdh7/a23 pdh6/a22 pdh5/a21 pdh4/a20 pdh3/a19 pdh2/a18 pdh1/a17 pdh0/a16 pdl15/ad15 pdl14/ad14 pdl13/ad13 pdl12/ad12 pdl11/ad11 pdl10/ad10 pdl9/ad9 pdl8/ad8 pdl7/ad7 pdl6/ad6 pdl5/ad5/flmd1 pdl4/ad4 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 p50/kr0/tiq01/toq01/rtp00 p51/intp7/kr1/tiq02/toq02/rtp01 p52/kr2/tiq03/toq03/rtp02/ddi p53/sib2/kr3/tiq00/toq00/rtp03/ddo p54/sob2/kr4/rtp04/dck p55/sckb2/kr5/rtp05/dms p56/rxda4 p57/txda4 p60/rtp10/rxda4/sie0 p61/rtp11/txda4/soe0 p62/rtp12/scke0 p63/rtp13/sie1/kr4 p64/rtp14/soe1/kr5 p65/rtp15/scke1/kr2/tiq03/toq03 p66/sib5/intp9/kr3/tiq00/toq00 p67/sob5/rxda5/sda05 p68/sckb5/txda5/scl05 p69/tip70/top70/tenc70 p610/tip71/tenc71 p611/top71/tecr7 p612/tip80/top80/tenc80 p613/tip81/top81/tenc81 p614/sda03/tecr8 p615/scl03 ev dd ev ss p80/rxda3/intp8/rc1ck1hz p81/txda3/rc1cko/rc1ckdiv p82/sda05 p83/scl05 p84/rxda5 p85/txda5 p90/a0 note 6 /kr6/txda1/sda02 p91/a1 note 6 /kr7/rxda1/kr7/scl02 p92/a2 note 6 /tip41/top41 p93/a3 note 6 /tip40/top40/intp8 p94/a4 note 6 /tip31 /top31 p95/a5 note 6 /tip30/top30/intp5 p96/a6 note 6 / tip21/top21 p97/a7 note 6 /sib1/tip20/top20 p98/a8 note 6 /sob1 p99/a9 note 6 /sckb1 p910/a10 note 6 /sib3 p911/a11 note 6 /sob3 av ref0 av ss p10/ano0 p11/ano1 av ref1 p00/tip61/top61/sda04 p01/tip60/top60/scl04 p20/sda04 p21/scl04 flmd0 note 1 v dd regc note 2 v ss x1 x2 reset xt1 xt2 p02/nmi p03/intp0/adtrg p04/intp1 p05/intp2/drst note 3 p06/intp3 p40/sib0/sda01 p41/sob0/scl01 p42/sckb0/intp2 p43 p44/ietx0 p45/ierx0 p30/txda0/sob4 p31/rxda0/intp7/sib4 p32/ascka0/sckb4/tip00/top00 p33/tip01/top01/ctxd1 note 4 p34/tip10/top10/crxd1 note 4 p35/tip11/top11 p36/ctxd0 note 5 /ietx0 p37/crxd0 note 5 /ierx0 ev ss ev dd p38/txda2/sda00/sib2 p39/rxda2/scl00/sckb2 p310/sob2 p311/txda2 p312/rxda2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 notes 1. set this pin to low level in the normal operation mode. 2. connect the regc pin to v ss via a 4.7 f capacitor. 3. fix this pin to the low level from when the reset status has been released until the ocdm.ocdm0 bit is cleared (0) when the on-chip debug func tion is not used. for details, see 4.6.3 cautions on on-chip debug pins . in addition, this pin incorporates a pull-down resistor and it can be disconnected by clearing the ocdm.ocdm0 bit. 4. ctxd1 and crxd1 are valid only in t he can controller (2-channel) version. 5. ctxd0 and crxd0 are valid only in the can controller version. 6. port 9 cannot be used as port pins or other alternat e-function pins when the a0 to a15 pins are used in the separate bus mode. 7. to use port 7 (p70/ani0 to p715/ani15) as a/d converter function pins and port i/o pins in mix, be sure to observe usage cautions (see 13.6 (4) alternate i/o ).
chapter 1 introduction user?s manual u19201ej3v0ud 34 pin names a0 to a23: ad0 to ad15: adtrg: ani0 to ani15: ano0, ano1: ascka0: astb: av ref0 , av ref1 : av ss : bv dd : bv ss : clkout: crxd0, crxd1: cs1 to cs3: ctxd0, ctxd1: dck: ddi: ddo: dms: drst: ev dd : ev ss : flmd0, flmd1: hldak: hldrq: ierx0: ietx0: intp0 to intp9: kr0 to kr7: nmi: p00 to p06: p10, p11: p20, p21: p30 to p312: p40 to p45: p50 to p57: p60 to p615: p70 to p715: p80 to p85: p90 to p915: p130 to p133: p140 to p145: p150 to p153: pcd0 to pcd3: pcm0 to pcm5: pcs0 to pcs7: pct0 to pct7: pdh0 to pdh7: address bus address/data bus a/d trigger input analog input analog output asynchronous serial clock address strobe analog reference voltage analog v ss power supply for bus interface ground for bus interface clock output can receive data chip select can transmit data debug clock debug data input debug data output debug mode select debug reset power supply for port ground for port flash programming mode hold acknowledge hold request iebus receive data iebus transmit data external interrupt input key return non-maskable interrupt request port 0 port 1 port 2 port 3 port 4 port 5 port 6 port 7 port 8 port 9 port 13 port 14 port 15 port cd port cm port cs port ct port dh pdl0 to pdl15: rc1ck1hz, rc1ckdiv, rc1cko: rd: regc: reset: rtp00 to rtp05, rtp10 to rtp15: rxda0 to rxda5, rxdb0, rxdb1: sckb0 to sckb5, scke0, scke1: scl00 to scl05: sda00 to sda05: sib0 to sib5, sie0, sie1: sob0 to sob5, soe0, soe1: tecr7, tecr8: tenc70, tenc71, tenc80, tenc81: tip00, tip01, tip10, tip11, tip20, tip21, tip30, tip31, tip40, tip41, tip50, tip51, tip60, tip61, tip70, tip71, tip80, tip81, tiq00 to tiq03: top00, top01, top10, top11, top20, top21, top30, top31, top40, top41, top50, top51, top60, top61, top70, top71, top80, top81, toq00 to toq03: txda0 to txda5, txdb0, txdb1: v dd : v ss : wait: wr0: wr1: x1, x2: xt1, xt2: port dl real-time counter clock output read strobe regulator control reset real-time output port receive data serial clock serial clock serial data serial input serial output timer encoder clear input timer encoder input timer input timer output transmit data power supply ground wait lower byte write strobe upper byte write strobe crystal for main clock crystal for subclock
chapter 1 introduction user?s manual u19201ej3v0ud 35 1.6 function block configuration 1.6.1 internal block diagram (1) v850e/sj3-h toq00 to toq03 tiq00 to tiq03 rtp00 to rtp05, rtp10 to rtp15 nmi intp0 to intp9 top00 to top80, top01 to top81 tip00 to tip80, tip01 to tip81, tecr7, tecr8, tenc70, tenc71, tenc80, tenc81 kr0 to kr7 rto dmac intc rom correction note 1 note 2 ram rom pdl0 to pdl15 pdh0 to pdh7 pct0 to pct7 pcs0 to pcs7 pcm0 to pcm5 pcd0 to pcd3 p90 to p915 p80, p81 p70 to p715 p60 to p615 p50 to p55 p40 to p42 p30 to p39 p10, p11 p00 to p06 av ref1 ano0, ano1 ani0 to ani15 av ss av ref0 adtrg v850e1 cpu cpu memc bcu pc alu hldrq hldak astb rd wait wr0, wr1 a0 to a23 ad0 to ad15 cs1 to cs3 rc1ck1hz, rc1ckdiv, rc1cko rtc can1 note 6 ctxd1 note 6 crxd1 note 6 iebus can0 note 5 ctxd0 note 5 /ietx0 crxd0 note 5 /ierx0 flmd0 flmd1 cg pll sscg lvi clm clkout xt1 xt2 x1 x2 reset v dd v ss regc bv dd bv ss ev dd ev ss drst dms ddi dck ddo sib0/sda01 sob0/scl01 sckb0 csib0 i 2 c01 sie1 note 3 soe1 note 3 scke1 note 3 csie1 note 3 sib1 to sib3 sob1 to sob3 sckb1 to sckb3 csib1 to csib3 txda2/sda00 rxda2/scl00 uarta2 i 2 c00 txda4/soe0 note 3 rxda4/sie0 note 3 scke0 note 3 uarta4 note 3 csie0 txda0/sob4 rxda0/sib4 ascka0/sckb4 uarta0 csib4 txda3 rxda3 uarta3 txda1/sda02 rxda1/scl02 uarta1 i 2 c02 txda5/sckb5/scl05 note 3 rxda5/sob5/sda05 note 3 sib5 csib5 uarta5 note 3 i 2 c05 txdb0, txdb1 rxdb0, rxdb1 uartb0, uartb1 sda03, sda04 note 3 scl03, scl04 note 3 i 2 c03, i 2 c04 note 3 16-bit timer/ counter q: 1 ch 32-bit barrel shifter instruction queue multiplier 32 32 64 general-purpose registers 32 bits 32 system registers a/d converter d/a converter key return function watchdog timer 2 watch timer 16-bit timer/ counter p: 9 ch 16-bit interval timer m: 3 ch internal oscillator regulator ports dcu serial interfaces note 7 note 4 expanded internal ram note 3 notes 1. 512/768/1024/1280/1536 kb (flash memory) (see table 1-1 ) 2. 60 kb (see table 1-1 ) 3. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) 4. 16/32 kb (see table 1-1 ) 5. can controller version only 6. can controller (2-channel) version only
chapter 1 introduction user?s manual u19201ej3v0ud 36 notes 7. another type of the block diagram is available in accordance with the combination of port sharing. sib0/sda01 sob0/scl01 sckb0 csib0 i 2 c01 sie1 note 3 soe1 note 3 scke1 note 3 csie1 note 3 sib1, sib3 sob1, sob3 sckb1, sckb3 csib1, csib3 txda2/sib2/sda00 rxda2/sckb2/scl00 csib2 uarta2 i 2 c00 txda4/soe0 note 3 rxda4/sie0 note 3 scke0 note 3 uarta4 csie0 txda0/sob4 rxda0/sib4 ascka0/sckb4 uarta0 csib4 txda3 rxda3 uarta3 txda1/sda02 rxda1/scl02 uarta1 i 2 c02 txda5/sckb5/scl05 note 3 rxda5/sob5/sda05 note 3 sib5 csib5 uarta5 i 2 c05 txdb0, txdb1 rxdb0, rxdb1 uartb0, uartb1 sda03, sda04 note 3 scl03, scl04 note 3 i 2 c03, i 2 c04 note 3 note 8 note 3 note 3 8. the serial transmit data output pin (sob2) is not provided.
chapter 1 introduction user?s manual u19201ej3v0ud 37 (2) v850e/sk3-h toq00 to toq03 tiq00 to tiq03 rtp00 to rtp05, rtp10 to rtp15 nmi intp0 to intp9 16-bit timer/ counter q: 1 ch top00 to top80, top01 to top81 tip00 to tip80, tip01 to tip81, tecr7, tecr8, tenc70 to tenc71, tenc80 to tenc81 kr0 to kr7 rto dmac intc ram rom pdl0 to pdl15 pdh0 to pdh7 pct0 to pct7 pcs0 to pcs7 pcm0 to pcm5 pcd0 to pcd3 p150 to p153 p140 to p145 p130 to p133 p90 to p915 p80 to p85 p70 to p715 p60 to p615 p50 to p57 p40 to p45 p30 to p312 p20, p21 p10, p11 p00 to p06 av ref1 ano0, ano1 ani0 to ani15 av ss av ref0 adtrg v850e1 cpu cpu memc bcu pc alu hldrq hldak astb rd wait wr0, wr1 a0 to a23 ad0 to ad15 cs1 to cs3 rc1ck1hz, rc1ckdiv, rc1cko rtc can1 note 5 ctxd1 note 5 crxd1 note 5 ctxd0 note 4 crxd0 note 4 iebus ietx0 ierx0 flmd0 flmd1 cg pll sscg lvi clm clkout xt1 xt2 x1 x2 reset v dd v ss regc bv dd bv ss ev dd ev ss drst dms ddi dck ddo sib0/sda01 sob0/scl01 sckb0 csib0 i 2 c01 sie1 soe1 scke1 csie1 sib1 to sib3 sob1 to sob3 sckb1 to sckb3 csib1 to csib3 txda2/sda00 rxda2/scl00 uarta2 i 2 c00 txda4/soe0 rxda4/sie0 scke0 uarta4 csie0 txda0/sob4 rxda0/sib4 ascka0/sckb4 uarta0 csib4 txda3 rxda3 uarta3 txda1/sda02 rxda1/scl02 uarta1 i 2 c02 txda5/sckb5/scl05 rxda5/sob5/sda05 sib5 csib5 uarta5 i 2 c05 txdb0, txdb1 rxdb0, rxdb1 uartb0, uartb1 sda03, sda04 scl03, scl04 i 2 c03, i 2 c04 16-bit timer/ counter p: 9 ch 16-bit interval timer m: 3 ch note 1 note 2 32-bit barrel shifter instruction queue multiplier 32 32  64 general-purpose registers 32 bits 32 system registers internal oscillator ports a/d converter d/a converter key return function watchdog timer 2 watch timer regulator dcu serial interfaces note 6 rom correction can0 note 4 note 3 expanded internal ram notes 1. 1024/1280/1536 kb (flash memory) (see table 1-1 ) 2. 60 kb (see table 1-1 ) 3. 16/32 kb (see table 1-1 ) 4. can controller version only 5. can controller (2-channel) version only
chapter 1 introduction user?s manual u19201ej3v0ud 38 note 6. an example of port sharing combinations is shown in the following block diagram. sib2/sda00 sob2/scl00 sckb2 csib2 i 2 c00 sib0/sda01 sob0/scl01 sckb0 csib0 i 2 c01 sie0, sie1 soe0, soe1 scke0, scke1 csie0, csie1 sib1, sib3, sib5 sob1, sob3, sob5 sckb1, sckb3, sckb5 csib1, csib3, csib5 txda0/sob4 rxda0/sib4 ascka0/sckb4 uarta0 csib4 txda1 to txda5 rxda1 to rxda5 uarta1 to uarta5 txdb0, txdb1 rxdb0, rxdb1 uartb0, uartb1 sda02 to sda04 scl02 to scl04 i 2 c02 to i 2 c05
chapter 1 introduction user?s manual u19201ej3v0ud 39 1.6.2 internal units (1) cpu the cpu uses five-stage pipeline control to enable single -clock execution of address calculations, arithmetic logic operations, data transfers, and almost all other instruction processing. other dedicated on-chip hardware, such as a multiplier (32 bits 32 bits 64 bits) and a barrel shifter (32 bits) contribute to faster complex processing. (2) bus control unit (bcu) the bcu starts a required external bus cycle based on the physical address obtained by the cpu. when an instruction is fetched from external memory space a nd the cpu does not send a bus cycle start request, the bcu generates a prefetch address and prefetches the instruction code. the pref etched instruction code is stored in a cpu internal instruction queue. the bcu controls a memory controller (memc) and accesses an external memory and an expanded internal ram. (a) memory controller (memc) controls access to sram, ex ternal rom, and external i/o. (3) rom this is a 1536/1280/1024/768/512 kb flash memory mapped to addresses 0000 000h to 017ffffh/0000000h to 013ffffh/0000000h to 00fffffh/0000000h to 00bffffh/0000000h to 007ffffh. it can be accessed from the cpu in one clock during instruction fetch. (4) ram this is a 60 kb ram mapped to addresses 3ff0000h to 3ffefffh. it can be accessed from the cpu in one clock during data access. (5) expanded internal ram this is a 32/16 kb ram mapped to addresses 3f e4000h to 3febfffh/3fe8000h to 3febfffh. the expanded internal ram can be accessed in 3 bus cycles (min.). (6) interrupt controller (intc) this controller handles hardware interrupt requests (nm i, intp0 to intp9) from on-chip peripheral hardware and external hardware. eight levels of interrupt priori ties can be specified for these interrupt requests, and multiple servicing control can be performed. (7) clock generator (cg) a main clock oscillator that generates the main clock oscillation frequency (f x ) and a subclock oscillator that generates the subclock oscillation frequency (f xt ) are available. as the main clock frequency, pll input clock frequency (f plli ) is used as it is in the clock-through mode, is mu ltiplied by eight or divided by 2 after multiplied by eight in the pll mode, and is multiplied by eight or twelve in the sscg mode. the cpu clock frequency (f cpu ) can be selected from seven types: f xx , f xx /2, f xx /4, f xx /8, f xx /16, f xx /32, and f xt . as the peripheral clock frequency (f xp ), the main clock frequency (f xx ) is used in the pll mode, and the f plli multiplied by eight or divided by 2 after multipli ed by eight with pll is used in the sscg mode.
chapter 1 introduction user?s manual u19201ej3v0ud 40 (8) internal oscillator an internal oscillator is provided on chip. the oscillation frequency is 220 khz (typ.). an internal oscillator supplies the clock for watchdog timer 2 and timer m. (9) timer/counter nine-channel 16-bit timer/event counter p (tmp) (encoder count function is provided for tmp7 and tmp8), one-channel 16-bit timer/event counter q (tmq), and thre e-channel 16-bit interval timer m (tmm) are provided on chip. (10) watch timer this timer counts the reference time period (0.5 s or 0.25 s) for counting the cloc k (the 32.768 khz from the subclock or the 32.768 khz f brg from prescaler 3). the watch timer can also be used as an interval timer for the main clock. (11) real-time counter (for watch) the real-time counter counts t he reference time (1 second) from the s ubclock (32.768 khz) or main clock for watch counting. this can also be used as the interval timer based on the main clock at the same time. dedicated hardware counters for year, month, week, day, hour, minute, and second are provided, and the real- time counter can count up to 99 years. (12) watchdog timer 2 a watchdog timer is provided on chip to detect inadv ertent program loops, system abnormalities, etc. either the internal oscillation clock, the main clock, or the subclock can be selected as the source clock. watchdog timer 2 generates a non-maskable interrupt request signal (intwdt2) or a system reset signal (wdt2res) after an overflow occurs. with the option byte function, the operation mode of watchdog timer 2 can be fixed to the reset mode. (13) serial interface the v850e/sj3-h and v850e/sk3-h include five kinds of serial interfaces: asynchronous serial interface a (uarta), asynchronous serial interface b (uartb), 3-wire variable-length serial interface b (csib), 3-wire variable-length serial interface e (csie), and an i 2 c bus interface (i 2 c). in the case of uarta, data is transferred via the txda0 to txda5 pins and rxda0 to rxda5 pins. in the case of uartb, data is transferred via t he txdb0 and txdb1 pins and rxdb0 and rxdb1 pins. in the case of csib, data is transferred via the sob0 to sob5 pins, sib0 to sib5 pins, and sckb0 to sckb5 pins. in the case of csie, data is transferred via the soe0 note , soe1 note , sie0 note , sie1 note , scke0 note , and scke1 note pins. in the case of i 2 c, data is transferred via the sda00 to sda03, sda04 note , sda05 note , scl00 to scl03, scl04 note , and scl05 note pins. note not available in the pd70f3931 (v850e/sj3-h), and 70f3932 (v850e/sj3-h), 70f3933 (v850e/sj3- h). (14) iebus controller the iebus controller is a small-scale digital data transmission system for transferring data between units. (15) can controller the can controller is a small-scale digital data transmission system for transferring data between units. the can controller is provided only in the can controller version (see table 1-1 ).
chapter 1 introduction user?s manual u19201ej3v0ud 41 (16) a/d converter this 10-bit a/d converter includes 16 analog input pins. conversion is performed using the successive approximation method. (17) d/a converter a two-channel, 8-bit-resolution d/a converter that uses the r-2r ladder method is provided on chip. (18) dma controller a 4-channel dma controller is provided on chip. this controller transfers data between the internal ram, on- chip peripheral i/o, external memories, and expanded inte rnal ram in response to interrupt requests sent by on-chip peripheral i/o. (19) rom correction a rom correction function that replaces part of a progra m in the internal rom with a program in the internal ram is provided. up to eight correction addresses can be specified. (20) key interrupt function a key interrupt request signal (intkr) can be generated by inputting a falling edge to key input pins (8 channels). (21) real-time output function the real-time output function transfe rs preset 6-bit data to output latches upon the occurrence of a timer compare register match signal. (22) crc function a crc operation circuit that generates 16-bit crc (cyclic redundancy check) code upon setting of 8-bit data is provided on chip. (23) dcu (debug control unit) an on-chip debug function via an on-chip debug emulat or that uses the jtag (joint test action group) communication specifications is pr ovided. switching between the normal port function and on-chip debugging function is done with the control pin input level and the on-chip debug mode register (ocdm).
chapter 1 introduction user?s manual u19201ej3v0ud 42 (24) ports the general-purpose port functions and cont rol pin functions are listed below. port i/o alternate function p0 7-bit i/o timer i/o, serial interface note 2 , nmi, external interrupt, a/d converter trigger, debug reset p1 2-bit i/o d/a converter analog output p2 note 1 2-bit i/o (v850e/sk3-h) serial interface p3 10-bit i/o (v850e/sj3-h) 13-bit i/o (v850e/sk3-h) external interrupt, serial interface, timer i/o, can data i/o note 3 , iebus data i/o p4 3-bit i/o (v850e/sj3-h) 6-bit i/o (v850e/sk3-h) serial interface, external interrupt, iebus data i/o note 1 p5 6-bit i/o (v850e/sj3-h) 8-bit i/o (v850e/sk3-h) timer i/o, real-time output, key interrupt input, external interrupt, serial interface, debug i/o p6 16-bit i/o real-time output, serial interface, timer i/o, encoder input, key interrupt input, external interrupt p7 16-bit i/o a/d converter analog input p8 2-bit i/o (v850e/sj3-h) 6-bit i/o (v850e/sk3-h) serial interface, external interrupt, real-time counter output p9 16-bit i/o external address bus, serial interface, key interrupt input, timer i/o, external interrupt p13 note 1 4-bit i/o (v850e/sk3-h) ? p14 note 1 6-bit i/o (v850e/sk3-h) ? p15 note 1 4-bit i/o (v850e/sk3-h) serial interface, external interrupt, key interrupt input pcd 4-bit i/o serial interface pcm 6-bit i/o external control signal pcs 8-bit i/o chip select output pct 8-bit i/o external control signal pdh 8-bit i/o external address bus pdl 16-bit i/o external address/data bus, fl ash memory programming mode input signal notes 1. v850e/sk3-h only 2. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h) 3. can controller version only
user?s manual u19201ej3v0ud 43 chapter 2 pin functions 2.1 list of pin functions the names and functions of the pins of the v 850e/sj3-h and v850e/sk3-h are described below. there are four types of pin i/o buffer power supplies: av ref0 , av ref1 , bv dd , and ev dd . the relationship between these power supplies and the pins is described below. table 2-1. pin i/o buffer power supplies (a) v850e/sj3-h power supply corresponding pins av ref0 port 7 av ref1 port 1 bv dd ports cd, cm, cs, ct, dh, dl ev dd reset, ports 0, 3 to 6, 8, 9 (b) v850e/sk3-h power supply corresponding pins av ref0 port 7 av ref1 port 1 bv dd ports 13, 14, cd, cm, cs, ct, dh, dl ev dd reset, ports 0, 2 to 6, 8, 9, 15
chapter 2 pin functions user?s manual u19201ej3v0ud 44 (1) port pins (1/6) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function p00 6 6 tip61/top61/sda04 note 3 p01 7 7 tip60/top60/scl04 note 3 p02 17 19 nmi p03 18 20 intp0/adtrg p04 19 21 intp1 p05 note 1 20 22 intp2/drst p06 21 23 i/o port 0 7-bit i/o port input/output can be specified in 1-bit units. n-ch open-drain output can be specified in 1-bit units. 5 v tolerant. intp3 p10 3 3 ano0 p11 4 4 i/o port 1 2-bit i/o port input/output can be specified in 1-bit units. ano1 p20 note 2 ? 8 sda04 note 2 p21 note 2 ? 9 i/o port 2 (v850e/sk3-h only) 2-bit i/o port input/output can be specified in 1-bit units. n-ch open-drain output can be specified in 1-bit units. 5 v tolerant. scl04 note 2 p30 25 30 txda0/sob4 p31 26 31 rxda0/intp7/sib4 p32 27 32 ascka0/sckb4/tip00/top00 p33 28 33 tip01/top01/ctxd1 note 4 p34 29 34 tip10/top10/crxd1 note 4 p35 30 35 tip11/top11 p36 31 36 ctxd0 note 5 /ietx0 p37 32 37 crxd0 note 5 /ierx0 p38 35 40 txda2/sda00/sib2 p39 36 41 rxda2/scl00/sckb2 p310 note 2 ? 42 sob2 note 2 p311 note 2 ? 43 txda2 note 2 p312 note 2 ? 44 i/o port 3 v850e/sj3-h: 10-bit i/o port v850e/sk3-h: 13-bit i/o port input/output can be specified in 1-bit units. n-ch open-drain output can be specified in 1-bit units. 5 v tolerant. rxda2 note 2 notes 1. fix this pin to the low level from when the reset status has been released unt il the ocdm.ocdm0 bit is cleared (0) when the on-chip debug functi on is not used. for details, see 4.6.3 cautions on on-chip debug pins . in addition, this pin incorporates a pull-do wn resistor and it can be disconnected by clearing the ocdm.ocdm0 bit. 2. v850e/sk3-h only 3. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3- h) 4. can controller (2-channel) version only 5. can controller version only remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 45 (2/6) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function p40 22 24 sib0/sda01 p41 23 25 sob0/scl01 p42 24 26 sckb0/intp2 p43 note 1 ? 27 ? p44 note 1 ? 28 ietx0 note 1 p45 note 1 ? 29 i/o port 4 v850e/sj3-h: 3-bit i/o port v850e/sk3-h: 6-bit i/o port input/output can be specified in 1-bit units. n-ch open-drain output can be specified in 1-bit units. 5 v tolerant. ierx0 note 1 p50 37 45 kr0/tiq01/toq01/rtp00 p51 38 46 intp7/kr1/tiq02/toq02/rtp01 p52 39 47 kr2/tiq03/toq03/rtp02/ddi p53 40 48 sib2/kr3/tiq00/toq00/rtp03/ddo p54 41 49 sob2/kr4/rtp04/dck p55 42 50 sckb2/kr5/rtp05/dms p56 note 1 ? 51 rxda4 note 1 p57 note 1 ? 52 i/o port 5 v850e/sj3-h: 6-bit i/o port v850e/sk3-h: 8-bit i/o port input/output can be specified in 1-bit units. n-ch open-drain output can be specified in 1-bit units. 5 v tolerant. txda4 note 1 p60 43 53 rtp10/rxda4/sie0 note 2 p61 44 54 rtp11/txda4/soe0 note 2 p62 45 55 rtp12/scke0 note 2 p63 46 56 rtp13/sie1 note 2 /kr4 p64 47 57 rtp14/soe1 note 2 /kr5 p65 48 58 rtp15/scke1 note 2 /kr2/tiq03/toq03 p66 49 59 sib5/intp9/kr3/tiq00/toq00 p67 50 60 sob5/rxda5/sda05 note 2 p68 51 61 sckb5/txda5/scl05 note 2 p69 52 62 tip70/top70/tenc70 p610 53 63 tip71/tenc71 p611 54 64 top71/tecr7 p612 55 65 tip80/top80/tenc80 p613 56 66 tip81/top81/tenc81 p614 57 67 sda03/tecr8 p615 58 68 i/o port 6 16-bit i/o port input/output can be specified in 1-bit units. n-ch open-drain output can be specified in 1-bit units. 5 v tolerant. scl03 notes 1. v850e/sk3-h only 2. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3- h) remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 46 (3/6) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function p70 144 176 ani0 p71 143 175 ani1 p72 142 174 ani2 p73 141 173 ani3 p74 140 172 ani4 p75 139 171 ani5 p76 138 170 ani6 p77 137 169 ani7 p78 136 168 ani8 p79 135 167 ani9 p710 134 166 ani10 p711 133 165 ani11 p712 132 164 ani12 p713 131 163 ani13 p714 130 162 ani14 p715 129 161 i/o port 7 16-bit i/o port input/output can be specified in 1-bit units. ani15 p80 59 71 rxda3/intp8/rc1ck1hz p81 60 72 txda3/rc1cko/rc1ckdiv p82 note ? 73 sda05 note p83 note ? 74 scl05 note p84 note ? 75 rxda5 note p85 note ? 76 i/o port 8 v850e/sj3-h: 2-bit i/o port v850e/sk3-h: 6-bit i/o port input/output can be specified in 1-bit units. n-ch open-drain output can be specified in 1-bit units. 5 v tolerant. txda5 note note v850e/sk3-h only remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 47 (4/6) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function p90 61 77 a0/kr6/txda1/sda02 p91 62 78 a1/kr7/rxda1/kr7/scl02 p92 63 79 a2/tip41/top41 p93 64 80 a3/tip40/top40/intp8 p94 65 81 a4/tip31/top31 p95 66 82 a5/tip30/top30/intp5 p96 67 83 a6/tip21/top21 p97 68 84 a7/sib1/tip20/top20 p98 69 85 a8/sob1 p99 70 86 a9/sckb1 p910 71 87 a10/sib3 p911 72 88 a11/sob3 p912 73 89 a12/sckb3 p913 74 90 a13/intp4 p914 75 91 a14/intp5/tip51/top51 p915 76 92 i/o port 9 16-bit i/o port input/output can be specified in 1-bit units. n-ch open-drain output can be specified in 1-bit units. 5 v tolerant. a15/intp6/tip50/top50 p130 note ? 125 ? p131 note ? 126 ? p132 note ? 127 ? p133 note ? 128 i/o port 13 (v850e/sk3-h only) 4-bit i/o port input/output can be specified in 1-bit units. ? p140 note ? 155 ? p141 note ? 156 ? p142 note ? 157 ? p143 note ? 158 ? p144 note ? 159 ? p145 note ? 160 i/o port 14 (v850e/sk3-h only) 6-bit i/o port input/output can be specified in 1-bit units. ? p150 note ? 93 rxda1 note /kr7 note p151 note ? 94 txda1 note p152 note ? 95 intp9 note p153 note ? 96 i/o port 15 (v850e/sk3-h only) 4-bit i/o port input/output can be specified in 1-bit units. n-ch open-drain output can be specified in 1-bit units. 5 v tolerant. intp6 note note v850e/sk3-h only remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 48 (5/6) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function pcd0 77 97 rxdb0 pcd1 78 98 txdb0 pcd2 79 99 rxdb1 pcd3 80 100 i/o port cd 4-bit i/o port input/output can be specified in 1-bit units. txdb1 pcm0 85 105 wait pcm1 86 106 clkout pcm2 87 107 hldak pcm3 88 108 hldrq pcm4 89 109 ? pcm5 90 110 i/o port cm 6-bit i/o port input/output can be specified in 1-bit units. ? pcs0 81 101 ? pcs1 82 102 cs1 pcs2 83 103 cs2 pcs3 84 104 cs3 pcs4 91 111 ? pcs5 92 112 ? pcs6 93 113 ? pcs7 94 114 i/o port cs 8-bit i/o port input/output can be specified in 1-bit units. ? pct0 95 115 wr0 pct1 96 116 wr1 pct2 97 117 ? pct3 98 118 ? pct4 99 119 rd pct5 100 120 ? pct6 101 121 astb pct7 102 122 i/o port ct 8-bit i/o port input/output can be specified in 1-bit units. ? pdh0 121 145 a16 pdh1 122 146 a17 pdh2 123 147 a18 pdh3 124 148 a19 pdh4 125 149 a20 pdh5 126 150 a21 pdh6 127 151 a22 pdh7 128 152 i/o port dh 8-bit i/o port input/output can be specified in 1-bit units. a23 remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 49 (6/6) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function pdl0 105 129 ad0 pdl1 106 130 ad1 pdl2 107 131 ad2 pdl3 108 132 ad3 pdl4 109 133 ad4 pdl5 110 134 ad5/flmd1 pdl6 111 135 ad6 pdl7 112 136 ad7 pdl8 113 137 ad8 pdl9 114 138 ad9 pdl10 115 139 ad10 pdl11 116 140 ad11 pdl12 117 141 ad12 pdl13 118 142 ad13 pdl14 119 143 ad14 pdl15 120 144 i/o port dh 16-bit i/o port input/output can be specified in 1-bit units. ad15 remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 50 (2) non-port pins (1/10) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function a0 61 77 p90/kr6/txda1/sda02 a1 62 78 p91/kr7/rxda1/kr7/scl02 a2 63 79 p92/tip41/top41 a3 64 80 p93/tip40/top40/intp8 a4 65 81 p94/tip31 /top31 a5 66 82 p95/tip30/top30/intp5 a6 67 83 p96/tip21/top21 a7 68 84 p97/sib1/tip20/top20 a8 69 85 p98/sob1 a9 70 86 p99/sckb1 a10 71 87 p910/sib3 a11 72 88 p911/sob3 a12 73 89 p912/sckb3 a13 74 90 p913/intp4 a14 75 91 p914/intp5/tip51/top51 a15 76 92 output address bus for external memory (when using separate bus) port 9 cannot be used as port pins or other alternate- function pins when the a0 to a15 pins are used in the separate bus mode. n-ch open-drain output selectable 5 v tolerant. p915/intp6/tip50/top50 a16 121 145 pdh0 a17 122 146 pdh1 a18 123 147 pdh2 a19 124 148 pdh3 a20 125 149 pdh4 a21 126 150 pdh5 a22 127 151 pdh6 a23 128 152 output address bus for external memory pdh7 remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 51 (2/10) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function ad0 105 129 pdl0 ad1 106 130 pdl1 ad2 107 131 pdl2 ad3 108 132 pdl3 ad4 109 133 pdl4 ad5 110 134 pdl5/flmd1 ad6 111 135 pdl6 ad7 112 136 pdl7 ad8 113 137 pdl8 ad9 114 138 pdl9 ad10 115 139 pdl10 ad11 116 140 pdl11 ad12 117 141 pdl12 ad13 118 142 pdl13 ad14 119 143 pdl14 ad15 120 144 i/o address/data bus for external memory pdl15 adtrg 18 20 input a/d converter external trigger input, 5 v tolerant p03/intp0 ani0 144 176 p70 ani1 143 175 p71 ani2 142 174 p72 ani3 141 173 p73 ani4 140 172 p74 ani5 139 171 p75 ani6 138 170 p76 ani7 137 169 p77 ani8 136 168 p78 ani9 135 167 p79 ani10 134 166 p710 ani11 133 165 p711 ani12 132 164 p712 ani13 131 163 p713 ani14 130 162 p714 ani15 129 161 input analog voltage input for a/d converter p715 ano0 3 3 p10 ano1 4 4 output analog voltage output for d/a converter p11 ascka0 27 32 input uarta0 baud rate clock input, 5 v tolerant p32/sckb4/tip00/top00 astb 101 121 output address strobe signal output for external memory pct6 remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 52 (3/10) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function av ref0 1 1 reference voltage input for a/d converter, positive power supply for port 7 ? av ref1 5 5 ? reference voltage input for d/a converter, positive power supply for port 1 ? av ss 2 2 ? ground potential for a/d and d/a converters (same potential as v ss ) ? 104 124 ? bv dd ? 153 ? positive power supply for bus interface and alternate- function ports ? 103 123 ? bv ss ? 154 ? ground potential for bus interface and alternate- function ports ? clkout 86 106 output internal system clock output pcm1 crxd0 note 1 32 37 p37/ierx0 crxd1 note 2 29 34 input can0, can1 receive data input 5 v tolerant p34/tip10/top10 cs1 82 102 pcs1 cs2 83 103 pcs2 cs3 84 104 output chip select output pcs3 ctxd0 note 1 31 36 p36/ietx0 ctxd1 note 2 28 33 output can0, can1 transmit data output n-ch open-drain output selectable, 5 v tolerant p33/tip01/top01 dck 41 49 input debug clock input, 5 v tolerant p54/sob2/kr4/rtp04 ddi 39 47 input debug data input, 5 v tolerant p52/kr2/tiq03/toq03/rtp02 ddo note 3 40 48 output debug data output n-ch open-drain output selectable, 5 v tolerant p53/sib2/kr3/tiq00/toq00/rtp03 dms 42 50 input debug mode select input, 5 v tolerant p55/sckb2/kr5/rtp05 drst 20 22 input debug reset input, 5 v tolerant p05/intp2 34 39 ? ev dd ? 69 ? positive power supply for external (same potential as v dd ) ? 33 38 ? ev ss ? 70 ? ground potential for external (same potential as v ss ) ? flmd0 8 10 ? flmd1 110 134 input flash memory programming mode setting pin pdl5/ad5 hldak 87 107 output bus hold acknowledge output pcm2 hldrq 88 108 input bus hold request input pcm3 ? 29 p45 note 4 ierx0 32 37 input iebus receive data input, 5 v tolerant p37/crxd0 note 1 ? 28 p44 note 4 ietx0 31 36 output iebus transmit data output n-ch open-drain output selectable, 5 v tolerant p36/ctxd0 note 1 notes 1. can controller version only 2. can controller (2-channel) version only 3. in the on-chip debug mode, high-level output is forcibly set. 4. v850e/sk3-h only remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 53 (4/10) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function intp0 18 20 p03/adtrg intp1 19 21 p04 20 22 p05/drst intp2 24 26 p42/sckb0 intp3 21 23 p06 intp4 74 90 p913/a13 66 82 p95/a5/tip30/top30 intp5 75 91 p914/a14/tip51/top51 ? 96 p153 note 1 intp6 76 92 p915/a15/tip50/top50 26 31 p31/rxda0/sib4 intp7 38 46 p51/kr1/tiq02/toq02/rtp01 59 71 p80/rxda3/rc1ck1hz intp8 note 2 64 80 p93/a3/tip40/top40 49 59 p66/sib5/kr3/tiq00/toq00 intp9 ? 95 input external interrupt request input (maskable, analog noise elimination). analog noise elimination/digital noise elimination selectable for the intp3 pin. 5 v tolerant p152 note 1 kr0 notes 3, 4 37 45 p50/tiq01/toq01/rtp00 kr1 notes 3, 5 38 46 p51/intp7/tiq02/toq02/rtp01 39 47 p52/tiq03/toq03/rtp02/ddi kr2 notes 3, 6 48 58 p65/rtp15/scke1 note 8 /tiq03/toq03 40 48 p53/sib2/tiq00/toq00/rtp03/ ddo kr3 notes 3, 7 49 59 input key interrupt input (on-chip analog noise eliminator) 5 v tolerant p66/sib5/intp9/tiq00/toq00 notes 1. v850e/sk3-h only 2. to use the rxda3 pin and intp8 pin at the same time, use the rxda3 pin at pin 59 and the intp8 pin at pin 64 for the v850e/sj3-h, and use the rxda 3 pin at pin 71 and the intp8 pin at pin 80 for the v850e/sk3-h. in addition, when using the rx da3 pin, always invalidate the edge detection function of the intp8 pin at pin 59 (v85 0e/sj3-h) and pin 71 (v850e/sk3-h). 3. pull this pin up externally. 4. invalidate the edge detection function of the tiq01 pin when using the kr0 pin. 5. invalidate the edge detection function of the tiq02 pin when using the kr1 pin. 6. invalidate the edge detection function of the tiq03 pin when using the kr2 pin. although the kr2 and tiq03 pins are assigned to tw o ports each, the pins cannot be used at the same time at different ports. 7. invalidate the edge detection function of the tiq00 pin when using the kr3 pin. although the kr3 and tiq00 pins are assigned to tw o ports each, the pins cannot be used at the same time at different ports. 8. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3- h) remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 54 (5/10) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function 41 49 p54/sob2/rtp04/dck kr4 note 1 46 56 p63/rtp13/sie1 note 4 42 50 p55/sckb2/rtp05/dms kr5 note 1 47 57 p64/rtp14/soe1 note 4 kr6 note 1 61 77 p90/a0/txda1/sda02 62 78 p91/a1/rxda1/kr7/scl02 kr7 notes 1, 2 ? 93 input key interrupt input (on-chip analog noise eliminator) 5 v tolerant p150 note 5 /rxda1 note 5 nmi note 3 17 19 input external interrupt input (non-maskable, analog noise elimination) 5 v tolerant p02 rc1ck1hz 59 71 output real-time counter correction clock (1 hz) output n-ch open-drain output selectable 5 v tolerant p80/rxda3/intp8 rc1ckdiv 60 72 output real-time counte r clock (32 khz division) output n-ch open-drain output selectable 5 v tolerant p81/txda3/rc1cko rc1cko 60 72 output real-time counter cloc k (32 khz primary oscillation) output n-ch open-drain output selectable 5 v tolerant p81/txda3/rc1ckdiv rd 99 119 output read strobe signal output for external memory pct4 regc 10 12 ? connection of regulator output stabilization capacitance (4.7 f) ? reset 14 16 input system reset input ? rtp00 37 45 p50/kr0/tiq01/toq01 rtp01 38 46 p51/intp7/kr1/tiq02/toq02 rtp02 39 47 p52/kr2/tiq03/toq03/ddi rtp03 40 48 p53/sib2/kr3/tiq00/toq00/ddo rtp04 41 49 p54/sob2/kr4/dck rtp05 42 50 p55/sckb2/kr5/dms rtp10 43 53 p60/rxda4/sie0 note 4 rtp11 44 54 p61/txda4/soe0 note 4 rtp12 45 55 p62/scke0 note 4 rtp13 46 56 p63/sie1 note 4 /kr4 rtp14 47 57 p64/soe1 note 4 /kr5 rtp15 48 58 output real-time output port n-ch open-drain output selectable 5 v tolerant p65/scke1 note 4 /kr2/tiq03/toq03 notes 1. pull this pin up externally. 2. disable the reception operation of uarta1 when using the kr7 pin. although the kr7 and rxda1 pins are assigned to two ports each, the pins cannot be used at the same time at different ports in the v850e/sk3-h. 3. the nmi pin alternately functions as the p02 pin. it functions as p02 pin after reset. to enable the nmi pin, set the pmc0.pmc02 bit to 1. the initial setti ng of the nmi pin is ?no edge detected?. select the nmi pin valid edge using intf0 and intr0 registers. 4. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3- h) 5. v850e/sk3-h only remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 55 (6/10) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function rxda0 26 31 p31/intp7/sib4 62 78 p91/a1/kr7/kr7/scl02 rxda1 note1 ? 93 p150 note 4 /kr7 note 4 36 41 p39/scl00/sckb2 rxda2 ? 44 p312 note 4 rxda3 note 2 59 71 p80/intp8/rc1ck1hz ? 51 p56 note 4 rxda4 43 53 p60/rtp10/sie0 note 3 50 60 p67/sob5/sda05 note 3 rxda5 ? 75 input serial receive data input (uarta0 to uarta5) 5 v tolerant p84 note 4 rxdb0 77 97 pcd0 rxdb1 79 99 input serial receive data input (uartb0, uartb1) pcd2 sckb0 24 26 p42/intp2 sckb1 70 86 p99/a9 36 41 p39/rxda2/scl00 sckb2 42 50 p55/kr5/rtp05/dms sckb3 73 89 p912/a12 sckb4 27 32 p32/ascka0/tip00/top00 sckb5 51 61 i/o serial clock i/o (csib0 to csib5) n-ch open-drain output selectable 5 v tolerant p68/txda5/scl05 note 3 scke0 note 3 45 55 p62/rtp12 scke1 note 3 48 58 i/o serial clock i/o (csie0, csie1) n-ch open-drain output selectable 5 v tolerant p65/rtp15/kr2/tiq03/toq03 scl00 36 41 p39/rxda2/sckb2 scl01 23 25 p41/sob0 scl02 62 78 p91/a1/kr7/rxda1/kr7 scl03 58 68 p615 7 7 p01/tip60/top60 scl04 note 3 ? 9 i/o serial clock i/o (i 2 c00 to i 2 c05) n-ch open-drain output selectable 5 v tolerant p21 note 4 notes 1. invalidate the key return signal detection function of the kr7 pin w hen using the rxda1 pin. although the rxda1and kr7 pins are assigned to two ports eac h, the pins cannot be us ed at the same time at different ports in the v850e/sk3-h. 2. when using the rxda3 pin, always invalidate the ed ge detection function of the intp8 pin at pin 59 (v850e/sj3-h) and pin 71 (v850e/sk3-h). in this case, use the intp8 pin at pin 64 (v850e/sj3-h) or pin 80 (v850e/sk3-h). 3. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3- h) 4. v850e/sk3-h only remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 56 (7/10) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function 51 61 p68/sckb5/txda5 scl05 note 1 ? 74 i/o serial clock i/o (i 2 c00 to i 2 c05) n-ch open-drain output selectable 5 v tolerant p83 note 2 sda00 35 40 p38/txda2/sib2 sda01 22 24 p40/sib0 sda02 61 77 p90/a0/kr6/txda1 sda03 57 67 p614/tecr8 6 6 p00/tip61/top61 sda04 note 1 ? 8 p20 note 2 50 60 p67/sob5/rxda5 sda05 note 1 ? 73 i/o serial transmit/receive data i/o (i 2 c00 to i 2 c05) n-ch open-drain output selectable 5 v tolerant p82 note 2 sib0 22 24 p40/sda01 sib1 68 84 p97/a7/tip20/top20 35 40 p38/txda2/sda00 sib2 40 48 p53/kr3/tiq00/toq00/rtp03/ddo sib3 71 87 p910/a10 sib4 26 31 p31/rxda0/intp7 sib5 49 59 input serial receive data input (csib0 to csib5) 5 v tolerant p66/intp9/kr3/tiq00/toq00 sie0 note 1 43 53 p60/rtp10/rxda4 sie1 note 1 46 56 input serial receive data input (csie0, csie1) 5 v tolerant p63/rtp13/kr4 sob0 23 25 p41/scl01 sob1 69 85 p98/a8 ? 42 p310 note 2 sob2 41 49 p54/kr4/rtp04/dck sob3 72 88 p911/a11 sob4 25 30 p30/txda0 sob5 50 60 output serial transmit data output (csib0 to csib5) n-ch open-drain output selectable 5 v tolerant p67/rxda5/sda05 note 1 soe0 note 1 44 54 p61/rtp11/txda4 soe1 note 1 47 57 output serial transmit data output (csie0, csie1) n-ch open-drain output selectable 5 v tolerant p64/rtp14/kr5 tecr7 54 64 p611/top71 tecr8 57 67 input encoder clear input (tmp7, tmp8) 5 v tolerant p614/sda03 tenc70 52 62 p69/tip70/top70 tenc71 53 63 p610/tip71 tenc80 55 65 p612/tip80/top80 tenc81 56 66 input encoder input (tmp7, tmp8) 5 v tolerant p613/tip81/top81 notes 1. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3- h) 2. v850e/sk3-h only remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 57 (8/10) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function tip00 27 32 external event count input/capture trigger input/external trigger input (tmp0) 5 v tolerant p32/ascka0/sckb4/top00 tip01 28 33 capture trigger input (tmp0) 5v tolerant p33/top01/ctxd1 note 1 tip10 29 34 external event count input/capture trigger input/external trigger input (tmp1) 5 v tolerant p34/top10/crxd1 note 1 tip11 30 35 capture trigger input (tmp1) 5v tolerant p35/top11 tip20 68 84 external event count input/capture trigger input/external trigger input (tmp2) 5 v tolerant p97/a7/sib1/top20 tip21 67 83 capture trigger input (tmp2) 5 v tolerant p96/a6/top21 tip30 66 82 external event count input/capture trigger input/external trigger input (tmp3) 5 v tolerant p95/a5/top30/intp5 tip31 65 81 capture trigger input (tmp3) 5v tolerant p94/a4/top31 tip40 64 80 external event count input/capture trigger input/external trigger input (tmp4) 5v tolerant p93/a3/top40/intp8 tip41 63 79 capture trigger input (tmp4) 5v tolerant p92/a2/top41 tip50 76 92 external event count input/capture trigger input/external trigger input (tmp5) 5 v tolerant p915/a15/intp6/top50 tip51 75 91 capture trigger input (tmp5) 5v tolerant p914/a14/intp5/top51 tip60 7 7 external event count input/capture trigger input/external trigger input (tmp6) 5 v tolerant p01/top60/scl04 note 2 tip61 6 6 input capture trigger input (tmp6) 5v tolerant p00/top61/sda04 note 2 notes 1. can controller (2-channel) version only 2. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3- h) remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 58 (9/10) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function tip70 52 62 external event count input/capture trigger input/external trigger input (tmp7) 5 v tolerant p69/top70/tenc70 tip71 53 63 capture trigger input (tmp7) 5v tolerant p610/tenc71 tip80 55 65 external event count input/capture trigger input/external trigger input (tmp8) 5 v tolerant p612/top80/tenc80 tip81 56 66 input capture trigger input (tmp8) 5v tolerant p613/top81/tenc81 40 48 p53/sib2/kr3/toq00/rtp03/ ddo tiq00 note 1 49 59 external event count input/capture trigger input/external trigger input (tmq0) 5v tolerant p66/sib5/intp9/kr3/toq00 tiq01 note 2 37 45 p50/kr0/toq01/rtp00 tiq02 note 3 38 46 p51/intp7/kr1/toq02/rtp01 39 47 p52/kr2/toq03/rtp02/ddi tiq03 note 4 48 58 input capture trigger input (tmq0) 5v tolerant p65/rtp15/scke1/ note 5 kr2/toq03 top00 27 32 p32/ascka0/sckb4/tip00 top01 28 33 timer output (tmp0) n-ch open-drain output selectable, 5 v tolerant p33/tip01/ctxd1 note 6 top10 29 34 p34/tip10/crxd1 note 6 top11 30 35 timer output (tmp1) n-ch open-drain output selectable, 5 v tolerant p35/tip11 top20 68 84 p97/a7/sib1/tip20 top21 67 83 timer output (tmp2) n-ch open-drain output selectable, 5 v tolerant p96/a6/tip21 top30 66 82 p95/a5/tip30/intp5 top31 65 81 timer output (tmp3) n-ch open-drain output selectable, 5 v tolerant p94/a4/tip31 top40 64 80 p93/a3/tip40/intp8 top41 63 79 output timer output (tmp4) n-ch open-drain output selectable, 5 v tolerant p92/a2/tip41 notes 1. invalidate the key return signal detection function of the kr3 pin when using the tiq00 pin. although the tiq00 and kr3 pins are assigned to two ports each, the pins cannot be used at the same time at different ports. 2. invalidate the key return signal detection f unction of the kr0 pin wh en using the tiq01 pin. 3. invalidate the key return signal detection f unction of the kr1 pin wh en using the tiq02 pin. 4. invalidate the key return signal detection func tion of the kr2 pin when using the tiq03 pin. although the tiq03 and kr2 pins are assigned to two ports each, the pins cannot be used at the same time at different ports. 5. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3- h) 6. can controller (2-channel) version only remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 59 (10/10) pin no. sj3-h sk3-h pin name gj gm i/o function alternate function top50 76 92 p915/a15/intp6/tip50 top51 75 91 output timer output (tmp5) n-ch open-drain output selectable, 5 v tolerant p914/a14/intp5/tip51 top60 7 7 p01/tip60/scl04 note 1 top61 6 6 timer output (tmp6) n-ch open-drain output selectable, 5 v tolerant p00/tip61/sda04 note 1 top70 52 62 p69/tip70/tenc70 top71 54 64 timer output (tmp7) n-ch open-drain output selectable, 5 v tolerant p611/tecr7 top80 55 65 p612/tip80/tenc80 top81 56 66 output timer output (tmp8) n-ch open-drain output selectable, 5 v tolerant p613/tip81/tenc81 40 48 p53/sib2/kr3/tiq00/rtp03/ddo toq00 49 59 p66/sib5/intp9/kr3/tiq00 toq01 37 45 p50/kr0/tiq01/rtp00 toq02 38 46 p51/intp7/kr1/tiq02/rtp01 39 47 p52/kr2/tiq03/rtp02/ddi toq03 48 58 output timer output (tmq0) n-ch open-drain output selectable, 5 v tolerant p65/rtp15/scke1 note 1 /kr2/tiq03 txda0 25 30 p30/sob4 61 77 p90/a0/kr6/sda02 txda1 ? 94 p151 note 2 35 40 p38/sda00/sib2 txda2 ? 43 p311 note 2 txda3 60 72 p81/rc1cko/rc1ckdiv ? 52 p57 note 2 txda4 44 54 p61/rtp11/soe0 note 1 51 61 p68/sckb5/scl05 note 1 txda5 ? 76 output serial transmit data output (uarta0 to uarta5) n-ch open-drain output selectable, 5 v tolerant p85 note 2 txdb0 78 98 pcd1 txdb1 80 100 output serial transmit data output (uartb0, uartb1) pcd3 v dd 9 11 ? positive power supply pin for internal ? v ss 11 13 ? ground potential for internal ? wait 85 105 input external wait input pcm0 wr0 95 115 write strobe for external memory (lower 8 bits) pct0 wr1 96 116 output write strove for external memory (higher 8 bits) pct1 x1 12 14 input ? x2 13 15 ? connection of resonator for main clock ? xt1 15 17 input ? xt2 16 18 ? connection of resonator for subclock ? notes 1. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3- h) 2. v850e/sk3-h only remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 60 2.2 port sharing of alternate functions the v850e/sj3-h and v850e/sk3-h have the same alternate functions that are assigned to two ports. which port is used for the alternate functi on can be selected at the port setup. caution when using an alternate function that is assigned to two ports, always use the alternate function at only one of the ports.
chapter 2 pin functions user?s manual u19201ej3v0ud 61 table 2-2. port sharing of alternate functions (1/2) (a) v850e/sj3-h port <1> port <2> function alternate function i/o pin no. port function pin no. port function intp2 20 p05 24 p42 intp5 75 p914 66 p95 intp7 26 p31 38 p51 external interrupt intp8 input 59 p80 64 p93 sib2 input 40 p53 35 p38 csib2 sckb2 i/o 42 p55 36 p39 kr4 41 p54 46 p63 key interrupt kr5 input 42 p55 47 p64 tiq00/kr3 note 1 input 40 p53 49 p66 toq00 output 40 p53 49 p66 tiq03/kr2 note 2 input 39 p52 48 p65 tmq0 (/kr2, /kr3) toq03 output 39 p52 48 p65 notes 1. although the tiq00 and kr3 pins are assigned to two ports each, the pins cannot be used at the same time at different ports. 2. although the tiq03 and kr2 pins are assigned to two ports each, the pins cannot be used at the same time at different ports.
chapter 2 pin functions user?s manual u19201ej3v0ud 62 table 2-2. port sharing of alternate functions (2/2) (b) v850e/sk3-h port <1> port <2> function alternate function i/o pin no. port function pin no. port function intp2 22 p05 26 p42 intp5 91 p914 82 p95 intp6 92 p915 96 p153 intp7 31 p31 46 p51 intp8 71 p80 80 p93 external interrupt intp9 input 59 p66 95 p152 scl04 7 p01 9 p21 i 2 c04 sda04 6 p00 8 p20 scl05 61 p68 74 p83 i 2 c05 sda05 i/o 60 p67 73 p82 sib2 input 48 p53 40 p38 sob2 output 49 p54 42 p310 csib2 sckb2 i/o 50 p55 41 p39 rxda1/kr7 note1 input 78 p91 93 p150 uarta1 (/kr7) txda1 output 77 p90 94 p151 rxda2 input 41 p39 44 p312 uarta2 txda2 output 40 p38 43 p311 rxda4 input 53 p60 51 p56 uarta4 txda4 output 54 p61 52 p57 rxda5 input 60 p67 75 p84 uarta5 txda5 output 61 p68 76 p85 ierx0 input 37 p37 29 p45 iebus ietx0 output 36 p36 28 p44 kr4 49 p54 56 p63 key interrupt kr5 input 50 p55 57 p64 tiq00/kr3 note 2 input 48 p53 59 p66 toq00 output 48 p53 59 p66 tiq03/kr2 note 3 input 47 p52 58 p65 tmq0 (/kr2, /kr3) toq03 output 47 p52 58 p65 notes 1. although the rxda1 and kr7 pins are assigned to two ports each, the pins cannot be used at the same time at different ports. 2. although the tiq00 and kr3 pins are assigned to two ports each, the pins cannot be used at the same time at different ports. 3. although the tiq03 and kr2 pins are assigned to two ports each, the pins cannot be used at the same time at different ports.
chapter 2 pin functions user?s manual u19201ej3v0ud 63 the following shows a port sharing assignment diagram of alternate functions. figure 2-1. alternate-function port shar ing assignment diagram for v850e/sj3-h (144-pin plastic lqfp (fine pitch) (20 20)) pdl3/ad3 pdl2/ad2 pdl1/ad1 pdl0/ad0 bv dd bv ss pct7 pct6/astb pct5 pct4/rd pct3 pct2 pct1/wr1 pct0/wr0 pcs7 pcs6 pcs5 pcs4 pcm5 pcm4 pcm3/hldrq pcm2/hldak pcm1/clkout pcm0/wait pcs3/cs3 pcs2/cs2 pcs1/cs1 pcs0 pcd3/txdb1 pcd2/rxdb1 pcd1/txdb0 pcd0/rxdb0 p915/a15 note 7 /intp6/tip50/top50 p914/a14 note 7 / intp5 /tip51/top51 p913/a13 note 7 /intp4 p912/a12 note 7 /sckb3 av ref0 av ss p10/ano0 p11/ano1 av ref1 p00/tip61/top61/sda04 note 1 p01/tip60/top60/scl04 note 1 flmd0 note 2 v dd regc note 3 v ss x1 x2 reset xt1 xt2 p02/nmi p03/intp0/adtrg p04/intp1 p05/ intp2 /drst note 4 p06/intp3 p40/sib0/sda01 p41/sob0/scl01 p42/sckb0/ intp2 p30/txda0/sob4 p31/rxda0/ intp7 /sib4 p32/ascka0/sckb4/tip00/top00 p33/tip01/top01/ctxd1 note 5 p34/tip10/top10/crxd1 note 5 p35/tip11/top11 p36/ctxd0 note 6 /ietx0 p37/crxd0 note 6 /ierx0 ev ss ev dd p38/txda2/sda00/ sib2 p39/rxda2/scl00/ sckb2 p50/kr0/tiq01/toq01/rtp00 p51/ intp7 /kr1/tiq02/toq02/rtp01 p52/ kr2/tiq03/toq03 /rtp02/ddi p53/ sib2 / kr3/tiq00/toq00 /rtp03/ddo p54/sob2/ kr4 /rtp04/dck p55/ sckb2 / kr5 /rtp05/dms p60/rtp10/rxda4/sie0 note 1 p61/rtp11/txda4/soe0 note 1 p62/rtp12/scke0 note 1 p63/rtp13/sie1 note 1 / kr4 p64/rtp14/soe1 note 1 / kr5 p65/rtp15/scke1 note 1 / kr2/tiq03/toq03 p66/sib5/intp9 note 1 / kr3/tiq00/toq00 p67/sob5/rxda5/sda05 note 1 p68/sckb5/txda5/scl05 note 1 p69/tip70/top70/tenc70 p610/tip71/tenc71 p611/top71/tecr7 p612/tip80/top80/tenc80 p613/tip81/top81/tenc81 p614/sda03/tecr8 p615/scl03 p80/rxda3/ intp8 /rc1ck1hz p81/txda3/rc1cko/rc1ckdiv p90/a0 note 7 /kr6/txda1/sda02 p91/a1 note 7 /kr7/rxda1/kr7/scl02 p92/a2 note 7 /tip41/top41 p93/a3 note 7 /tip40/top40/ intp8 p94/a4 note 7 /tip31/top31 p95/a5 note 7 /tip30/top30/ intp5 p96/a6 note 7 /tip21/top21 p97/a7 note 7 /sib1/tip20/top20 p98/a8 note 7 /sob1 p99/a9 note 7 /sckb1 p910/a10 note 7 /sib3 p911/a11 note 7 /sob3 p70/ani0 note 8 p71/ani1 note 8 p72/ani2 note 8 p73/ani3 note 8 p74/ani4 note 8 p75/ani5 note 8 p76/ani6 note 8 p77/ani7 note 8 p78/ani8 note 8 p79/ani9 note 8 p710/ani10 note 8 p711/ani11 note 8 p712/ani12 note 8 p713/ani13 note 8 p714/ani14 note 8 p715/ani15 note 8 pdh7/a23 pdh6/a22 pdh5/a21 pdh4/a20 pdh3/a19 pdh2/a18 pdh1/a17 pdh0/a16 pdl15/ad15 pdl14/ad14 pdl13/ad13 pdl12/ad12 pdl11/ad11 pdl10/ad10 pdl9/ad9 pdl8/ad8 pdl7/ad7 pdl6/ad6 pdl5/ad5/flmd1 pdl4/ad4 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 remark the above figure shows the assignment relationship of the same alternate function that is assigned to two ports.
chapter 2 pin functions user?s manual u19201ej3v0ud 64 figure 2-2 alternate-function port sharing assignment diagram for v850e/sk3-h (176-pin plastic lqfp (fine pitch) (24 24)) 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 pdl3/ad3 pdl2/ad2 pdl1/ad1 pdl0/ad0 p133 p132 p131 p130 bv dd bv ss pct7 pct6/astb pct5 pct4/rd pct3 pct2 pct1/wr1 pct0/wr0 pcs7 pcs6 pcs5 pcs4 pcm5 pcm4 pcm3/hldrq pcm2/hldak pcm1/clkout pcm0/wait pcs3/cs3 pcs2/cs2 pcs1/cs1 pcs0 pcd3/txdb1 pcd2/rxdb1 pcd1/txdb0 pcd0/rxdb0 p153/ intp6 p152/ intp9 p151/ txda1 p150/ rxda1/kr7 p915/a15 note 6 intp6 /tip50/top50 p914/a14 note 6 / intp5 /tip51/top51 p913/a13 note 6 /intp4 p912/a12 note 6 /sckb3 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 p70/ani0 note 7 p71/ani1 note 7 p72/ani2 note 7 p73/ani3 note 7 p74/ani4 note 7 p75/ani5 note 7 p76/ani6 note 7 p77/ani7 note 7 p78/ani8 note 7 p79/ani9 note 7 p710/ani10 note 7 p711/ani11 note 7 p712/ani12 note 7 p713/ani13 note 7 p714/ani14 note 7 p715/ani15 note 7 p145 p144 p143 p142 p141 p140 bv ss bv dd pdh7/a23 pdh6/a22 pdh5/a21 pdh4/a20 pdh3/a19 pdh2/a18 pdh1/a17 pdh0/a16 pdl15/ad15 pdl14/ad14 pdl13/ad13 pdl12/ad12 pdl11/ad11 pdl10/ad10 pdl9/ad9 pdl8/ad8 pdl7/ad7 pdl6/ad6 pdl5/ad5/flmd1 pdl4/ad4 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 p50/kr0/tiq01/toq01/rtp00 p51/ intp7 /kr1/tiq02/toq02/rtp01 p52/ kr2/tiq03/toq03 /rtp02/ddi p53/ sib2 / kr3/tiq00/toq00 /rtp03/ddo p54/ sob2 / kr4 /rtp04/dck p55/ sckb2 / kr5 /rtp05/dms p56/ rxda4 p57/ txda4 p60/rtp10/ rxda4 /sie0 p61/rtp11/ txda4 /soe0 p62/rtp12/scke0 p63/rtp13/sie1/ kr4 p64/rtp14/soe1/ kr5 p65/rtp15/scke1/ kr2/tiq03/toq03 p66/sib5/ intp9 / kr3/tiq00/toq00 p67/sob5/ rxda5 / sda05 p68/sckb5/ txda5 / scl05 p69/tip70/top70/tenc70 p610/tip71/tenc71 p611/top71/tecr7 p612/tip80/top80/tenc80 p613/tip81/top81/tenc81 p614/sda03/tecr8 p615/scl03 ev dd ev ss p80/rxda3/ intp8 /rc1ck1hz p81/txda3/rc1cko/rc1ckdiv p82/ sda05 p83/ scl05 p84/ rxda5 p85/ txda5 p90/a0 note 6 /kr6/ txda1 /sda02 p91/a1 note 6 / kr7/rxda1/kr7 /scl02 p92/a2 note 6 /tip41/top41 p93/a3 note 6 /tip40/top40/ intp8 p94/a4 note 6 /tip31 /top31 p95/a5 note 6 /tip30/top30/ intp5 p96/a6 note 6 / tip21/top21 p97/a7 note 6 /sib1/tip20/top20 p98/a8 note 6 /sob1 p99/a note 6 /sckb1 p910/a10 note 6 /sib3 p911/a11 note 6 /sob3 av ref0 av ss p10/ano0 p11/ano1 av ref1 p00/tip61/top61/ sda04 p01/tip60/top60/ scl04 p20/ sda04 p21/ scl04 flmd0 note 1 v dd regc note 2 v ss x1 x2 reset xt1 xt2 p02/nmi p03/intp0/adtrg p04/intp1 p05/ intp2 /drst note 3 p06/intp3 p40/sib0/sda01 p41/sob0/scl01 p42/sckb0/ intp2 p43 p44/ ietx0 p45/ ierx0 p30/txda0/sob4 p31/rxda0/ intp7 /sib4 p32/ascka0/sckb4/tip00/top00 p33/tip01/top01/ctxd1 note 4 p34/tip10/top10/crxd1 note 4 p35/tip11/top11 p36/ctxd0 note 5 / ietx0 p37/crxd0 note 5 / ierx0 ev ss ev dd p38/ txda2 /sda00/ sib2 p39/ rxda2 /scl00/ sckb2 p310/ sob2 p311/ txda2 p312/ rxda2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 remark the above figure shows the assignment relationship of the same alternate function that is assigned to two ports.
chapter 2 pin functions user?s manual u19201ej3v0ud 65 2.3 pin states the operation states of pins in the vari ous operation modes are described below. table 2-3. pin operation states in various modes pin name during reset (immediately after power is turned on) during reset (except immediately after power is turned on) halt mode note 2 idle1, idle2, sub-idle mode note 2 stop mode note 2 idle state note 3 bus hold p05/drst pull down pull down note 4 held held held held held p10/ano0, p11/ano1 hi-z hi-z held held note 10 held held p53/ddo undefined note 1 hi-z note 5 held held held held held ad0 to ad15 notes 7, 8 a0 to a15 undefined notes 7, 9 a16 to a23 undefined note 7 hi-z hi-z held hi-z wait ? ? ? ? ? clkout operating l l operating operating wr0, wr1 rd astb h note 7 hi-z hldak h h h l hldrq operating note 7 ? ? ? held cs1 to cs3 hi-z note 6 hi-z note 6 h note 7 h h h hi-z other port pins hi-z hi-z held held held held held notes 1. these pins may momentarily output an un defined level upon power application. 2. operates while alternat e functions are operating. 3. in separate bus mode, the state of the pins in the idle state inserted after the t2 state is shown. in multiplexed bus mode, the state of the pins in the idle state inserted after the t3 state is shown. 4. pulled down during external reset. during internal reset by the watchdog timer, low-voltage detector, or clock monitor, etc., the state of this pin di ffers according to the ocdm.ocdm0 bit setting. 5. ddo output is specified in the on-chip debug mode. 6. the bus control pins function alternately as port pi ns, so they are initialized to the input mode (port mode). 7. operates even in the halt mode, during dma operation. 8. in separate bus mode: hi-z in multiplexed bus mode: undefined 9. in separate bus mode 10. in port mode: held when alternate function is used: hi-z remark hi-z: high impedance held: the state during the immediately preceding external bus cycle is held. l: low-level output h: high-level output ? : input without sampling (not acknowledged)
chapter 2 pin functions user?s manual u19201ej3v0ud 66 2.4 pin i/o circuit types, i/o buffer power supplies and connection of unused pins (1/6) pin no. sj3-h sk3-h pin alternate function gj gm i/o circuit type recommended connection p00 tip61/top61/sda04 note 2 6 6 p01 tip60/top60/scl04 note 2 7 7 p02 nmi 17 19 p03 intp0/adtrg 18 20 p04 intp1 19 21 10-d input: independently connect to ev dd or ev ss via a resistor. output: leave open. p05 intp2/drst 20 22 10-n input: independently connect to ev ss via a resistor. fixing to v dd level is prohibited. output: leave open. internally pull-down after reset by reset pin. p06 intp3 21 23 10-d input: independently connect to ev dd or ev ss via a resistor. output: leave open. p10 ano0 3 3 p11 ano1 4 4 12-d input: independently connect to av ref1 or av ss via a resistor. output: leave open. p20 note 1 sda04 ? 8 p21 note 1 scl04 ? 9 10-d p30 txda0/sob4 25 30 10-g p31 rxda0/intp7/sib4 26 31 p32 ascka0/sckb4/tip00/ top00 27 32 p33 tip01/top01/ctxd1 note 3 28 33 p34 tip10/top10/crxd1 note 3 29 34 p35 tip11/top11 30 35 10-d p36 ctxd0 note 4 /ietx0 31 36 10-g p37 crxd0 note 4 /ierx0 32 37 p38 txda2/sda00/sib2 35 40 p39 rxda2/scl00/sckb2 36 41 10-d p310 note 1 sob2 note 1 ? 42 p311 note 1 txda2 note 1 ? 43 10-g p312 note 1 rxda2 note 1 ? 44 10-d input: independently connect to ev dd or ev ss via a resistor. output: leave open. notes 1. v850e/sk3-h only 2. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3- h) 3. can controller (2-channel) version only 4. can controller version only remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 67 (2/6) pin no. sj3-h sk3-h pin alternate function gj gm i/o circuit type recommended connection p40 sib0/sda01 22 24 p41 sob0/scl01 23 25 p42 sckb0/intp2 24 26 10-d p43 note 1 ? ? 27 p44 note 1 ietx0 note 1 ? 28 10-g p45 note 1 ierx0 note 1 ? 29 p50 kr0/tiq01/toq01/rtp00 37 45 p51 intp7/kr1/tiq02/toq02/ rtp01 38 46 p52 kr2/tiq03/toq03/rtp02/ ddi 39 47 p53 sib2/kr3/tiq00/toq00/ rtp03/ddo 40 48 p54 sob2/kr4/rtp04/dck 41 49 p55 sckb2/kr5/rtp05/dms 42 50 p56 note 1 rxda4 note 1 ? 51 10-d p57 note 1 txda4 note 1 ? 52 10-g p60 rtp10/rxda4/sie0 note 2 43 53 10-d p61 rtp11/txda4/soe0 note 2 44 54 10-g p62 rtp12/scke0 note 2 45 55 p63 rtp13/sie1 note 2 /kr4 46 56 p64 rtp14/soe1 note 2 /kr5 47 57 p65 rtp15/scke1 note 2 /kr2/ tiq03/toq03 48 58 p66 sib5/intp9/kr3/tiq00/ toq00 49 59 p67 sob5/rxda5/sda05 note 2 50 60 p68 sckb5/txda5/scl05 note 2 51 61 p69 tip70/top70/tenc70 52 62 p610 tip71/tenc71 53 63 p611 top71/tecr7 54 64 p612 tip80/top80/tenc80 55 65 p613 tip81/top81/tenc81 56 66 p614 sda03/tecr8 57 67 p615 scl03 58 68 10-d input: independently connect to ev dd or ev ss via a resistor. output: leave open. notes 1. v850e/sk3-h only 2. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3- h) remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 68 (3/6) pin no. sj3-h sk3-h pin alternate function gj gm i/o circuit type recommended connection p70 ani0 144 176 p71 ani1 143 175 p72 ani2 142 174 p73 ani3 141 173 p74 ani4 140 172 p75 ani5 139 171 p76 ani6 138 170 p77 ani7 137 169 p78 ani8 136 168 p79 ani9 135 167 p710 ani10 134 166 p711 ani11 133 165 p712 ani12 132 164 p713 ani13 131 163 p714 ani14 130 162 p715 ani15 129 161 11-g input: independently connect to av ref0 or av ss via a resistor. output: leave open. p80 rxda3/intp8/rc1ck1hz 59 71 10-d p81 txda3/rc1cko/rc1ckdiv 60 72 10-g p82 note sda05 note ? 73 p83 note scl05 note ? 74 p84 note rxda5 note ? 75 10-d p85 note txda5 note ? 76 10-g p90 a0/kr6/txda1/sda02 61 77 p91 a1/kr7/rxda1/kr7/scl02 62 78 p92 a2/tip41/top41 63 79 p93 a3/tip40/top40/intp8 64 80 p94 a4/tip31/top31 65 81 p95 a5/tip30/top30/intp5 66 82 p96 a6/tip21/top21 67 83 p97 a7/sib1/tip20/top20 68 84 10-d p98 a8/sob1 69 85 10-g p99 a9/sckb1 70 86 p910 a10/sib3 71 87 10-d p911 a11/sob3 72 88 10-g input: independently connect to ev dd or ev ss via a resistor. output: leave open. note v850e/sk3-h only remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 69 (4/6) pin no. sj3-h sk3-h pin alternate function gj gm i/o circuit type recommended connection p912 a12/sckb3 73 89 p913 a13/intp4 74 90 p914 a14/intp5/tip51/top51 75 91 p915 a15/intp6/tip50/top50 76 92 10-d input: independently connect to ev dd or ev ss via a resistor. output: leave open. p130 note ? ? 125 p131 note ? ? 126 p132 note ? ? 127 p133 note ? ? 128 p140 note ? ? 155 p141 note ? ? 156 p142 note ? ? 157 p143 note ? ? 158 p144 note ? ? 159 p145 note ? ? 160 5 input: independently connect to bv dd or bv ss via a resistor. output: leave open. p150 note rxda1 note /kr7 note ? 93 10-d p151 note txda1 note ? 94 10-g p152 note intp9 note ? 95 p153 note intp6 note ? 96 input: independently connect to ev dd or ev ss via a resistor. output: leave open. pcd0 rxdb0 77 97 10-d pcd1 txdb0 78 98 10-g pcd2 rxdb1 79 99 10-d pcd3 txdb1 80 100 10-g pcm0 wait 85 105 pcm1 clkout 86 106 pcm2 hldak 87 107 pcm3 hldrq 88 108 pcm4 ? 89 109 pcm5 ? 90 110 pcs0 ? 81 101 pcs1 cs1 82 102 pcs2 cs2 83 103 pcs3 cs3 84 104 pcs4 ? 91 111 pcs5 ? 92 112 pcs6 ? 93 113 pcs7 ? 94 114 5 input: independently connect to bv dd or bv ss via a resistor. output: leave open. note v850e/sk3-h only remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 70 (5/6) pin no. sj3-h sk3-h pin alternate function gj gm i/o circuit type recommended connection pct0 wr0 95 115 pct1 wr1 96 116 pct2 ? 97 117 pct3 ? 98 118 pct4 rd 99 119 pct5 ? 100 120 pct6 astb 101 121 pct7 ? 102 122 pdh0 a16 121 145 pdh1 a17 122 146 pdh2 a18 123 147 pdh3 a19 124 148 pdh4 a20 125 149 pdh5 a21 126 150 pdh6 a22 127 151 pdh7 a23 128 152 pdl0 ad0 105 129 pdl1 ad1 106 130 pdl2 ad2 107 131 pdl3 ad3 108 132 pdl4 ad4 109 133 input: independently connect to bv dd or bv ss via a resistor. output: leave open. pdl5 ad5/flmd1 110 134 independently connect to bv ss via a resistor. pdl6 ad6 111 135 pdl7 ad7 112 136 pdl8 ad8 113 137 pdl9 ad9 114 138 pdl10 ad10 115 139 pdl11 ad11 116 140 pdl12 ad12 117 141 pdl13 ad13 118 142 pdl14 ad14 119 143 pdl15 ad15 120 144 5 input: independently connect to bv dd or bv ss via a resistor. output: leave open. remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 71 (6/6) pin no. sj3-h sk3-h pin alternate function gj gm i/o circuit type recommended connection av ref0 ? 1 1 av ref1 ? 5 5 ? always connect this pin to the power supply (also in the standby mode). av ss ? 2 2 ? always connect this pin directly to the ground (also in the standby mode). ? 104 124 bv dd ? ? 153 ? always connect this pin to the power supply (also in the standby mode). ? 103 123 bv ss ? ? 154 ? always connect this pin directly to the ground (also in the standby mode). ? 34 39 ev dd ? ? 69 ? always connect this pin directly to the power supply (also in the standby mode). ? 33 38 ev ss ? ? 70 ? always connect this pin directly to the ground (also in the standby mode). flmd0 ? 8 10 ? connect to v ss in a mode other than the flash memory programming mode. regc ? 10 12 ? connect regulator output stabilization capacitance (4.7 f) reset ? 14 16 2 ? v dd ? 9 11 ? always connect this pin to the power supply (also in the standby mode). v ss ? 11 13 ? always connect this pin directly to the ground (also in the standby mode). x1 ? 12 14 ? ? x2 ? 13 15 ? ? xt1 ? 15 17 connect to v ss . xt2 ? 16 18 16-c leave open. remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 2 pin functions user?s manual u19201ej3v0ud 72 figure 2-3. pin i/o circuits type 2 type 5 in data output disable p-ch in/out bv dd bv ss n-ch input enable type 11-g type 12-d type 10-d data output disable ev dd ev ss p-ch in/out in/out n-ch open drain input enable data output disable av ref0 p-ch in/out n-ch p-ch n-ch av ref0 input enable comparator + _ av ss av ss data output disable input enable av ref1 p-ch in/out n-ch p-ch n-ch analog output voltage av ss type 10-n data output disable ev dd ev ss p-ch in/out n-ch open drain input enable ocdm0 bit n-ch type 16-c type 10-g data output disable ev dd ev ss p-ch in/out n-ch open drain input enable p-ch feedback cut-off xt1 xt2 schmitt-triggered input with hysteresis characteristics note note (threshold voltage) note hysteresis characteristics are not available in port mode.
chapter 2 pin functions user?s manual u19201ej3v0ud 73 2.5 cautions (1) cautions on power application when the power is turned on, the following pins may momentarily output an undefined level. ? p53/sib2/kr3/tiq00/toq00/rtp03/ddo pin
user?s manual u19201ej3v0ud 74 chapter 3 cpu function the cpu of the v850e/sj3-h and v850e/sk3-h is bas ed on risc architecture and executes almost all instructions with one clock by using a 5-stage pipeline. 3.1 features minimum instruction execution time : 20.8 ns (operating with 48 mhz) 30.5 s (operating with subclock (f xt ) = 32.768 khz operation) memory space program (physical address) space: 64 mb linear data (logical address) space: 4 gb linear general-purpose registers: 32 bits 32 registers internal 32-bit architecture 5-stage pipeline control multiplication/division instruction saturation operation instruction 32-bit shift instruction: 1 clock load/store instruction with long/short format four types of bit manipulation instructions ? set1 ? clr1 ? not1 ? tst1
chapter 3 cpu function user?s manual u19201ej3v0ud 75 3.2 cpu register set the registers of the v850e/sj3-h an d v850e/sk3-h can be classified into two types: general-purpose program registers and dedicated system registers. all the registers are 32 bits wide. for details, refer to the v850e1 architecture user?s manual . (1) program register set (2) system register set r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 (zero register) (assembler-reserved register) (stack pointer (sp)) (global pointer (gp)) (text pointer (tp)) (element pointer (ep)) (link pointer (lp)) pc (program counter) psw (program status word) ecr (interrupt source register) fepc fepsw (nmi status saving register) (nmi status saving register) eipc eipsw (interrupt status saving register) (interrupt status saving register) 31 0 31 0 31 0 ctbp (callt base pointer) dbpc dbpsw (exception/debug trap status saving register) (exception/debug trap status saving register) ctpc ctpsw (callt execution status saving register) (callt execution status saving register) asid (program id register)
chapter 3 cpu function user?s manual u19201ej3v0ud 76 3.2.1 program register set the program registers include general-p urpose registers and a program counter. (1) general-purpose registers (r0 to r31) thirty-two general-purpose registers, r0 to r31, are av ailable. any of these registers can be used to store a data variable or an address variable. however, r0 and r30 are implicitly used by instructions and care must be exercised when these registers are used. r0 always holds 0 and is used for an operation that uses 0 or addressing of offset 0. r30 is used by the sld and sst instructions as a base pointer when these in structions access the memory. r1, r3 to r5, and r31 are implicitly used by the assembler and c compiler. when using these registers, save their contents for protection, and then restore the contents after using the registers. r2 is sometimes used by the real-time os. if the real-time os does not use r2, it can be used as a register for variables. table 3-1. general-purpose registers name usage operation r0 zero register always holds 0. r1 assembler-reserved register used as work ing register to create 32-bit immediate data r2 register for address/data variable (if real-time os does not use r2) r3 stack pointer used to create a stack frame when a function is called r4 global pointer used to access a global variable in the data area r5 text pointer used as register that i ndicates the beginning of a text area (area where program codes are located) r6 to r29 register for address/data variable r30 element pointer used as base pointer to access memory r31 link pointer used when t he compiler calls a function remark for furthers details on the r1, r3 to r5, and r31 that are used in the assembler and c compiler, refer to the ca850 (c compiler package) a ssembly language user?s manual . (2) program counter (pc) the program counter holds the instructio n address during program execution. the lower 26 bits of this register are valid. bits 31 to 26 are fixed to 0. a carry from bit 25 to 26 is ignored even if it occurs. bit 0 is fixed to 0. this means that execution cannot branch to an odd address. 31 26 25 1 0 pc fixed to 0 instruction address during program execution 0 default value 00000000h
chapter 3 cpu function user?s manual u19201ej3v0ud 77 3.2.2 system register set the system registers control the status of the cpu and hold interrupt information. these registers can be read or written by using system register load/store instructions (ldsr and stsr), using the system register numbers listed below. table 3-2. system register numbers operand specification system register number system register name ldsr instruction stsr instruction 0 interrupt status saving register (eipc) note 1 1 interrupt status saving register (eipsw) note 1 2 nmi status saving register (fepc) note 1 3 nmi status saving register (fepsw) note 1 4 interrupt source register (ecr) 5 program status word (psw) 6 to 15 reserved for future function expansion (operation is not guaranteed if these registers are accessed) 16 callt execution status saving register (ctpc) 17 callt execution status saving register (ctpsw) 18 exception/debug trap status saving register (dbpc) note 2 note 2 19 exception/debug trap status saving register (dbpsw) note 2 note 2 20 callt base pointer (ctbp) 21, 22 reserved for future function expansi on (operations that access these register numbers cannot be guaranteed). 23 program id register (asid) 24 to 31 reserved for future function expansi on (operations that access these register numbers cannot be guaranteed). notes 1. because only one set of these registers is availabl e, the contents of these r egisters must be saved by program if multiple interrupts are enabled. 2. these registers can be accessed only during th e interval between the execution of the dbtrap instruction or illegal opcode and the dbret instruction. caution even if eipc or fepc, or bit 0 of ctpc is set to 1 by the ldsr instruction, bit 0 is ignored when execution is returned to the main routine by the reti instruction after interrupt ser vicing (this is because bit 0 of the pc is fixed to 0). set an even value to eipc, fepc, and ctpc (bit 0 = 0). remark : can be accessed : access prohibited
chapter 3 cpu function user?s manual u19201ej3v0ud 78 (1) interrupt status saving registers (eipc and eipsw) eipc and eipsw are used to save the status when an interrupt occurs. if a software exception or a maskable interrupt occurs, the contents of the program counter (pc) are saved to eipc, and the contents of the program status word ( psw) are saved to eipsw (these contents are saved to the nmi status saving registers (fepc and f epsw) if a non-maskable interrupt occurs). the address of the instruction next to the instruction under execution, except some instructions (see 24.8 periods in which interrupts are not acknowledged by cpu ), is saved to eipc when a software exception or a maskable interrupt occurs. the current contents of the psw are saved to eipsw. because only one set of interrupt status saving registers is available, the contents of these registers must be saved by program when multiple interrupts are enabled. bits 31 to 26 of eipc and bits 31 to 8 of eipsw are reserved for future function expansion (these bits are always fixed to 0). the value of eipc is restored to the pc and the val ue of eipsw to the psw by the reti instruction. 31 0 eipc (saved pc contents) 0 0 default value 0xxxxxxxh (x: undefined) 26 25 0 0 0 0 31 0 eipsw (saved psw contents) 0 0 default value 000000xxh (x: undefined) 87 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
chapter 3 cpu function user?s manual u19201ej3v0ud 79 (2) nmi status saving registers (fepc and fepsw) fepc and fepsw are used to save the status when a non-maskable interrupt (nmi) occurs. if an nmi occurs, the contents of the program counter (pc) are saved to fepc, and those of the program status word (psw) are saved to fepsw. the address of the instruction next to the one of the instruction under execut ion, except some instructions, is saved to fepc when an nmi occurs. the current contents of t he psw are saved to fepsw. because only one set of nmi status saving registers is avai lable, the contents of thes e registers must be saved by program when multiple interrupts are enabled. bits 31 to 26 of fepc and bits 31 to 8 of fepsw are re served for future function expansion (these bits are always fixed to 0). the value of fepc is restored to the pc and the value of fepsw to the psw by the reti instruction. 31 0 fepc (saved pc contents) 0 0 default value 0xxxxxxxh (x: undefined) 26 25 0 0 0 0 31 0 fepsw (saved psw contents) 0 0 default value 000000xxh (x: undefined) 87 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (3) interrupt source register (ecr) the interrupt source register (ecr) hol ds the source of an exception or in terrupt if an exception or interrupt occurs. this register holds the exc eption code of each interrupt source. be cause this register is a read-only register, data cannot be written to this register using the ldsr instruction. 31 0 ecr fecc eicc default value 00000000h 16 15 bit position bit name function 31 to 16 fecc exception code of non-maskable interrupt (nmi) 15 to 0 eicc exception code of exception or maskable interrupt
chapter 3 cpu function user?s manual u19201ej3v0ud 80 (4) program status word (psw) the program status word (psw) is a collection of flags that indicate th e status of the program (result of instruction execution) and the status of the cpu. if the contents of a bit of this regi ster are changed by using the ldsr instruction, the new contents are validated immediately after completion of ldsr instructi on execution. however if the id flag is set to 1, interrupt requests will not be acknowledged while the ldsr instruction is being executed. bits 31 to 8 of this register are reserved for future function expansion (these bits are fixed to 0). (1/2) 31 0 psw rfu default value 00000020h 87 np 6 ep 5 id 4 sat 3 cy 2 ov 1 sz bit position flag name function 31 to 8 rfu reserved field. fixed to 0. 7 np indicates that a non-maskable interrupt (nmi) is being serviced. this bit is set to 1 when an nmi request is acknowledged, disabling multiple interrupts. 0: nmi is not being serviced. 1: nmi is being serviced. 6 ep indicates that an exception is being proces sed. this bit is set to 1 when an exception occurs. even if this bit is set, interrupt requests are acknowledged. 0: exception is not being processed. 1: exception is being processed. 5 id indicates whether a maskable interrupt can be acknowledged. 0: interrupt enabled 1: interrupt disabled 4 sat note indicates that the result of a saturation operation has overflowed and is saturated. because this is a cumulative flag, it is set to 1 when the result of a saturation operation instruction is saturated, and is not cleared to 0 even if the subsequent operation result is not saturated. use the ldsr instruction to clear this bit. th is flag is neither set to 1 nor cleared to 0 by execution of an arithmetic operation instruction. 0: not saturated 1: saturated 3 cy indicates whether a ca rry or a borrow occurs as a result of an operation. 0: carry or borrow does not occur. 1: carry or borrow occurs. 2 ov note indicates whether an overflow occurs during operation. 0: overflow does not occur. 1: overflow occurs. 1 s note indicates whether the result of an operation is negative. 0: the result is positive or 0. 1: the result is negative. 0 z indicates whether the result of an operation is 0. 0: the result is not 0. 1: the result is 0. remark also read note on the next page.
chapter 3 cpu function user?s manual u19201ej3v0ud 81 (2/2) note the result of the operation that has performed satu ration processing is determined by the contents of the ov and s flags. the sat flag is set to 1 only when the ov flag is set to 1 when a saturation operation is performed. flag status status of operation result sat ov s result of operation of saturation processing maximum positive value is exceeded 1 1 0 7fffffffh maximum negative value is exceeded 1 1 1 80000000h positive (maximum value is not exceeded) 0 negative (maximum value is not exceeded) holds value before operation 0 1 operation result itself (5) callt execution status saving registers (ctpc and ctpsw) ctpc and ctpsw are callt execution status saving registers. when the callt instruction is execut ed, the contents of the program count er (pc) are saved to ctpc, and those of the program status wo rd (psw) are saved to ctpsw. the contents saved to ctpc are the address of the inst ruction next to callt. the current contents of t he psw are saved to ctpsw. bits 31 to 26 of ctpc and bits 31 to 8 of ctpsw are reserved for future function expansion (fixed to 0). 31 0 ctpc (saved pc contents) 0 0 default value 0xxxxxxxh (x: undefined) 26 25 0 0 0 0 31 0 ctpsw (saved psw contents) 0 0 default value 000000xxh (x: undefined) 87 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
chapter 3 cpu function user?s manual u19201ej3v0ud 82 (6) exception/debug trap status saving registers (dbpc and dbpsw) dbpc and dbpsw are exception/debug trap status registers. if an exception trap or debug trap occurs, the contents of the program counter (pc) are saved to dbpc, and those of the program status word (psw) are saved to dbpsw. the contents to be saved to dbpc are the address of th e instruction next to the one that is being executed when an exception trap or debug trap occurs. the current contents of t he psw are saved to dbpsw. this register can be read or written only during the in terval between the execution of the dbtrap instruction or illegal opcode and the dbret instruction. bits 31 to 26 of dbpc and bits 31 to 8 of dbpsw are reserved for future function expansion (fixed to 0). the value of dbpc is restored to the pc and the value of dbpsw to the psw by the dbret instruction. 31 0 dbpc (saved pc contents) 0 0 default value 0xxxxxxxh (x: undefined) 26 25 0 0 0 0 31 0 dbpsw (saved psw contents) 0 0 default value 000000xxh (x: undefined) 87 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (7) callt base pointer (ctbp) the callt base pointer (ctbp) is used to specify a table address or generate a target address (bit 0 is fixed to 0). bits 31 to 26 of this register are reserved for future function expansion (fixed to 0). 31 0 ctbp (base address) 0 0 default value 0xxxxxxxh (x: undefined) 26 25 0 0 0 0 0
chapter 3 cpu function user?s manual u19201ej3v0ud 83 (8) program id register (asid) asid sets the id of the program in progress. bits 31 to 8 of this register are reserved for future function expansion (fixed to 0). caution to use the v850e/sj3-h or v850e/sk3-h, initializ e the asid register to 00h in its initialization routine. 31 0 7 8 asid asid 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 after reset 000000xxh (x: undefined) bit position flag name function 7 to 0 asid id of program under execution
chapter 3 cpu function user?s manual u19201ej3v0ud 84 3.3 operation modes the v850e/sj3-h and v850e/sk3-h ha ve the following operation modes. (1) normal operation mode in this mode, each pin related to the bus interface is set to the port mode after system reset has been released. execution branches to the reset entry address of the intern al rom, and then instruction processing is started. (2) flash memory programming mode in this mode, the internal flash memory can be programmed by using a flash memory programmer. (3) on-chip debug mode the v850e/sj3-h and v850e/sk3-h are provided with an on-chip debug function that employs the jtag (joint test action group) communicat ion specifications and that is exec uted via an on-chip debug emulator. for details, see chapter 34 on-chip debug function . 3.3.1 specifying operation mode specify the operation mode by using the flmd0 and flmd1 pins. in the normal mode, input a low level to the flmd0 pin when reset is released. in the flash memory programming mode, a high level is in put to the flmd0 pin from the flash memory programmer if a flash memory programmer is connected, but it must be input from an external circuit in the self-programming mode. operation when reset is released flmd0 flmd1 operation mode after reset l normal operation mode h l flash memory programming mode h h setting prohibited remark l: low-level input h: high-level input : don?t care
chapter 3 cpu function user?s manual u19201ej3v0ud 85 3.4 address space 3.4.1 cpu address space for instruction addressing, up to a combined total of 32 mb of external memory area and internal rom area, plus an internal ram area, are supported in a linear addres s space (program space) of up to 64 mb. for operand addressing (data access), up to 4 gb of a linear address s pace (data space) is supported. the 4 gb address space, however, is viewed as 64 images of a 64 mb physical a ddress space. this means that the same 64 mb physical address space is accessed regardless of the value of bits 31 to 26. figure 3-1. image on address space use-prohibited area external memory area use-prohibited area use-prohibited area expanded internal ram area or external memory area expanded internal ram area or external memory area program space internal ram area use-prohibited area use-prohibited area internal rom area data space image 63 image 1 image 0 on-chip peripheral i/o area internal ram area programmable peripheral i/o area or use-prohibited area external memory area internal rom area 32 mb 4 gb 64 mb 64 mb . . . caution only the programmable peripheral i/o area can be viewed in the 4 gb address space as the image in 256 mb unit.
chapter 3 cpu function user?s manual u19201ej3v0ud 86 3.4.2 wraparound of cpu address space (1) program space of the 32 bits of the pc (program counter), the higher 6 bits are fixed to 0 and only the lower 26 bits are valid. the higher 6 bits ignore a carry or borrow from bit 25 to 26 during branch address calculation. therefore, the highest address of the program space, 03ffffffh, and the lowest address, 00000000h, are contiguous addresses. that the highest address and t he lowest address of the pr ogram space are contiguous in this way is called wraparound. caution because the 4 kb area of addresses 03fff000h to 03ffffffh is an on-chip peripheral i/o area, instructions cannot be fetc hed from this area. therefore, do not execute an operation in which the result of a branch addr ess calculation affects this area. program space program space (+) direction ( ? ) direction 00000001h 00000000h 03ffffffh 03fffffeh (2) data space the result of an operand address calculation oper ation that exceeds 32 bits is ignored. therefore, the highest address of the data space, ffffffffh, and the lowest address, 00000000h, are contiguous, and wraparound occurs at the boundary of these addresses. data space data space (+) direction ( ? ) direction 00000001h 00000000h ffffffffh fffffffeh
chapter 3 cpu function user?s manual u19201ej3v0ud 87 3.4.3 memory map the areas shown below are reserved in the v850e/sj3-h and v850e/sk3-h. figure 3-2. data memory map (physical addresses) (1/2) (a) when using expanded internal ram (80 kb) use prohibited external memory area (28 mb) internal ram area (60 kb) on-chip peripheral i/o area (4 kb) use prohibited note 1 internal rom area (4 mb) 03ffffffh 03fec000h 02000000h 01ffffffh 00400000h 003fffffh 00000000h 03febfffh 03ffffffh 03fff000h 03ffefffh 03ff0000h 03feffffh programmable peripheral i/o area note 2 or use prohibited note 3 03fef000h 03feefffh 03fec000h 03fe4000h 03fe3fffh expanded internal ram area (32 kb max.) notes 1. use of addresses 03fef000h to 03feffffh is prohibited because these addresses are in the same area as the on-chip peripheral i/o area. 2. only the programmable peripheral i/o area can be viewed in the 4 gb address space as t he image in 256 mb unit. 3. addresses 03fec000h to 03fecbffh are alloca ted to addresses 03fec000h to 03feefffh of the can controller version as a programmable per ipheral i/o area. use of these addresses in a version without a can controller is prohibited.
chapter 3 cpu function user?s manual u19201ej3v0ud 88 figure 3-2. data memory map (physical addresses) (2/2) (b) when not using expanded internal ram (80 kb) use prohibited external memory area (28 mb) internal ram area (60 kb) on-chip peripheral i/o area (4 kb) use prohibited note 1 internal rom area (4 mb) 03ffffffh 03fec000h 02000000h 01ffffffh 00400000h 003fffffh 00000000h 03febfffh 03ffffffh 03fff000h 03ffefffh 03ff0000h 03feffffh programmable peripheral i/o area note 2 or use prohibited note 3 03fef000h 03feefffh 03fec000h 03e00000h 03dfffffh external memory area (1968 kb) notes 1. use of addresses 03fef000h to 03feffffh is prohibited because these addresses are in the same area as the on-chip peripheral i/o area. 2. only the programmable peripheral i/o area can be viewed in the 4 gb address space as t he image in 256 mb unit. 3. addresses 03fec000h to 03feefffh are alloca ted to addresses 03fec000h to 03fecbffh of the can controller version as a programmable per ipheral i/o area. use of these addresses in a version without a can controller is prohibited.
chapter 3 cpu function user?s manual u19201ej3v0ud 89 figure 3-3. program memory map (1/2) (a) when using expanded internal ram internal ram area (60 kb) use prohibited (program fetch prohibited area) use prohibited (program fetch prohibited area) external memory area (28 mb) internal rom area (4 mb) 03ffffffh 03fff000h 03ffefffh 03fe4000h 03fe3fffh 03ff0000h 03feffffh 02000000h 01ffffffh 00400000h 003fffffh 00000000h 03fec000h 03febfffh use prohibited (program fetch prohibited area) expanded internal ram area (32 kb max.)
chapter 3 cpu function user?s manual u19201ej3v0ud 90 figure 3-3. program memory map (2/2) (b) when not using expanded internal ram internal ram area (60 kb) use prohibited (program fetch prohibited area) use prohibited (program fetch prohibited area) external memory area (28 mb) internal rom area (4 mb) 03ffffffh 03fff000h 03ffefffh 03e00000h 03dfffffh 03ff0000h 03feffffh 02000000h 01ffffffh 00400000h 003fffffh 00000000h 03fec000h 03febfffh use prohibited (program fetch prohibited area) external memory area (1968 kb)
chapter 3 cpu function user?s manual u19201ej3v0ud 91 3.4.4 areas (1) internal rom area up to 4 mb is reserved as an internal rom area. (a) internal rom (512 kb) 512 kb are allocated to addre sses 00000000h to 0007ffffh in the following versions. accessing addresses 00080000h to 003fffffh is prohibited. ? pd70f3931 (v850e/sj3-h), 70f3932 (v85 0e/sj3-h), 70f3933 (v850e/sj3-h) figure 3-4. internal rom area (512 kb) access-prohibited area internal rom (512 kb) 00080000h 0007ffffh 00000000h 003fffffh
chapter 3 cpu function user?s manual u19201ej3v0ud 92 (b) internal rom (768 kb) 768 kb are allocated to addresses 00000000h to 000bffffh in the following versions. accessing addresses 000c0000h to 003fffffh is prohibited. ? pd70f3934 (v850e/sj3-h), 70f3935 (v85 0e/sj3-h), 70f3936 (v850e/sj3-h) figure 3-5. internal rom area (768 kb) access-prohibited area internal rom (768 kb) 000c0000h 000bffffh 00000000h 003fffffh (c) internal rom (1024 kb) 1024 kb are allocated to addre sses 00000000h to 000fffffh in the following versions. accessing addresses 00100000h to 003fffffh is prohibited. ? pd70f3925 (v850e/sk3-h), 70f3926 (v850e /sk3-h), 70f3927 (v850e/sk3-h), 70f3937 (v850e/sj3-h), 70f3938 (v8 50e/sj3-h), 70f3939 (v850e/sj3-h) figure 3-6. internal rom area (1024 kb) access-prohibited area internal rom (1024 kb) 00100000h 000fffffh 00000000h 003fffffh
chapter 3 cpu function user?s manual u19201ej3v0ud 93 (d) internal rom (1280 kb) 1280 kb are allocated to addre sses 00000000h to 0013ffffh in the following versions. accessing addresses 00140000h to 003fffffh is prohibited. ? pd70f3474 (v850e/sj3-h), 70f3475 (v850e /sj3-h), 70f3476 (v850e/sj3-h), 70f3486 (v850e/sk3-h), 70f3487 (v8 50e/sk3-h), 70f3488 (v850e/sk3-h) figure 3-7. internal rom area (1280 kb) access-prohibited area internal rom (1280 kb) 00140000h 0013ffffh 00000000h 003fffffh (e) internal rom (1536 kb) 1536 kb are allocated to addre sses 00000000h to 0017ffffh in the following versions. accessing addresses 00180000h to 003fffffh is prohibited. ? pd70f3477 (v850e/sj3-h), 70f3478 (v850e /sj3-h), 70f3479 (v850e/sj3-h), 70f3480 (v850e/sk3-h), 70f3481 (v8 50e/sk3-h), 70f3482 (v850e/sk3-h) figure 3-8. internal rom area (1536 kb) access-prohibited area internal rom (1536 kb) 00180000h 0017ffffh 00000000h 003fffffh
chapter 3 cpu function user?s manual u19201ej3v0ud 94 (2) internal ram area 60 kb are allocated to addresses 03ff0000h to 03ffefffh in the internal ram area. figure 3-9. internal ram area (60 kb) internal ram (60 kb) 03ff0000h 03ffefffh physical address space logical address space ffff0000h ffffefffh
chapter 3 cpu function user?s manual u19201ej3v0ud 95 (3) on-chip peripheral i/o area 4 kb of addresses 03fff000h to 03ffffffh are re served as the on-chip peripheral i/o area. figure 3-10. on-chip peripheral i/o area on-chip peripheral i/o area (4 kb) 03ffffffh 03fff000h ffffffffh fffff000h physical address space logical address space peripheral i/o registers that have functions to specif y the operation mode for and mo nitor the status of the on- chip peripheral i/o are mapped to the on-chip periphe ral i/o area. program cannot be fetched from this area. cautions 1. when a register is accessed in word units, a word area is accessed twice in halfword units in the order of lower area and higher area, with the lower 2 bits of the address ignored. 2. if a register that can be accessed in byte units is accessed in halfword units, the higher 8 bits are undefined when the register is read , and data is written to the lower 8 bits. 3. addresses not defined as registers are r eserved for future expansion. the operation is undefined and not guaranteed when these addresses are accessed. 4. the internal rom/ram area and on-chip peripheral i/o area are assigned to successive addresses. when accessing the in ternal rom/ram area by in crementing or decrementing addresses using pointer operations and such, therefore, be careful not to access the on- chip peripheral i/o area by mistakenly ex tending over the internal rom/ram area boundary. (4) programmable peripheral i/o area cautions 1. the programmable peripheral i/o area exists only in the can controller versions. this area cannot be used with products that are not equipped with the can controller. 2. only the programmable peripheral i/o area is seen as images of 256 mb each in the 4 gb address space. 12 kb of addresses 03fec000h to 03feefffh are rese rved as the programmable peripheral i/o area. figure 3-11. programmable peripheral i/o area programmable peripheral i/o area (12 kb) 03feefffh 03fec000h
chapter 3 cpu function user?s manual u19201ej3v0ud 96 (5) external memory area up to 30 mb (00400000h to 01ffffffh , 03e00000h to 03febfffh) are alloca ted as the external memory area. for details, see chapter 5 bus control function . (6) expanded internal ram area the 32 kb area from addresses 03fe4000h to 03febfff h is reserved as an expanded internal ram area. the expanded internal ram area is accessed via the external bus interface. before accessing the expanded internal ram area, be sure to set the registers relate d to the external bus interface (initialization of the expanded internal ram). remarks 1. the following products are not provided with expanded internal ram. ? pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), 70f3933 (v850e/sj3-h) 2. expanded internal ram area can be used as external memory area. for details, see chapter 5 bus control function . cautions 1. when using the exte rnal memory and expanded intern al ram simultaneously, set the external bus interface and expanded internal ram at the same time. 2. when accessing the expanded internal ram, a ll the external bus interface control signals except the csn signal become active (n = 1 to 3). therefore, when using the expanded internal ram and external memory at the same time, be sure to control access to the external memory by using the csn signal output from the chip. 3. if an external wait is inser ted via the wait pin, an external wait will also be inserted into expanded internal ram access. 4. be sure to specify the initial settings for the expanded internal ram before using it. (a) expanded internal ram (16 kb) 16 kb are allocated to addres ses 03fe8000h to 03febfffh in the following versions. accessing addresses 03fe4000h to 03fe7fffh is prohibited. ? pd70f3925 (v850e/sk3-h), 70f3926 (v850e /sk3-h), 70f3927 (v850e/sk3-h), 70f3934 (v850e/sj3-h), 70f3935 (v850e /sj3-h), 70f3936 (v850e/sj3-h), 70f3937 (v850e/sj3-h), 70f3938 (v8 50e/sj3-h), 70f3939 (v850e/sj3-h) figure 3-12. expanded internal ram area (16 kb) physical address space logical address space expanded internal ram (16 kb) access-prohibited area 03febfffh 03fe8000h 03fe7fffh 03fe4000h fffebfffh fffe8000h fffe7fffh fffe4000h
chapter 3 cpu function user?s manual u19201ej3v0ud 97 (b) expanded internal ram (32 kb) 32 kb are allocated to addres ses 03fe4000h to 03febfffh in the following versions. ? pd70f3474 (v850e/sj3-h), 70f3475 (v850e /sj3-h), 70f3476 (v850e/sj3-h), 70f3477 (v850e/sj3-h), 70f3478 (v850e /sj3-h), 70f3479 (v850e/sj3-h), 70f3480 (v850e/sk3-h), 70f3481 (v850e /sk3-h), 70f3482 (v850e/sk3-h), 70f3486 (v850e/sk3-h), 70f3487 (v8 50e/sk3-h), 70f3488 (v850e/sk3-h) figure 3-13. expanded internal ram area (32 kb) expanded internal ram area (32 kb) physical address space logical address space 03febfffh 03fe4000h fffebfffh fffe4000h (c) features of expanded internal ram ? can be accessed in as few as three bus cycles ? 32-bit data bus ? misaligned access possible
chapter 3 cpu function user?s manual u19201ej3v0ud 98 (d) initial settings for expanded internal ram the initial settings for the expanded internal ram are shown below. caution if the expanded internal ram is used wi th any but the following initial settings, operation is not guaranteed. ? bsc register setting bits 15 to 8 must be set to 10010101. ? dwc1 register setting set the values of the dwc1 register as follows, in accordance with the setting of the eximc register. eximc register setting dwc1 register setting 00h (multiplexed bus mode) 0777h 01h (separate bus mode) 1777h ? awc register setting bits 15 to 8 must be set to 00111111. ? bcc register setting bits 15 to 8 must be set to 00101010.
chapter 3 cpu function user?s manual u19201ej3v0ud 99 (7) product selection register (prdsel) the prdsel register is a register to identif y the product name and the internal ram area. this register is used divided into two 16-bit registers, prdselh and prdsell. this register is read-only, in 16-bit units. ram3 to ram0 1010 note 1 1011 note 2 ram start address after reset: depends on product r address: prdsell fffffcc8h, prdselh fffffccah product name (last 3 digits) prdselh prdsell ram3 ram2 ram1 ram0 03ff0000h notes 1. pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3 -h), and 70f3933 (v850e/sj3-h) only 2. other than pd70f3931 (v850e/sj3-h), 70f39 32 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) caution this register cannot be read by th e in-circuit emulator (qb-v850esx3h) (an undefined value is read). remarks 1. see table 3-3 for product name setting examples. 2. x: undefined value table 3-3. product name setting examples (1/2) prdsell register product name bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 pd70f3 474 0 1 0 0 0 1 1 1 0 1 0 0 pd70f3 475 0 1 0 0 0 1 1 1 0 1 0 1 pd70f3 476 0 1 0 0 0 1 1 1 0 1 1 0 pd70f3 477 0 1 0 0 0 1 1 1 0 1 1 1 pd70f3 478 0 1 0 0 0 1 1 1 1 0 0 0 pd70f3 479 0 1 0 0 0 1 1 1 1 0 0 1 pd70f3 480 0 1 0 0 1 0 0 0 0 0 0 0 pd70f3 481 0 1 0 0 1 0 0 0 0 0 0 1 pd70f3 482 0 1 0 0 1 0 0 0 0 0 1 0 pd70f3 486 0 1 0 0 1 0 0 0 0 1 1 0 pd70f3 487 0 1 0 0 1 0 0 0 0 1 1 1 pd70f3 488 0 1 0 0 1 0 0 0 1 0 0 0 pd70f3 925 1 0 0 1 0 0 1 0 0 1 0 1 pd70f3 926 1 0 0 1 0 0 1 0 0 1 1 0 pd70f3 927 1 0 0 1 0 0 1 0 0 1 1 1
chapter 3 cpu function user?s manual u19201ej3v0ud 100 table 3-3. product name setting examples (2/2) prdsell register product name bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 pd70f3 931 1 0 0 1 0 0 1 1 0 0 0 1 pd70f3 932 1 0 0 1 0 0 1 1 0 0 1 0 pd70f3 933 1 0 0 1 0 0 1 1 0 0 1 1 pd70f3 934 1 0 0 1 0 0 1 1 0 1 0 0 pd70f3 935 1 0 0 1 0 0 1 1 0 1 0 1 pd70f3 936 1 0 0 1 0 0 1 1 0 1 1 0 pd70f3 937 1 0 0 1 0 0 1 1 0 1 1 1 pd70f3 938 1 0 0 1 0 0 1 1 1 0 0 0 pd70f3 939 1 0 0 1 0 0 1 1 1 0 0 1 3.4.5 recommended use of address space the architecture of the v850e/sj3-h and v850e/sk3-h requir es that a register that se rves as a pointer be secured for address generation when operand data in the data spac e is accessed. the address stored in this pointer 32 kb can be directly accessed by an instruction for operand data. because the number of gene ral-purpose registers that can be used as a pointer is limited, however, by keeping the performance from dropping during address calculation when a pointer value is changed, as many general-purpose r egisters as possible can be secured for variables, and the program size can be reduced. (1) program space of the 32 bits of the pc (program count er), the higher 6 bits are fixed to 0, and only the lower 26 bits are valid. regarding the program space, therefore, a 64 mb spac e of contiguous addresses starting from 00000000h unconditionally corresponds to the memory map. to use the internal ram area as the program space, access the addresses 03ff0000h to 03ffefffh. caution if a branch instruction is at the upper limi t of the internal ram ar ea, a prefetch operation (invalid fetch) straddling the on-chip peripheral i/o area does not occur.
chapter 3 cpu function user?s manual u19201ej3v0ud 101 (2) data space with the v850e/sj3-h and v850e/sk3-h, it seems that there are sixty-fo ur 64 mb address spaces on the 4 gb cpu address space. therefore, the least significant bi t (bit 25) of a 26-bit address is sign-extended to 32 bits and allocated as an address. (a) application example of wraparound if r = r0 (zero register) is specified for the ld/st di sp16 [r] instruction, a range of addresses 00000000h 32 kb can be addressed by sign-extended disp16. all the resources, including the internal hardware, can be addressed by one pointer. the zero register (r0) is a register fixed to 0 by har dware, and practically eliminates the need for registers dedicated to pointers. example : pd70f3474 (v850e/sj3-h), 70f3475 (v8 50e/sj3-h), 70f3476 (v850e/sj3-h) internal rom area on-chip peripheral i/o area internal ram area 32 kb 4 kb 28 kb (r = ) 0013ffffh 00007fffh 00000000h fffff000h ffffefffh ffff8000h
chapter 3 cpu function user?s manual u19201ej3v0ud 102 figure 3-14. recommended memory map (1/2) (a) when using expanded internal ram expanded internal ram data space program space on-chip peripheral i/o on-chip peripheral i/o internal ram internal ram internal rom external memory use prohibited external memory use prohibited internal ram program space 64 mb internal rom internal rom ffffffffh fffff000h ffffefffh ffff0000h fffeffffh 04000000h 03ffffffh 03ff0000h 03feffffh 03fec000h 03febfffh 03fe4000h 03fe3fffh 02000000h 01ffffffh 00140000h 0013ffffh 00400000h 003fffffh 00000000h ffffffffh fffff000h ffffefffh ffff0000h fffeffffh fffec000h fffebfffh 00400000h 003fffffh 00000000h use prohibited use prohibited note fffe4000h fffe3fffh use prohibited expanded internal ram 03fff000h 03ffefffh note in the can controller version, the data space of addresses 03fec0 00h to 03feefffh is assigned as the programmable peripheral i/o area. only the prog rammable peripheral i/o area is seen as images of 256 mb each in the 4 gb address space. remarks 1. indicates the recommended area. 2. this figure is the recommended memory map when the expanded internal ram of the pd70f3474 (v850e/sj3-h) is used (see 5.3.1 chip select control function ).
chapter 3 cpu function user?s manual u19201ej3v0ud 103 figure 3-14. recommended memory map (2/2) (b) when not using expanded internal ram external memory data space program space on-chip peripheral i/o on-chip peripheral i/o internal ram internal ram internal rom external memory use prohibited external memory use prohibited internal ram program space 64 mb internal rom internal rom ffffffffh fffff000h ffffefffh ffff0000h fffeffffh 04000000h 03ffffffh 03ff0000h 03feffffh 03fec000h 03febfffh 03e00000h 03dfffffh 02000000h 01ffffffh 00140000h 0013ffffh 00400000h 003fffffh 00000000h ffffffffh fffff000h ffffefffh ffff0000h fffeffffh fffec000h fffebfffh 00400000h 003fffffh 00000000h use prohibited use prohibited note ffe00000h ffdfffffh use prohibited external memory 03fff000h 03ffefffh note in the can controller version, the data space of addresses 03fec0 00h to 03feefffh is assigned as the programmable peripheral i/o area. only the prog rammable peripheral i/o area is seen as images of 256 mb each in the 4 gb address space. remarks 1. indicates the recommended area. 2. this figure is the recommended memory map when the expanded internal ram of the pd70f3474 (v850e/sj3-h) is used (see 5.3.1 chip select control function ).
chapter 3 cpu function user?s manual u19201ej3v0ud 104 3.4.6 peripheral i/o registers (1/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffff004h port dl register pdl 0000h note 1 fffff004h port dll register pdll 00h note 1 fffff005h port dlh register pdlh 00h note 1 fffff006h port dh register pdh 00h note 1 fffff008h port cs register pcs 00h note 1 fffff00ah port ct register pct 00h note 1 fffff00ch port cm register pcm 00h note 1 fffff00eh port cd register pcd 00h note 1 fffff024h port dl mode register pmdl ffffh fffff024h port dl mode register l pmdll ffh fffff025h port dl mode register h pmdlh ffh fffff026h port dh mode register pmdh ffh fffff028h port cs mode register pmcs ffh fffff02ah port ct mode register pmct ffh fffff02ch port cm mode register pmcm ffh fffff02eh port cd mode register pmcd ffh fffff044h port dl mode control register pmcdl 0000h fffff044h port dl mode control register l pmcdll 00h fffff045h port dl mode control register h pmcdlh 00h fffff046h port dh mode control register pmcdh 00h fffff048h port cs mode control register pmccs 00h fffff04ah port ct mode control register pmcct 00h fffff04ch port cm mode control register pmccm 00h fffff04eh port cd mode control register pmccd 00h fffff04fh port cd function control register pfccd 00h fffff060h chip area select control register 0 csc0 2c11h fffff062h chip area select control register 1 csc1 2c11h fffff064h peripheral i/o area select control register bpc note 2 0000h fffff066h bus size configuration register bsc 5555h fffff06eh system wait control register vswc 77h fffff080h dma source address register 0l dsa0l undefined fffff082h dma source address register 0h dsa0h undefined fffff084h dma destination address register 0l dda0l undefined fffff086h dma destination address register 0h dda0h undefined fffff088h dma source address register 1l dsa1l undefined fffff08ah dma source address register 1h dsa1h undefined fffff08ch dma destination address register 1l dda1l undefined fffff08eh dma destination address register 1h dda1h undefined fffff090h dma source address register 2l dsa2l undefined fffff092h dma source address register 2h dsa2h r/w undefined notes 1. the value of the output latch is 00h or 0000h. the status of the pin is read during input. 2. can controller version only
chapter 3 cpu function user?s manual u19201ej3v0ud 105 (2/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffff094h dma destination address register 2l dda2l undefined fffff096h dma destination address register 2h dda2h undefined fffff098h dma source address register 3l dsa3l undefined fffff09ah dma source address register 3h dsa3h undefined fffff09ch dma destination address register 3l dda3l undefined fffff09eh dma destination address register 3h dda3h undefined fffff0c0h dma transfer count register 0 dbc0 undefined fffff0c2h dma transfer count register 1 dbc1 undefined fffff0c4h dma transfer count register 2 dbc2 undefined fffff0c6h dma transfer count register 3 dbc3 undefined fffff0d0h dma addressing control register 0 dadc0 0000h fffff0d2h dma addressing control register 1 dadc1 0000h fffff0d4h dma addressing control register 2 dadc2 0000h fffff0d6h dma addressing control register 3 dadc3 0000h fffff0e0h dma channel control register 0 dchc0 00h fffff0e2h dma channel control register 1 dchc1 00h fffff0e4h dma channel control register 2 dchc2 00h fffff0e6h dma channel control register 3 dchc3 00h fffff100h interrupt mask register 0 imr0 ffffh fffff100h interrupt mask register 0l imr0l ffh fffff101h interrupt mask register 0h imr0h ffh fffff102h interrupt mask register 1 imr1 ffffh fffff102h interrupt mask register 1l imr1l ffh fffff103h interrupt mask register 1h imr1h ffh fffff104h interrupt mask register 2 imr2 ffffh fffff104h interrupt mask register 2l imr2l ffh fffff105h interrupt mask register 2h imr2h ffh fffff106h interrupt mask register 3 imr3 ffffh fffff106h interrupt mask register 3l imr3l ffh fffff107h interrupt mask register 3h imr3h ffh fffff108h interrupt mask register 4 imr4 ffffh fffff108h interrupt mask register 4l imr4l ffh fffff109h interrupt mask register 4h imr4h ffh fffff10ah interrupt mask register 5 imr5 ffffh fffff10ah interrupt mask register 5l imr5l ffh fffff10bh interrupt mask register 5h imr5h ffh fffff10ch interrupt mask register 6 imr6 ffffh fffff10ch interrupt mask register 6l imr6l ffh fffff10dh interrupt mask register 6h imr6h ffh fffff10eh interrupt mask register 7l imr7l 1fh fffff110h interrupt control register lviic 47h fffff112h interrupt control register pic0 r/w 47h
chapter 3 cpu function user?s manual u19201ej3v0ud 106 (3/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffff114h interrupt control register pic1 47h fffff116h interrupt control register pic2 47h fffff118h interrupt control register pic3 47h fffff11ah interrupt control register pic4 47h fffff11ch interrupt control register pic5 47h fffff11eh interrupt control register pic6 47h fffff120h interrupt control register pic7 47h fffff122h interrupt control register tq0ovic 47h fffff124h interrupt control register tq0ccic0 47h fffff126h interrupt control register tq0ccic1 47h fffff128h interrupt control register tq0ccic2 47h fffff12ah interrupt control register tq0ccic3 47h fffff12ch interrupt control register tp0ovic 47h fffff12eh interrupt control register tp0ccic0 47h fffff130h interrupt control register tp0ccic1 47h fffff132h interrupt control register tp1ovic 47h fffff134h interrupt control register tp1ccic0 47h fffff136h interrupt control register tp1ccic1 47h fffff138h interrupt control register tp2ovic 47h fffff13ah interrupt control register tp2ccic0 47h fffff13ch interrupt control register tp2ccic1 47h fffff13eh interrupt control register tp3ovic 47h fffff140h interrupt control register tp3ccic0 47h fffff142h interrupt control register tp3ccic1 47h fffff144h interrupt control register tp4ovic 47h fffff146h interrupt control register tp4ccic0 47h fffff148h interrupt control register tp4ccic1 47h fffff14ah interrupt control register tp5ovic 47h fffff14ch interrupt control register tp5ccic0 47h fffff14eh interrupt control register tp5ccic1 47h fffff150h interrupt control register tm0eqic0 47h fffff152h interrupt control register cb0ric/iicic1 47h fffff154h interrupt control register cb0tic 47h fffff156h interrupt control register cb1ric 47h fffff158h interrupt control register cb1tic 47h fffff15ah interrupt control register cb2ric 47h fffff15ch interrupt control register cb2tic 47h fffff15eh interrupt control register cb3ric 47h fffff160h interrupt control register cb3tic 47h fffff162h interrupt control register ua0ric/cb4ric 47h fffff164h interrupt control register ua0tic/cb4tic 47h fffff166h interrupt control register ua1ric r/w 47h
chapter 3 cpu function user?s manual u19201ej3v0ud 107 (4/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffff168h interrupt control register ua1tic 47h fffff16ah interrupt control register ua2ric 47h fffff16ch interrupt control register ua2tic 47h fffff16eh interrupt control register adic 47h fffff170h interrupt control register dmaic0 47h fffff172h interrupt control register dmaic1 47h fffff174h interrupt control register dmaic2 47h fffff176h interrupt control register dmaic3 47h fffff178h interrupt control register kric 47h fffff17ah interrupt control register wtiic 47h fffff17ch interrupt control register wtic 47h fffff17eh interrupt control register erric0 note 1 47h fffff180h interrupt control register wupic0 note 1 47h fffff182h interrupt control register recic0 note 1 47h fffff184h interrupt control register trxic0 note 1 47h fffff186h interrupt control register erric1 note 2 47h fffff188h interrupt control register wupic1 note 2 47h fffff18ah interrupt control register recic1 note 2 47h fffff18ch interrupt control register trxic1 note 2 47h fffff18eh interrupt control register pic8 47h fffff190h interrupt control register tp6ovic 47h fffff192h interrupt control register tp6ccic0 47h fffff194h interrupt control register tp6ccic1 47h fffff196h interrupt control register tp7ovic 47h fffff198h interrupt control register tp7ccic0 47h fffff19ah interrupt control register tp7ccic1 47h fffff19ch interrupt control register tp8ovic 47h fffff19eh interrupt control register tp8ccic0 47h fffff1a0h interrupt control register tp8ccic1 47h fffff1a2h interrupt control register cb5ric 47h fffff1a4h interrupt control register cb5tic 47h fffff1a6h interrupt control register ua3ric 47h fffff1a8h interrupt control register ua3tic 47h fffff1b0h interrupt control register ua4ric 47h fffff1b2h interrupt control register ua4tic 47h fffff1b4h interrupt control register iicic3 47h fffff1b6h interrupt control register iicic0 47h fffff1b8h interrupt control register iicic2 47h fffff1bah interrupt control register iicic4 note 3 47h fffff1bch interrupt control register iicic5 note 3 r/w 47h notes 1. can controller version only 2. can controller (2-channel) version only 3. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h)
chapter 3 cpu function user?s manual u19201ej3v0ud 108 (5/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffff1beh interrupt control register pic9 47h fffff1c0h interrupt control register tp7iecic 47h fffff1c2h interrupt control register tp8iecic 47h fffff1c4h interrupt control register tm1eqic0 47h fffff1c6h interrupt control register tm2eqic0 47h fffff1c8h interrupt control register ce0tic note 47h fffff1cah interrupt control register ce0tiofic note 47h fffff1cch interrupt control register ce1tic note 47h fffff1ceh interrupt control register ce1tiofic note 47h fffff1d0h interrupt control register ub0tiric 47h fffff1d2h interrupt control register ub0titic 47h fffff1d4h interrupt control register ub0tific 47h fffff1d6h interrupt control register ub0tireic 47h fffff1d8h interrupt control register ub0titoic 47h fffff1dah interrupt control register ub1tiric 47h fffff1dch interrupt control register ub1titic 47h fffff1deh interrupt control register ub1tific 47h fffff1e0h interrupt control register ub1tireic 47h fffff1e2h interrupt control register ub1titoic 47h fffff1e4h interrupt control register ua5ric 47h fffff1e6h interrupt control register ua5tic 47h fffff1e8h interrupt control register erric 47h fffff1eah interrupt control register staic 47h fffff1ech interrupt control register ieic1 47h fffff1eeh interrupt control register ieic2 47h fffff1f0h interrupt control register rtc0ic 47h fffff1f2h interrupt control register rtc1ic 47h fffff1f4h interrupt control register rtc2ic r/w 47h fffff1fah in-service priority register ispr r 00h fffff1fch command register prcmd w undefined fffff1feh power save control register psc 00h fffff200h a/d converter mode register 0 ada0m0 00h fffff201h a/d converter mode register 1 ada0m1 00h fffff202h a/d converter channel specification register ada0s 00h fffff203h a/d converter mode register 2 ada0m2 00h fffff204h power-fail compare mode register ada0pfm 00h fffff205h power-fail compare threshold value register ada0pft r/w 00h fffff210h a/d conversion result register 0 ada0cr0 undefined fffff211h a/d conversion result register 0h ada0cr0h undefined fffff212h a/d conversion result register 1 ada0cr1 undefined fffff213h a/d conversion result register 1h ada0cr1h r undefined note not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h)
chapter 3 cpu function user?s manual u19201ej3v0ud 109 (6/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffff214h a/d conversion result register 2 ada0cr2 undefined fffff215h a/d conversion result register 2h ada0cr2h undefined fffff216h a/d conversion result register 3 ada0cr3 undefined fffff217h a/d conversion result register 3h ada0cr3h undefined fffff218h a/d conversion result register 4 ada0cr4 undefined fffff219h a/d conversion result register 4h ada0cr4h undefined fffff21ah a/d conversion result register 5 ada0cr5 undefined fffff21bh a/d conversion result register 5h ada0cr5h undefined fffff21ch a/d conversion result register 6 ada0cr6 undefined fffff21dh a/d conversion result register 6h ada0cr6h undefined fffff21eh a/d conversion result register 7 ada0cr7 undefined fffff21fh a/d conversion result register 7h ada0cr7h undefined fffff220h a/d conversion result register 8 ada0cr8 undefined fffff221h a/d conversion result register 8h ada0cr8h undefined fffff222h a/d conversion result register 9 ada0cr9 undefined fffff223h a/d conversion result register 9h ada0cr9h undefined fffff224h a/d conversion result register 10 ada0cr10 undefined fffff225h a/d conversion result register 10h ada0cr10h undefined fffff226h a/d conversion result register 11 ada0cr11 undefined fffff227h a/d conversion result register 11h ada0cr11h undefined fffff228h a/d conversion result register 12 ada0cr12 undefined fffff229h a/d conversion result register 12h ada0cr12h undefined fffff22ah a/d conversion result register 13 ada0cr13 undefined fffff22bh a/d conversion result register 13h ada0cr13h undefined fffff22ch a/d conversion result register 14 ada0cr14 undefined fffff22dh a/d conversion result register 14h ada0cr14h undefined fffff22eh a/d conversion result register 15 ada0cr15 undefined fffff22fh a/d conversion result register 15h ada0cr15h r undefined fffff280h d/a converter conversion va lue setting register 0 da0cs0 00h fffff281h d/a converter conversion va lue setting register 1 da0cs1 00h fffff282h d/a converter mode register da0m 00h fffff300h key return mode register krm 00h fffff308h selector operation control register 0 selcnt0 00h fffff310h crc input register crcin 00h fffff312h crc data register crcd 0000h fffff318h noise elimination control register nfc 00h fffff31ch tmp7 noise elimination control register en0nfc 00h fffff31eh tmp8 noise elimination control register en1nfc 00h fffff320h brg1 prescaler mode register prsm1 00h fffff321h brg1 prescaler compare register prscm1 00h fffff324h brg2 prescaler mode register prsm2 00h fffff325h brg2 prescaler compare register prscm2 r/w 00h
chapter 3 cpu function user?s manual u19201ej3v0ud 110 (7/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffff328h brg3 prescaler mode register prsm3 00h fffff329h brg3 prescaler compare register prscm3 00h fffff340h iic division clock select register 0 ocks0 00h fffff344h iic division clock select register 1 ocks1 00h fffff348h iebus clock select register ocks2 00h fffff34ch iic division clock select register 3 ocks3 note 1 00h fffff360h iebus control register bcr 00h fffff361h iebus power save register psr r/w 00h fffff362h iebus slave status register ssr 81h fffff363h iebus unit status register usr r 00h fffff364h iebus interrupt status register isr 00h fffff365h iebus error status register esr 00h fffff366h iebus unit address register uar 0000h fffff368h iebus slave address register sar r/w 0000h fffff36ah iebus partner ad dress register par 0000h fffff36ch iebus receive slave address register rsa r 0000h fffff36eh iebus control data register cdr 00h fffff36fh iebus telegraph length register dlr 01h fffff370h iebus data register dr r/w 00h fffff371h iebus field status register fsr 00h fffff372h iebus success count register scr 01h fffff373h iebus communication count register ccr r 20h fffff3f0h sscg control register sscgctl 00h fffff3f1h sscg frequency control register 0 sfc0 00h fffff3f2h sscg frequency control register 1 sfc1 00h fffff400h port 0 register p0 00h note 2 fffff402h port 1 register p1 00h note 2 fffff404h port 2 register p2 00h note 2 fffff406h port 3 register p3 0000h note 2 fffff406h port 3l register p3l 00h note 2 fffff407h port 3h register p3h 00h note 2 fffff408h port 4 register p4 00h note 2 fffff40ah port 5 register p5 00h note 2 fffff40ch port 6 register p6 0000h note 2 fffff40ch port 6l register p6l 00h note 2 fffff40dh port 6h register p6h 00h note 2 fffff40eh port 7l register p7l 00h note 2 fffff40fh port 7h register p7h 00h note 2 fffff410h port 8 register p8 r/w 00h note 2 notes 1. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h) 2. the value of the output latch is 00h or 0000h. the status of the pin is read during input.
chapter 3 cpu function user?s manual u19201ej3v0ud 111 (8/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffff412h port 9 register p9 0000h note 1 fffff412h port 9l register p9l 00h note 1 fffff413h port 9h register p9h 00h note 1 fffff41ah port 13 register p13 note 2 00h note 1 fffff41ch port 14 register p14 note 2 00h note 1 fffff41eh port 15 register p15 note 2 00h note 1 fffff420h port 0 mode register pm0 ffh fffff422h port 1 mode register pm1 ffh fffff424h port 2 mode register pm2 note ffh fffff426h port 3 mode register pm3 ffffh fffff426h port 3 mode register l pm3l ffh fffff427h port 3 mode register h pm3h ffh fffff428h port 4 mode register pm4 ffh fffff42ah port 5 mode register pm5 ffh fffff42ch port 6 mode register pm6 ffffh fffff42ch port 6 mode register l pm6l ffh fffff42dh port 6 mode register h pm6h ffh fffff42eh port 7 mode register l pm7l ffh fffff42fh port 7 mode register h pm7h ffh fffff430h port 8 mode register pm8 ffh fffff432h port 9 mode register pm9 ffffh fffff432h port 9 mode register l pm9l ffh fffff433h port 9 mode register h pm9h ffh fffff43ah port 13 mode register pm13 note 2 ffh fffff43ch port 14 mode register pm14 note 2 ffh fffff43eh port 15 mode register pm15 note 2 ffh fffff440h port 0 mode control register pmc0 00h fffff444h port 2 mode control register pmc2 note 2 00h fffff446h port 3 mode control register pmc3 0000h fffff446h port 3 mode control register l pmc3l 00h fffff447h port 3 mode control register h pmc3h 00h fffff448h port 4 mode control register pmc4 00h fffff44ah port 5 mode control register pmc5 00h fffff44ch port 6 mode control register pmc6 0000h fffff44ch port 6 mode control register l pmc6l 00h fffff44dh port 6 mode control register h pmc6h 00h fffff450h port 8 mode control register pmc8 00h fffff452h port 9 mode control register pmc9 0000h fffff452h port 9 mode control register l pmc9l 00h fffff453h port 9 mode control register h pmc9h r/w 00h notes 1. the value of the output latch is 00h or 0000h. the status of the pin is read during input. 2. v850e/sk3-h only
chapter 3 cpu function user?s manual u19201ej3v0ud 112 (9/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffff45eh port 15 mode control register pmc15 note 00h fffff460h port 0 function control register pfc0 00h fffff466h port 3 function control register pfc3 0000h fffff466h port 3 function control register l pfc3l 00h fffff467h port 3 function control register h pfc3h 00h fffff468h port 4 function control register pfc4 00h fffff46ah port 5 function control register pfc5 00h fffff46ch port 6 function control register pfc6 0000h fffff46ch port 6 function control register l pfc6l 00h fffff46dh port 6 function control register h pfc6h 00h fffff470h port 8 function control register pfc8 00h fffff472h port 9 function control register pfc9 0000h fffff472h port 9 function control register l pfc9l 00h fffff473h port 9 function control register h pfc9h 00h fffff484h data wait control register 0 dwc0 7777h fffff486h data wait control register 1 dwc1 7777h fffff488h address wait control register awc ffffh fffff48ah bus cycle control register bcc aaaah fffff540h tmq0 control register 0 tq0ctl0 00h fffff541h tmq0 control register 1 tq0ctl1 00h fffff542h tmq0 i/o control register 0 tq0ioc0 00h fffff543h tmq0 i/o control register 1 tq0ioc1 00h fffff544h tmq0 i/o control register 2 tq0ioc2 00h fffff545h tmq0 option register 0 tq0opt0 00h fffff546h tmq0 capture/compare register 0 tq0ccr0 0000h fffff548h tmq0 capture/compare register 1 tq0ccr1 0000h fffff54ah tmq0 capture/compare register 2 tq0ccr2 0000h fffff54ch tmq0 capture/compare register 3 tq0ccr3 r/w 0000h fffff54eh tmq0 counter read buffer register tq0cnt r 0000h fffff590h tmp0 control register 0 tp0ctl0 00h fffff591h tmp0 control register 1 tp0ctl1 00h fffff592h tmp0 i/o control register 0 tp0ioc0 00h fffff593h tmp0 i/o control register 1 tp0ioc1 00h fffff594h tmp0 i/o control register 2 tp0ioc2 00h fffff595h tmp0 option register 0 tp0opt0 00h fffff596h tmp0 capture/compare register 0 tp0ccr0 0000h fffff598h tmp0 capture/compare register 1 tp0ccr1 r/w 0000h fffff59ah tmp0 counter read buffer register tp0cnt r 0000h fffff5a0h tmp1 control register 0 tp1ctl0 00h fffff5a1h tmp1 control register 1 tp1ctl1 00h fffff5a2h tmp1 i/o control register 0 tp1ioc0 r/w 00h note v850e/sk3-h only
chapter 3 cpu function user?s manual u19201ej3v0ud 113 (10/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffff5a3h tmp1 i/o control register 1 tp1ioc1 00h fffff5a4h tmp1 i/o control register 2 tp1ioc2 00h fffff5a5h tmp1 option register 0 tp1opt0 00h fffff5a6h tmp1 capture/compare register 0 tp1ccr0 0000h fffff5a8h tmp1 capture/compare register 1 tp1ccr1 r/w 0000h fffff5aah tmp1 counter read buffer register tp1cnt r 0000h fffff5b0h tmp2 control register 0 tp2ctl0 00h fffff5b1h tmp2 control register 1 tp2ctl1 00h fffff5b2h tmp2 i/o control register 0 tp2ioc0 00h fffff5b3h tmp2 i/o control register 1 tp2ioc1 00h fffff5b4h tmp2 i/o control register 2 tp2ioc2 00h fffff5b5h tmp2 option register 0 tp2opt0 00h fffff5b6h tmp2 capture/compare register 0 tp2ccr0 0000h fffff5b8h tmp2 capture/compare register 1 tp2ccr1 r/w 0000h fffff5bah tmp2 counter read buffer register tp2cnt r 0000h fffff5c0h tmp3 control register 0 tp3ctl0 00h fffff5c1h tmp3 control register 1 tp3ctl1 00h fffff5c2h tmp3 i/o control register 0 tp3ioc0 00h fffff5c3h tmp3 i/o control register 1 tp3ioc1 00h fffff5c4h tmp3 i/o control register 2 tp3ioc2 r/w 00h fffff5c5h tmp3 option register 0 tp3opt0 00h fffff5c6h tmp3 capture/compare register 0 tp3ccr0 0000h fffff5c8h tmp3 capture/compare register 1 tp3ccr1 r/w 0000h fffff5cah tmp3 counter read buffer register tp3cnt r 0000h fffff5d0h tmp4 control register 0 tp4ctl0 00h fffff5d1h tmp4 control register 1 tp4ctl1 00h fffff5d2h tmp4 i/o control register 0 tp4ioc0 00h fffff5d3h tmp4 i/o control register 1 tp4ioc1 00h fffff5d4h tmp4 i/o control register 2 tp4ioc2 00h fffff5d5h tmp4 option register 0 tp4opt0 00h fffff5d6h tmp4 capture/compare register 0 tp4ccr0 0000h fffff5d8h tmp4 capture/compare register 1 tp4ccr1 r/w 0000h fffff5dah tmp4 counter read buffer register tp4cnt r 0000h fffff5e0h tmp5 control register 0 tp5ctl0 00h fffff5e1h tmp5 control register 1 tp5ctl1 00h fffff5e2h tmp5 i/o control register 0 tp5ioc0 00h fffff5e3h tmp5 i/o control register 1 tp5ioc1 00h fffff5e4h tmp5 i/o control register 2 tp5ioc2 00h fffff5e5h tmp5 option register 0 tp5opt0 00h fffff5e6h tmp5 capture/compare register 0 tp5ccr0 r/w 0000h fffff5e8h tmp5 capture/compare register 1 tp5ccr1 r/w 0000h fffff5eah tmp5 counter read buffer register tp5cnt r 0000h
chapter 3 cpu function user?s manual u19201ej3v0ud 114 (11/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffff5f0h tmp6 control register 0 tp6ctl0 00h fffff5f1h tmp6 control register 1 tp6ctl1 00h fffff5f2h tmp6 i/o control register 0 tp6ioc0 00h fffff5f3h tmp6 i/o control register 1 tp6ioc1 00h fffff5f4h tmp6 i/o control register 2 tp6ioc2 00h fffff5f5h tmp6 option register 0 tp6opt0 00h fffff5f6h tmp6 capture/compare register 0 tp6ccr0 0000h fffff5f8h tmp6 capture/compare register 1 tp6ccr1 r/w 0000h fffff5fah tmp6 counter read buffer register tp6cnt r 0000h fffff640h tmp7 control register 0 tp7ctl0 00h fffff641h tmp7 control register 1 tp7ctl1 00h fffff642h tmp7 control register 2 tp7ctl2 00h fffff643h tmp7 i/o control register 0 tp7ioc0 00h fffff644h tmp7 i/o control register 1 tp7ioc1 00h fffff645h tmp7 i/o control register 2 tp7ioc2 00h fffff646h tmp7 i/o control register 3 tp7ioc3 00h fffff647h tmp7 option register 0 tp7opt0 00h fffff648h tmp7 option register 1 tp7opt1 00h fffff64ah tmp7 capture/compare register 0 tp7ccr0 0000h fffff64ch tmp7 capture/compare register 1 tp7ccr1 r/w 0000h fffff64eh tmp7 counter read buffer register tp7cnt r 0000h fffff650h tmp7 counter write register tp7tcw 0000h fffff660h tmp8 control register 0 tp8ctl0 00h fffff661h tmp8 control register 1 tp8ctl1 00h fffff662h tmp8 control register 2 tp8ctl2 00h fffff663h tmp8 i/o control register 0 tp8ioc0 00h fffff664h tmp8 i/o control register 1 tp8ioc1 00h fffff665h tmp8 i/o control register 2 tp8ioc2 00h fffff666h tmp8 i/o control register 3 tp8ioc3 00h fffff667h tmp8 option register 0 tp8opt0 00h fffff668h tmp8 option register 1 tp8opt1 00h fffff66ah tmp8 capture/compare register 0 tp8ccr0 0000h fffff66ch tmp8 capture/compare register 1 tp8ccr1 r/w 0000h fffff66eh tmp8 counter read buffer register tp8cnt r 0000h fffff670h tmp8 counter write register tp8tcw 0000h fffff680h watch timer operation mode register wtm 00h fffff690h tmm0 control register 0 tm0ctl0 00h fffff694h tmm0 compare register 0 tm0cmp0 0000h fffff6a0h tmm1 control register 0 tm1ctl0 00h fffff6a4h tmm1 compare register 0 tm1cmp0 0000h fffff6b0h tmm2 control register 0 tm2ctl0 00h fffff6b4h tmm2 compare register 0 tm2cmp0 r/w 0000h
chapter 3 cpu function user?s manual u19201ej3v0ud 115 (12/19) manipulatable bits address function register name symbol r/w 1 8 16 32 default value fffff6c0h oscillation stabilization time select register osts 06h fffff6c1h pll lockup time specification register plls 03h fffff6d0h watchdog timer mode register 2 wdtm2 67h fffff6d1h watchdog timer enable register wdte 9ah fffff6e0h real-time output buffer register 0l rtbl0 00h fffff6e2h real-time output buffer register 0h rtbh0 00h fffff6e4h real-time output port mode register 0 rtpm0 00h fffff6e5h real-time output port control register 0 rtpc0 00h fffff6f0h real-time output buffer register 1l rtbl1 00h fffff6f2h real-time output buffer register 1h rtbh1 00h fffff6f4h real-time output port mode register 1 rtpm1 00h fffff6f5h real-time output port control register 1 rtpc1 00h fffff700h port 0 function control expansion register pfce0 note 00h fffff706h port 3 function control expansion register pfce3 0000h fffff706h port 3 function control expansion register l pfce3l 00h fffff707h port 3 function control expansion register h pfce3h 00h fffff70ah port 5 function control expansion register pfce5 00h fffff70ch port 6 function control expansion register pfce6 0000h fffff70ch port 6 function control expansion register l pfce6l 00h fffff70dh port 6 function control expansion register h pfce6h 00h fffff710h port 8 function control expansion register pfce8 00h fffff712h port 9 function control expansion register pfce9 0000h fffff712h port 9 function control expansion register l pfce9l 00h fffff713h port 9 function control expansion register h pfce9h 00h fffff802h system status register sys 00h fffff80ch internal oscillation mode register rcm 00h fffff810h dma trigger factor register 0 dtfr0 00h fffff812h dma trigger factor register 1 dtfr1 00h fffff814h dma trigger factor register 2 dtfr2 00h fffff816h dma trigger factor register 3 dtfr3 00h fffff820h power save mode register psmr 00h fffff822h clock control register ckc r/w 0ah fffff824h lock register lockr r 00h fffff828h processor clock control register pcc 03h fffff82ch pll control register pllctl r/w 01h fffff82eh cpu operation clock status register ccls r 00h fffff840h correction address register 0 corad0 00000000h fffff840h correction address register 0l corad0l 0000h fffff842h correction address register 0h corad0h 0000h fffff844h correction address register 1 corad1 00000000h fffff844h correction address register 1l corad1l 0000h fffff846h correction address register 1h corad1h r/w 0000h note not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h)
chapter 3 cpu function user?s manual u19201ej3v0ud 116 (13/19) manipulatable bits address function register name symbol r/w 1 8 16 32 default value fffff848h correction address register 2 corad2 00000000h fffff848h correction address register 2l corad2l 0000h fffff84ah correction address register 2h corad2h 0000h fffff84ch correction address register 3 corad3 00000000h fffff84ch correction address register 3l corad3l 0000h fffff84eh correction address register 3h corad3h 0000h fffff850h correction address register 4 corad4 00000000h fffff850h correction address register 4l corad4l 0000h fffff852h correction address register 4h corad4h 0000h fffff854h correction address register 5 corad5 00000000h fffff854h correction address register 5l corad5l 0000h fffff856h correction address register 5h corad5h 0000h fffff858h correction address register 6 corad6 00000000h fffff858h correction address register 6l corad6l 0000h fffff85ah correction address register 6h corad6h 0000h fffff85ch correction address register 7 corad7 00000000h fffff85ch correction address register 7l corad7l 0000h fffff85eh correction address register 7h corad7h 0000h fffff870h clock monitor mode register clm 00h fffff880h correction control register corcn 00h fffff888h reset source flag register resf 00h fffff890h low-voltage detection register lvim 00h fffff891h low-voltage detection level select register lvis 00h fffff892h internal ram data status register rams 01h note 1 fffff8b0h prescaler mode register 0 prsm0 00h fffff8b1h prescaler compare register 0 prscm0 00h fffff900h csie0 control register 0 ce0ctl0 note 2 00h fffff901h csie0 control register 1 ce0ctl1 note 2 r/w 07h fffff902h csie0 receive data buffer register ce0rx0 note 2 0000h fffff902h csie0 receive data buffer register l ce0rx0l note 2 00h fffff903h csie0 receive data buffer register h ce0rx0h note 2 r 00h fffff906h csie0 transmit data buffer register ce0tx0 note 2 0000h fffff906h csie0 transmit data buffer register l ce0tx0l note 2 00h fffff907h csie0 transmit data buffer register h ce0tx0h note 2 00h fffff908h csie0 status register ce0str note 2 20h fffff909h csie0 control register 2 ce0ctl2 note 2 00h fffff90ch csie0 control register 3 ce0ctl3 note 2 00h fffff940h csie1 control register 0 ce1ctl0 note 2 00h fffff941h csie1 control register 1 ce1ctl1 note 2 r/w 07h notes 1. the default value indicates the value after the power is turned on. the status before a reset is retained after the reset. 2. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h)
chapter 3 cpu function user?s manual u19201ej3v0ud 117 (14/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffff942h csie1 receive data buffer register ce1rx0 note 1 0000h fffff942h csie1 receive data buffer register l ce1rx0l note 1 00h fffff943h csie1 receive data buffer register h ce1rx0h note 1 00h fffff946h csie1 transmit data buffer register ce1tx0 note 1 0000h fffff946h csie1 transmit data buffer register l ce1tx0l note 1 00h fffff947h csie1 transmit data buffer register h ce1tx0h note 1 00h fffff948h csie1 status register ce1str note 1 20h fffff949h csie1 control register 2 ce1ctl2 note 1 00h fffff94ch csie1 control register 3 ce1ctl3 note 1 00h fffff9fch on-chip debug mode register ocdm 01h fffff9feh peripheral emul ation register 1 pemu1 note 2 00h fffffa00h uarta0 control register 0 ua0ctl0 10h fffffa01h uarta0 control register 1 ua0ctl1 00h fffffa02h uarta0 control register 2 ua0ctl2 ffh fffffa03h uarta0 option control register 0 ua0opt0 14h fffffa04h uarta0 status register ua0str r 00h fffffa06h uarta0 receive data register ua0rx r ffh fffffa07h uarta0 transmit data register ua0tx ffh fffffa10h uarta1 control register 0 ua1ctl0 10h fffffa11h uarta1 control register 1 ua1ctl1 00h fffffa12h uarta1 control register 2 ua1ctl2 ffh fffffa13h uarta1 option control register 0 ua1opt0 14h fffffa14h uarta1 status register ua1str r/w 00h fffffa16h uarta1 receive data register ua1rx r ffh fffffa17h uarta1 transmit data register ua1tx ffh fffffa20h uarta2 control register 0 ua2ctl0 10h fffffa21h uarta2 control register 1 ua2ctl1 00h fffffa22h uarta2 control register 2 ua2ctl2 ffh fffffa23h uarta2 option control register 0 ua2opt0 14h fffffa24h uarta2 status register ua2str r/w 00h fffffa26h uarta2 receive data register ua2rx r ffh fffffa27h uarta2 transmit data register ua2tx ffh fffffa30h uarta3 control register 0 ua3ctl0 10h fffffa31h uarta3 control register 1 ua3ctl1 00h fffffa32h uarta3 control register 2 ua3ctl2 r/w ffh fffffa33h uarta3 option control register 0 ua3opt0 14h fffffa34h uarta3 status register ua3str r/w 00h fffffa36h uarta3 receive data register ua3rx r ffh fffffa37h uarta3 transmit data register ua3tx ffh fffffa40h uarta4 control register 0 ua4ctl0 r/w 10h notes 1. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h) 2. only during emulation
chapter 3 cpu function user?s manual u19201ej3v0ud 118 (15/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffffa41h uarta4 control register 1 ua4ctl1 00h fffffa42h uarta4 control register 2 ua4ctl2 ffh fffffa43h uarta4 option control register 0 ua4opt0 14h fffffa44h uarta4 status register ua4str r/w 00h fffffa46h uarta4 receive data register ua4rx r ffh fffffa47h uarta4 transmit data register ua4tx ffh fffffa50h uarta5 control register 0 ua5ctl0 10h fffffa51h uarta5 control register 1 ua5ctl1 00h fffffa52h uarta5 control register 2 ua5ctl2 ffh fffffa53h uarta5 option control register 0 ua5opt0 14h fffffa54h uarta5 status register ua5str r/w 00h fffffa56h uarta5 receive data register ua5rx r ffh fffffa57h uarta5 transmit data register ua5tx ffh fffffa80h uartb0 control register 0 ub0ctl0 10h fffffa82h uartb0 control register 2 ub0ctl2 ffffh fffffa84h uartb0 status register ub0str r/w 00h fffffa86h uartb0 receive data register ap ub0rxap 00ffh fffffa86h uartb0 receive data register ub0rx r ffh fffffa88h uartb0 transmit data register ub0tx w ffh fffffa8ah uartb0 fifo control register 0 ub0fic0 00h fffffa8bh uartb0 fifo control register 1 ub0fic1 00h fffffa8ch uartb0 fifo control register 2 ub0fic2 0000h fffffa8ch uartb0 fifo control register 2l ub0fic2l 00h fffffa8dh uartb0 fifo control register 2h ub0fic2h r/w 00h fffffa8eh uartb0 fifo status register 0 ub0fis0 00h fffffa8fh uartb0 fifo status register 1 ub0fis1 r 10h fffffaa0h uartb1 control register 0 ub1ctl0 10h fffffaa2h uartb1 control register 2 ub1ctl2 ffffh fffffaa4h uartb1 status register ub1str r/w 00h fffffaa6h uartb1 receive data register ap ub1rxap 00ffh fffffaa6h uartb1 receive data register ub1rx r ffh fffffaa8h uartb1 transmit data register ub1tx w ffh fffffaaah uartb1 fifo control register 0 ub1fic0 00h fffffaabh uartb1 fifo control register 1 ub1fic1 00h fffffaach uartb1 fifo control register 2 ub1fic2 0000h fffffaach uartb1 fifo control register 2l ub1fic2l 00h fffffaadh uartb1 fifo control register 2h ub1fic2h r/w 00h fffffaaeh uartb1 fifo status register 0 ub1fis0 00h fffffaafh uartb1 fifo status register 1 ub1fis1 10h fffffad0h subcount register rc1subc r 0000h fffffad2h second count register rc1sec 00h fffffad3h minute count register rc1min r/w 00h
chapter 3 cpu function user?s manual u19201ej3v0ud 119 (16/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffffad4h hour count register rc1hour 12h fffffad5h week count register rc1week 00h fffffad6h day count register rc1day 01h fffffad7h month count register rc1month 01h fffffad8h year count register rc1year 00h fffffad9h watch error correct register rc1subu 00h fffffadah alarm minute setting register rc1alm 00h fffffadbh alarm hour setting register rc1alh 12h fffffadch alarm week setting register rc1alw 00h fffffaddh real-time counter control register 0 rc1cc0 00h fffffadeh real-time counter control register 1 rc1cc1 00h fffffadfh real-time counter control register 2 rc1cc2 00h fffffae0h real-time counter control register 3 rc1cc3 00h fffffc00h external interrupt falling edge specification register 0 intf0 00h fffffc06h external interrupt falling edge specification register 3 intf3 00h fffffc08h external interrupt falling edge specification register 4 intf4 00h fffffc0ah external interrupt falling edge specification register 5 intf5 00h fffffc0ch external interrupt falling edge specification register 6 intf6 00h fffffc10h external interrupt falling edge specification register 8 intf8 00h fffffc12h external interrupt falling edge specification register 9 intf9 0000h fffffc12h external interrupt falling edge specification register 9l intf9l 00h fffffc13h external interrupt falling edge specification register 9h intf9h 00h fffffc1eh external interrupt falling edge specification register 15 intf15 note 00h fffffc20h external interrupt rising edge specification register 0 intr0 00h fffffc26h external interrupt rising edge specification register 3 intr3 00h fffffc28h external interrupt rising edge specification register 4 intr4 00h fffffc2ah external interrupt rising edge specification register 5 intr5 00h fffffc2ch external interrupt rising edge specification register 6 intr6 00h fffffc30h external interrupt rising edge specification register 8 intr8 00h fffffc32h external interrupt rising edge specification register 9 intr9 0000h fffffc32h external interrupt rising edge specification register 9l intr9l 00h fffffc33h external interrupt rising edge specification register 9h intr9h 00h fffffc3eh external interrupt rising edge specification register 15 intr15 note 00h fffffc60h port 0 function register pf0 00h fffffc64h port 2 function register pf2 note 00h fffffc66h port 3 function register pf3 0000h fffffc66h port 3 function register l pf3l 00h fffffc67h port 3 function register h pf3h 00h fffffc68h port 4 function register pf4 00h fffffc6ah port 5 function register pf5 r/w 00h note v850e/sk3-h only
chapter 3 cpu function user?s manual u19201ej3v0ud 120 (17/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffffc6ch port 6 function register pf6 0000h fffffc6ch port 6 function register l pf6l 00h fffffc6dh port 6 function register h pf6h 00h fffffc70h port 8 function register pf8 00h fffffc72h port 9 function register pf9 0000h fffffc72h port 9 function register l pf9l 00h fffffc73h port 9 function register h pf9h 00h fffffc7eh port 15 function register pf15 note r/w 00h fffffcc8h product selection register l prdsell depends on product fffffccah product selection register h prdselh r depends on product fffffd00h csib0 control register 0 cb0ctl0 01h fffffd01h csib0 control register 1 cb0ctl1 00h fffffd02h csib0 control register 2 cb0ctl2 00h fffffd03h csib0 status register cb0str r/w 00h fffffd04h csib0 receive data register cb0rx 0000h fffffd04h csib0 receive data register l cb0rxl r 00h fffffd06h csib0 transmit data register cb0tx 0000h fffffd06h csib0 transmit data register l cb0txl 00h fffffd10h csib1 control register 0 cb1ctl0 01h fffffd11h csib1 control register 1 cb1ctl1 00h fffffd12h csib1 control register 2 cb1ctl2 00h fffffd13h csib1 status register cb1str r/w 00h fffffd14h csib1 receive data register cb1rx 0000h fffffd14h csib1 receive data register l cb1rxl r 00h fffffd16h csib1 transmit data register cb1tx 0000h fffffd16h csib1 transmit data register l cb1txl 00h fffffd20h csib2 control register 0 cb2ctl0 01h fffffd21h csib2 control register 1 cb2ctl1 00h fffffd22h csib2 control register 2 cb2ctl2 00h fffffd23h csib2 status register cb2str r/w 00h fffffd24h csib2 receive data register cb2rx 0000h fffffd24h csib2 receive data register l cb2rxl r 00h fffffd26h csib2 transmit data register cb2tx 0000h fffffd26h csib2 transmit data register l cb2txl 00h fffffd30h csib3 control register 0 cb3ctl0 01h fffffd31h csib3 control register 1 cb3ctl1 00h fffffd32h csib3 control register 2 cb3ctl2 00h fffffd33h csib3 status register cb3str r/w 00h fffffd34h csib3 receive data register cb3rx 0000h fffffd34h csib3 receive data register l cb3rxl r 00h note v850e/sk3-h only
chapter 3 cpu function user?s manual u19201ej3v0ud 121 (18/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffffd36h csib3 transmit data register cb3tx 0000h fffffd36h csib3 transmit data register l cb3txl 00h fffffd40h csib4 control register 0 cb4ctl0 01h fffffd41h csib4 control register 1 cb4ctl1 00h fffffd42h csib4 control register 2 cb4ctl2 00h fffffd43h csib4 status register cb4str r/w 00h fffffd44h csib4 receive data register cb4rx 0000h fffffd44h csib4 receive data register l cb4rxl r 00h fffffd46h csib4 transmit data register cb4tx 0000h fffffd46h csib4 transmit data register l cb4txl 00h fffffd50h csib5 control register 0 cb5ctl0 01h fffffd51h csib5 control register 1 cb5ctl1 00h fffffd52h csib5 control register 2 cb5ctl2 00h fffffd53h csib5 status register cb5str r/w 00h fffffd54h csib5 receive data register cb5rx 0000h fffffd54h csib5 receive data register l cb5rxl r 00h fffffd56h csib5 transmit data register cb5tx 0000h fffffd56h csib5 transmit data register l cb5txl 00h fffffd80h iic shift register 0 iic0 00h fffffd82h iic control register 0 iicc0 00h fffffd83h slave address register 0 sva0 00h fffffd84h iic clock select register 0 iiccl0 00h fffffd85h iic function expansion register 0 iicx0 r/w 00h fffffd86h iic status register 0 iics0 r 00h fffffd8ah iic flag register 0 iicf0 00h fffffd90h iic shift register 1 iic1 00h fffffd92h iic control register 1 iicc1 00h fffffd93h slave address register 1 sva1 00h fffffd94h iic clock select register 1 iiccl1 00h fffffd95h iic function expansion register 1 iicx1 r/w 00h fffffd96h iic status register 1 iics1 r 00h fffffd9ah iic flag register 1 iicf1 00h fffffda0h iic shift register 2 iic2 00h fffffda2h iic control register 2 iicc2 00h fffffda3h slave address register 2 sva2 00h fffffda4h iic clock select register 2 iiccl2 00h fffffda5h iic function expansion register 2 iicx2 r/w 00h fffffda6h iic status register 2 iics2 r 00h fffffdaah iic flag register 2 iicf2 00h fffffdb0h iic shift register 3 iic3 00h fffffdb2h iic control register 3 iicc3 00h fffffdb3h slave address register 3 sva3 r/w 00h
chapter 3 cpu function user?s manual u19201ej3v0ud 122 (19/19) manipulatable bits address function register name symbol r/w 1 8 16 default value fffffdb4h iic clock select register 3 iiccl3 00h fffffdb5h iic function expansion register 3 iicx3 r/w 00h fffffdb6h iic status register 3 iics3 r 00h fffffdbah iic flag register 3 iicf3 00h fffffdc0h iic shift register 4 iic4 note 00h fffffdc2h iic control register 4 iicc4 note 00h fffffdc3h slave address register 4 sva4 note 00h fffffdc4h iic clock select register 4 iiccl4 note 00h fffffdc5h iic function expansion register 4 iicx4 note r/w 00h fffffdc6h iic status register 4 iics4 note r 00h fffffdcah iic flag register 4 iicf4 note 00h fffffdd0h iic shift register 5 iic5 note 00h fffffdd2h iic control register 5 iicc5 note 00h fffffdd3h slave address register 5 sva5 note 00h fffffdd4h iic clock select register 5 iiccl5 note 00h fffffdd5h iic function expansion register 5 iicx5 note r/w 00h fffffdd6h iic status register 5 iics5 note r 00h fffffddah iic flag register 5 iicf5 note 00h ffffffbeh external bus interface mode control register eximc r/w 00h note not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h)
chapter 3 cpu function user?s manual u19201ej3v0ud 123 3.4.7 programmable peripheral i/o registers the bpc register is used for programmable peripheral i/o register area selection. (1) peripheral i/o area selec t control register (bpc) the bpc register can be read or written in 16-bit units. reset sets this register to 0000h. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 address default value bpc pa15 0 pa13 pa12 pa11 pa10 pa09 pa08 pa07 pa06 pa05 pa04 pa03 pa02 pa01 pa00 fffff064h 0000h bit position bit name function enables/disables usage of prog rammable peripheral i/o area. pa15 usage of programmable peripheral i/o area 0 usage of programmable peripheral i/o area disabled 1 usage of programmable peripheral i/o area enabled 15 pa15 13 to 0 pa13 to pa00 specify an address in programmabl e peripheral i/o area (corresponding to a27 to a14, respectively). caution when setting the pa15 bit to 1, be sure to set the bpc register to 8ffbh. when clearing the pa15 bit to 0, be su re to set the bpc register to 0000h. for a list of the programmable peripheral i/o register areas, see table 21-16 register access types .
chapter 3 cpu function user?s manual u19201ej3v0ud 124 3.4.8 special registers special registers are registers that are protected from being written with illegal data due to a program hang-up. the v850e/sj3-h and v850e/sk3-h have the following ten special registers. ? power save control register (psc) ? clock control register (ckc) ? processor clock control register (pcc) ? sscg frequency control register 0 (sfc0) ? sscg frequency control register 1 (sfc1) ? clock monitor mode register (clm) ? reset source flag register (resf) ? low-voltage detection register (lvim) ? internal ram data status register (rams) ? on-chip debug mode register (ocdm) in addition, the prcdm register is provided to protect again st a write access to the spec ial registers so that the application system does not inadv ertently stop due to a program hang-up. a write access to the special registers is made in a specific sequence, and an illegal st ore operation is reported to the sys register.
chapter 3 cpu function user?s manual u19201ej3v0ud 125 (1) setting data to special registers set data to the special registers in the following sequence. <1> disable dma operation. <2> prepare data to be set to the special register in a general-purpose register. <3> write the data prepared in <2> to the prcmd register. <4> write the setting data to the special re gister (by using the following instructions). ? store instruction (st/sst instruction) ? bit manipulation instruction (set1/clr1/not1 instruction) (<5> to <9> insert nop instructions (5 instructions).) note <10> enable dma operation if necessary. [example] with psc register (setting standby mode) st.b r11, psmr[r0] ; set psmr register (setting idle1, idle2, and stop modes). <1>clr1 0, dchcn[r0] ; disable dma operation. n = 0 to 3 <2>mov0x02, r10 <3>st.b r10, prcmd[r0] ; write prcmd register. <4>st.b r10, psc[r0] ; set psc register. <5>nop note ; dummy instruction <6>nop note ; dummy instruction <7>nop note ; dummy instruction <8>nop note ; dummy instruction <9>nop note ; dummy instruction <10>set1 0, dchcn[r0] ; enable dma operation. n = 0 to 3 (next instruction) there is no special sequence to read a special register. note five nop instructions or more must be inserted immediately after setting the idle1 mode, idle2 mode, or stop mode (by setting the psc.stp bit to 1). cautions 1. when a store instruction is executed to store data in the comma nd register, interrupts are not acknowledged. this is because it is assumed that steps <3> and <4> above are performed by successive store instructions. if another instruction is placed between <3> and <4>, and if an interrupt is acknowledged by that instruction, the above sequence may not be established, causing malfunction. 2. although dummy data is written to th e prcmd register, use the same general-purpose register used to set the speci al register (<4> in example) to write data to the prcmd register (<3> in example). the same applies when a general-purpose register is used for addressing.
chapter 3 cpu function user?s manual u19201ej3v0ud 126 (2) command register (prcmd) the prcmd register is an 8-bit register that protects the registers that may seriously affect the application system from being written, so that t he system does not inadvertently stop due to a program hang-up. the first write access to a special register is valid after data has be en written in advance to the prcmd register. in this way, the value of the special register can be rewritten only in a specific se quence, so as to protect the register from an illegal write access. the prcmd register is write-only, in 8-bit units (undefined data is read when this register is read). reset makes this register undefined. 7 reg7 prcmd 6 reg6 5 reg5 4 reg4 3 reg3 2 reg2 1 reg1 0 reg0 after reset: undefined w address: fffff1fch
chapter 3 cpu function user?s manual u19201ej3v0ud 127 (3) system status register (sys) status flags that indicate the ope ration status of the overall system are allocated to this register. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 protection error did not occur protection error occurred prerr 0 1 detects protection error sys 0 0 0 0 0 0 prerr after reset: 00h r/w address: fffff802h < > the prerr flag operates under the following conditions. (a) set condition (prerr flag = 1) (i) when data is written to a special register without writing anything to the prcmd register (when <4> is executed without executing <3> in 3.4.8 (1) setting data to special registers ) (ii) when data is written to an on-chip peripheral i/o register other than a special register (including execution of a bit manipulation instruction) afte r writing data to the prcmd register (if <4> in 3.4.8 (1) setting data to special registers is not the setting of a special register) remark even if an on-chip peripheral i/o register is read (except by a bit manipulation instruction) between an operation to write the prcmd register and an operation to write a special register, the prerr flag is not set, and the set dat a can be written to the special register. (b) clear condition (prerr flag = 0) (i) when 0 is written to the prerr flag (ii) when the system is reset cautions 1. if 0 is written to the prerr bit of the sys register, which is not a special register, immediately after a write access to the prcm d register, the prerr bit is cleared to 0 (the write access takes precedence). 2. if data is written to the prcmd regist er, which is not a special register, immediately after a write access to the prcmd regi ster, the prerr bit is set to 1.
chapter 3 cpu function user?s manual u19201ej3v0ud 128 3.4.9 cautions (1) registers to be set first be sure to set the following registers first when using the v850e/sj3-h and v850e/sk3-h. ? system wait control register (vswc) ? on-chip debug mode register (ocdm) ? watchdog timer mode register 2 (wdtm2) ? registers related to expanded internal ram ? bus size configuration register (bsc) ? data wait control register 1 (dwc1) ? address wait control register (awc) ? bus cycle control register (bcc) ? program id register (asid) ? initialization setting registers w hen using clock modes 2, 3, and 4 ? clock control register (ckc) ? sscg frequency control register 0 (sfc0) ? sscg frequency control register 1 (sfc1) after setting the above registers, set the other registers as necessary. when using the external bus, set each pin to the alternate-function bus control pin mode by using the port- related registers after setting the above registers. (a) system wait control register (vswc) the vswc register controls wait of bus a ccess to the on-chip peripheral i/o registers. three clocks are required to access an on-chip pe ripheral i/o register (without a wait cycle). the v850e/sj3-h and v850e/sk3-h require wait cycles according to the operating frequency. set the following value to the vswc register in accordance with the frequency used. the vswc register can be read or written in 8-bit units (address: fffff06eh, default value: 77h). operating frequency (f clk ) set value of vswc number of waits 32 khz f clk < 16.6 mhz 00h 0 (no waits) 16.6 mhz f clk < 25 mhz 01h 1 25 mhz f clk < 33.3 mhz 11h 2 33.3 mhz f clk 48 mhz 12h 3 (b) on-chip debug mode register (ocdm) for details, see chapter 34 on-chip debug function . (c) watchdog timer mode register 2 (wdtm2) the wdtm2 register sets the overflow time and the operation clock of the watchdog timer 2. the watchdog timer 2 automatically st arts in the reset mode after reset is released. write the wdtm2 register to activate this operation. for details, refer to chapter 11 functions of watchdog timer 2 .
chapter 3 cpu function user?s manual u19201ej3v0ud 129 (d) registers related to expanded internal ram the expanded internal ram is accessed via the external bus interface. before accessing the expanded internal ram, be sure to set the registers related to the external bus interface (initial settings for the expanded internal ram). for details, refer to 3.4.4 (6) expanded internal ram . (e) program id register (asid) for details, refer to 3.2.2 (8) program id register (asid) . (f) initialization setting register wh en using clock modes 2, 3, and 4 for details, refer to 6.4.4 (1) initialization setting for using clock modes 2, 3, and 4 . (2) accessing specific on-chip peripheral i/o registers this product has two types of internal system buses. one is a cpu bus and the other is a peripheral bus t hat interfaces with low-speed peripheral hardware. the clock of the cpu bus and the clock of the peripher al bus are asynchronous. if an access to the cpu and an access to the peripheral hardware conflict, therefore, unexpected illegal data may be transferred. if there is a possibility of a conflict, the number of cycles for acce ssing the cpu changes when t he peripheral hardware is accessed, so that correct data is transferred. as a result, the cpu does not start processing of the next instruction but enters the wait state. if this wait st ate occurs, the number of clocks required to execute an instruction increases by the number of wait clocks shown below. this must be taken into consideration if real-time processing is required. when specific on-chip peripheral i/o registers are access ed, more wait states may be required in addition to the wait states set by the vswc register. the access conditions and how to calculate the number of wait states to be inserted (number of cpu clocks) at this time are shown below.
chapter 3 cpu function user?s manual u19201ej3v0ud 130 (1/2) peripheral function register name access k tpncnt read 1 or 2 write ? 1st access: no wait ? continuous write: 0 to 3 16-bit timer/event counter p (tmp) (n = 0 to 8) tpnccr0, tpnccr1 read 1 or 2 tq0cnt read 1 or 2 write ? 1st access: no wait ? continuous write: 0 to 3 16-bit timer/event counter q (tmq) tq0ccr0 to tq0ccr3 read 1 or 2 cenctl0 note write 1 to 5 centx0 note write 0 to 4 3-wire variable-length serial i/o e (csie) note (n = 0, 1) censtr note read 1 to 5 ubntx write 0 to 4 asynchronous serial interface b (uartb) (n = 0, 1) ubnrx ubnrxap ubnfis0 ubnfis1 read 1 to 5 watchdog timer 2 (wdt2) wdtm2 write (when wdt2 operating) 3 rtbl0, rtbl1 write (rtpcn.rtpoen bit = 0) 1 real-time output function (rto) rtbh0, rtbh1 write (rtpcn.rtpoen bit = 0) 1 ada0m0 read 1 to 3 ada0cr0 to ada0cr15 read 1 to 3 a/d converter ada0cr0h to ada0cr15h read 1 to 3 i 2 c00 to i 2 c03, i 2 c04 note , i 2 c05 note iics0 to iics3, iics4 note , iics5 note read 1 note not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h)
chapter 3 cpu function user?s manual u19201ej3v0ud 131 (2/2) peripheral function register name access k cngmabt note 1 , cngmabtd note 1 , cnmaskal note 1 , cnmaskah note 1 , cnlec note 1 , cninfo note 1 , cnerc note 1 , cnie note 1 , cnints note 1 , cnbrp note 1 , cnbtr note 1 , cnts note 1 read/write (f cpu /f canmod + 1)/(2 + j) (min.) note 2 (2 f cpu /f canmod + 1)/(2 + j) (max.) note 2 cngmctrl note 1 , cngmcs note 1 , cnctrl note 1 read/write (f cpu /f can + 1)/(2 + j) (min.) note 2 (2 f cpu /f can + 1)/(2 + j) (max.) note 2 write (f cpu /f canmod + 1)/(2 + j) (min.) note 2 (2 f cpu /f canmod + 1)/(2 + j) (max.) note 2 cnrgpt note 1 , cntgpt note 1 read (3 f cpu /f canmod + 1)/(2 + j) (min.) note 2 (4 f cpu /f canmod + 1)/(2 + j) (max.) note 2 cnlipt note 1 , cnlopt note 1 read (3 f cpu /f canmod + 1)/(2 + j) (min.) note 2 (4 f cpu /f canmod + 1)/(2 + j) (max.) note 2 write (4 f cpu /f can + 1)/(2 + j) (min.) note 2 (5 f cpu /f can + 1)/(2 + j) (max.) note 2 cnmctrlm note 1 read (3 f cpu /f can + 1)/(2 + j) (min.) note 2 (4 f cpu /f can + 1)/(2 + j) (max.) note 2 write (8 bits) (4 f cpu /f canmod + 1)/(2 + j) (min.) note 2 (5 f cpu /f canmod + 1)/(2 + j) (max.) note 2 write (16 bits) (2 f cpu /f canmod + 1)/(2 + j) (min.) note (3 f cpu /f canmod + 1)/(2 + j) (max.) note can controller note 1 (n = 0, 1, m = 0 to 31, a = 1 to 4) cnmdata01m note 1 , cnmdata0m note 1 , cnmdata1m note 1 , cnmdata23m note 1 , cnmdata2m note 1 , cnmdata3m note 1 , cnmdata45m note 1 , cnmdata4m note 1 , cnmdata5m note 1 , cnmdata67m note 1 , cnmdata6m note 1 , cnmdata7m note 1 , cnmdlcm note 1 , cnmconfm note 1 , cnmidlm note 1 , cnmidhm note 1 read (8/16 bits) (3 f cpu /f canmod + 1)/(2 + j) (min.) note 2 (4 f cpu /f canmod + 1)/(2 + j) (max.) note 2 crc crcd write 1 number of clocks necessary for access = 3 + i + j + (2 + j) k notes 1. can controller version only 2. digits below the decimal point are rounded up. caution accessing the above register s is prohibited in the following statuses. if a wait cycle is generated, it can only be cleared by a reset. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock remark f cpu : cpu clock frequency f canmod : can module system clock f can : clock supplied to can i: values (0 or 1) of higher 4 bits of vswc register j: values (0 or 1) of lower 4 bits of vswc register
chapter 3 cpu function user?s manual u19201ej3v0ud 132 (3) restriction on conflict between sld instruction and interrupt request (a) description if a conflict occurs between the decode operation of an instruction in <2> immediately before the sld instruction following an instruction in <1> and an in terrupt request before the instruction in <1> is complete, the execution result of the instru ction in <1> may not be stored in a register. instruction <1> ? ld instruction: ld.b, ld.h, ld.w, ld.bu, ld.hu ? sld instruction: sld.b, sl d.h, sld.w, sld.bu, sld.hu ? multiplication instruction: mul, mulh, mulhi, mulu instruction <2> mov reg1, reg2 satadd reg1, reg2 and reg1, reg2 add reg1, reg2 mulh reg1, reg2 not reg1, reg2 satadd imm5, reg2 tst reg1, reg2 add imm5, reg2 shr imm5, reg2 satsubr reg1, reg2 or reg1, reg2 subr reg1, reg2 cmp reg1, reg2 sar imm5, reg2 satsub reg1, reg2 xor reg1, reg2 sub reg1, reg2 cmp imm5, reg2 shl imm5, reg2 ld.w [r11], r10 if the decode operation of the mo v instruction immediately before the sld instruction and an interrupt reques t conflict before execution of the ld instruction is complete, the executio n result of instruction may not be stored in a register. mov r10, r28 sld.w 0x28, r10 (b) countermeasure <1> when compiler (ca850) is used use ca850 ver. 2.61 or later because generation of the corresponding instruction sequence can be automatically suppressed. <2> countermeasure by assembler when executing the sld instruction immediately afte r instruction , avoid the above operation using either of the following methods. ? insert a nop instruction immediat ely before the sld instruction. ? do not use the same register as the sld instruction destination regist er in the above instruction executed immediately befor e the sld instruction. ? ? ?
user?s manual u19201ej3v0ud 133 chapter 4 port functions 4.1 features 4.1.1 v850e/sj3-h i/o ports: 128 ? 5 v tolerant/n-ch open-drain output switch able: 60 (ports 0, 3 to 6, 8, 9) input/output specifiable in 1-bit units 4.1.2 v850e/sk3-h i/o ports: 156 ? 5 v tolerant/n-ch open-drain output switchab le: 78 (ports 0, 2 to 6, 8, 9, 15) input/output specifiable in 1-bit units
chapter 4 port functions user?s manual u19201ej3v0ud 134 4.2 basic port configuration 4.2.1 v850e/sj3-h the v850e/sj3-h features a total of 128 i/o ports consisting of ports 0, 1, 3 to 9, cd, cm, cs, ct, dh, and dl. the port configuration is shown below. figure 4-1. port configuration diagram p00 p06 pcd0 pcd3 pcm0 pcm5 pcs0 pcs7 pct0 pct7 pdh0 pdh7 pdl0 pdl15 p30 p39 p40 p42 p50 p55 p60 p615 p10 p11 p80 p81 p70 p715 p90 p915 port 0 port cd port cm port cs port ct port 9 port dh port dl port 3 port 1 port 4 port 5 port 6 port 7 port 8 caution ports 0, 3 to 6, 8, and 9 are 5 v tolerant. table 4-1. i/o buffer power supplies for pins power supply corresponding pins av ref0 port 7 av ref1 port 1 bv dd ports cd, cm, cs, ct, dh, dl ev dd reset, ports 0, 3 to 6, 8, 9
chapter 4 port functions user?s manual u19201ej3v0ud 135 4.2.2 v850e/sk3-h the v850e/sk3-h features a total of 156 i/o ports consisting of ports 0 to 9, 13 to 15, cd, cm, cs, ct, dh, and dl. the port configuration is shown below. figure 4-2. port configuration diagram p00 p06 pcd0 pcd3 pcm0 pcm5 pcs0 pcs7 pct0 pct7 p140 p145 p130 p133 pdh0 pdh7 pdl0 pdl15 p30 p312 p40 p45 p50 p57 p60 p615 p10 p11 p70 p715 p80 p85 p150 p153 p90 p915 p20 p21 port 0 port cd port cm port cs port ct port 9 port dh port dl port 3 port 1 port 4 port 5 port 6 port 7 port 8 port 2 port 13 port 14 port 15 caution ports 0, 2 to 6, 8, 9, and 15 are 5 v tolerant. table 4-2. i/o buffer power supplies for pins power supply corresponding pins av ref0 port 7 av ref1 port 1 bv dd ports 13, 14, cd, cm, cs, ct, dh, dl ev dd reset, ports 0, 2 to 6, 8, 9, 15
chapter 4 port functions user?s manual u19201ej3v0ud 136 4.3 port configuration table 4-3. port configuration (v850e/sj3-h) item configuration control register port n mode register (pmn: n = 0, 1, 3 to 9, cd, cm, cs, ct, dh, dl) port n mode control register (pmcn: n = 0, 3 to 6, 8, 9, cd, cm, cs, ct, dh, dl) port n function control register (pfcn: n = 0, 3 to 6, 8, 9, cd) port n function control expansion register (pfcen: n = 0 note , 3, 5, 6, 8, 9) port n function register (pfn: n = 0, 3 to 6, 8, 9) ports i/o: 128 note the pfce0 register is not included in the pd70f3931, 70f3932, and 70f3933. table 4-4. port configuration (v850e/sk3-h) item configuration control register port n mode register (pmn: n = 0 to 9, 13 to 15, cd, cm, cs, ct, dh, dl) port n mode control register (pmcn: n = 0, 2 to 6, 8, 9, 15, cd, cm, cs, ct, dh, dl) port n function control register (pfcn: n = 0, 3 to 6, 8, 9, cd) port n function control expansion register (pfcen: n = 0, 3, 5, 6, 8, 9) port n function register (pfn: n = 0, 2 to 6, 8, 9, 15) ports i/o: 156 (1) port n register (pn) data is input from or output to an external device by writing or reading the pn register. the pn register consists of a port latch that holds output data, and a circ uit that reads the status of pins. each bit of the pn register corresponds to one pin of port n, and can be read or written in 1-bit units. pn7 outputs 0. outputs 1. pnm 0 1 control of output data (in output mode) pn6 pn5 pn4 pn3 pn2 pn1 pn0 0 1 2 3 7 5 6 7 pn after reset: 00h (output latch) r/w data is written to or read from the pn register as follows, regardless of the setting of the pmcn register. table 4-5. writing/reading pn register setting of pmn register writing to pn register reading from pn register output mode (pmnm = 0) data is written to the output latch note . in the port mode (pmcn = 0), the contents of the output latch are output from the pins. the value of the output latch is read. input mode (pmnm = 1) data is written to the output latch. the pin status is not affected note . the pin status is read. note the value written to the output latch is retained until a new value is written to the output latch.
chapter 4 port functions user?s manual u19201ej3v0ud 137 (2) port n mode register (pmn) the pmn register specifies the input or output mode of the corresponding port pin. each bit of this register corresponds to one pin of port n, and the input or output mo de can be specified in 1-bit units. pmn7 output mode input mode pmnm 0 1 control of input/output mode pmn6 pmn5 pmn4 pmn3 pmn2 pmn1 pmn0 pmn after reset: ffh r/w (3) port n mode control register (pmcn) the pmcn register specifies the port mode or alternate function. each bit of this register corresponds to one pin of port n, and the mode of the por t can be specified in 1-bit units. port mode alternate function mode pmcnm 0 1 specification of operation mode pmcn7 pmcn6 pmcn5 pmcn4 pmcn3 pmcn2 pmcn1 pmcn0 pmcn after reset: 00h r/w
chapter 4 port functions user?s manual u19201ej3v0ud 138 (4) port n function control register (pfcn) the pfcn register specifies the alternat e function of a port pin to be used if the pin has two alternate functions. each bit of this register corresponds to one pin of port n, and the alternate function of a port pin can be specified in 1-bit units. pfcn7 pfcn6 pfcn5 pfcn4 pfcn3 pfcn2 pfcn1 pfcn0 pfcn after reset: 00h r/w alternate function 1 alternate function 2 pfcnm 0 1 specification of alternate function (5) port n function control expansion register (pfcen) the pfcen register specifies the alte rnate function of a port pin to be used if the pin has three or more alternate functions. each bit of this register corresponds to one pin of port n, and the alternate function of a port pin can be specified in 1-bit units. pfcn7 pfcn6 pfcn5 pfcn4 pfcn3 pfcn2 pfcn1 pfcn0 pfcen7 pfcen6 pfcen5 pfcen4 pfcen3 pfcen2 pfcen1 pfcen0 after reset: 00h r/w pfcen pfcn alternate function 1 alternate function 2 alternate function 3 alternate function 4 pfcenm 0 0 1 1 specification of alternate function pfcnm 0 1 0 1
chapter 4 port functions user?s manual u19201ej3v0ud 139 (6) port n function register (pfn) the pfn register specifies normal output or n-ch open-drain output. each bit of this register corresponds to one pin of por t n, and the output mode of the port pin can be specified in 1-bit units. pfn7 pfn6 pfn5 pfn4 pfn3 pfn2 pfn1 pfn0 normal output (cmos output) n-ch open-drain output pfnm note 0 1 control of normal output/n-ch open-drain output pfn after reset: 00h r/w note the pfnm bit of the pfn register is valid only when the pmnm bit of the pmn register is 0 (when the output mode is specified) in port mode (pmcnm bit = 0). when the pmnm bit is 1 (when the input mode is specified), the set value of the pfn register is invalid.
chapter 4 port functions user?s manual u19201ej3v0ud 140 (7) port setting set a port as illustrated below. figure 4-3. setting of each register and pin function pmcn register output mode input mode pmn register ?0? ?1? ?0? ?1? ?0? ?1? (a) (b) (c) (d) alternate function (when two alternate functions are available) port mode alternate function 1 alternate function 2 pfcn register alternate function (when three or more alternate functions are available) alternate function 1 alternate function 2 alternate function 3 alternate function 4 pfcn register pfcen register pfcenm 0 1 0 1 0 0 1 1 (a) (b) (c) (d) pfcnm remark set the alternate functions in the following sequence. <1> set the pfcn and pfcen registers. <2> set the pfcn register. <3> set the intrn or intfn register (to specify an external interrupt pin). if the pmcn register is set first, an unintende d function may be set while the pfcn and pfcen registers are being set.
chapter 4 port functions user?s manual u19201ej3v0ud 141 4.3.1 port 0 port 0 is a 7-bit port for which i/o settings can be controlled in 1-bit units. port 0 includes the following alternate-function pins. table 4-6. port 0 alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type p00 6 6 tip61/top61/sda04 note 1 i/o note 3 p01 7 7 tip60/top60/scl04 note 1 i/o note 3 p02 17 19 nmi input l-1 p03 18 20 intp0/adtrg input n-1 p04 19 21 intp1 input l-1 p05 20 22 intp2/drst note 2 input aa-1 p06 21 23 intp3 input selectable as n-ch open-drain output l-1 notes 1. the sda04 and scl04 pins are not included in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). 2. the drst pin is for on-chip debugging. if on-chip debugging is not used, fix the p05/intp2/drst pin to low level between when the reset signal of the reset pin is released and when th e ocdm.ocdm0 bit is cleared (0). for details, see 4.6.3 cautions on on-chip debug pins . 3. product other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): u-16 pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h ), and 70f3933 (v850e/sj3-h): u-4 caution the p00 to p06 pins have hysteresis characteris tics in the input mode of the alternate function, but do not have hysteresis characteristics in the port mode. remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24) (1) port 0 register (p0) 0 outputs 0. outputs 1. p0n 0 1 output data control (in output mode) (n = 0 to 6) p0 p06 p05 p04 p03 p02 p01 p00 after reset: 00h (output latch) r/w address: fffff400h
chapter 4 port functions user?s manual u19201ej3v0ud 142 (2) port 0 mode register (pm0) 1 output mode input mode pm0n 0 1 i/o mode control (n = 0 to 6) pm0 pm06 pm05 pm04 pm03 pm02 pm01 pm00 after reset: ffh r/w address: fffff420h (3) port 0 mode control register (pmc0) 0 pmc0 pmc06 pmc05 pmc04 pmc03 pmc02 pmc01 pmc00 i/o port intp3 input pmc06 0 1 specification of p06 pin operation mode i/o port intp2 input pmc05 0 1 specification of p05 pin operation mode i/o port intp1 input pmc04 0 1 specification of p04 pin operation mode i/o port intp0 input/adtrg input pmc03 0 1 specification of p03 pin operation mode i/o port nmi input pmc02 0 1 specification of p02 pin operation mode after reset: 00h r/w address: fffff440h i/o port tip60 input/top60 output/scl04 note i/o pmc01 0 1 specification of p01 pin operation mode i/o port tip61 input/top61 output/sda04 note i/o pmc00 0 1 specification of p00 pin operation mode note the scl04 and sda04 pins are not included in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). caution the p05/intp2/drst pin becomes the drst pin regardless of the value of the pmc05 bit when the ocdm.ocdm0 bit = 1.
chapter 4 port functions user?s manual u19201ej3v0ud 143 (4) port 0 function control register (pfc0) pfc0 after reset: 00h r/w address: fffff460h 0 0 0 0 pfc03 0 pfc01 pfc00 remark for details of alternate function specification, see 4.3.1 (6) port 0 alternate function specifications . (5) port 0 function control expansion re gister (pfce0) (not included in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h).) pfce0 after reset: 00h r/w address: fffff700h 0 0 0 0 0 0 pfce01 pfce00 remark for details of alternate function specification, see 4.3.1 (6) port 0 alternate function specifications . (6) port 0 alternate function specifications. pfc03 specification of p 03 pin alternate function 0 intp0 input 1 adtrg input pfce01 pfc01 specification of p01 pin alternate function 0 0 tip60 input 0 1 top60 output 1 0 scl04 note i/o 1 1 setting prohibited pfce00 pfc00 specification of p00 pin alternate function 0 0 tip61 input 0 1 top61 output 1 0 scl04 note i/o 1 1 setting prohibited note the scl04 and sda04 pins are not included in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h).
chapter 4 port functions user?s manual u19201ej3v0ud 144 (7) port 0 function register (pf0) 0 normal output (cmos output) n-ch open drain output pf0n 0 1 control of normal output or n-ch open-drain output (n = 0 to 6) pf0 pf06 pf05 pf04 pf03 pf02 pf01 pf00 after reset: 00h r/w address: fffffc60h caution to pull up an output pin at ev dd or higher, be sure to set the appropriate pf0n bit to 1.
chapter 4 port functions user?s manual u19201ej3v0ud 145 4.3.2 port 1 port 1 is a 2-bit port for which i/o settings can be controlled in 1-bit units. port 1 includes the following alternate-function pins. table 4-7. port 1 alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type p10 3 3 ano0 output ? a-2 p11 4 4 ano1 output ? a-2 remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24) (1) port 1 register (p1) 0 outputs 0 outputs 1 p1n 0 1 output data control (in output mode) (n = 0, 1) p1 0 0 0 0 0 p11 p10 after reset: 00h (output latch) r/w address: fffff402h caution do not read/write the p1 register during d/a conversion (see 15.4.3 cautions). (2) port 1 mode register (pm1) 1 output mode input mode pm1n 0 1 i/o mode control (n = 0, 1) pm1 1 1 1 1 1 pm11 pm10 after reset: ffh r/w address: fffff422h cautions 1. when using p1n as alternate functions (anon pin output), set the pm1n bit to 1. 2. when using one of the pm10 and pm11 pins as an i/o port and the other as a d/a output pin, do so in an appl ication where the port i/o le vel does not change during d/a output.
chapter 4 port functions user?s manual u19201ej3v0ud 146 4.3.3 port 2 (v850e/sk3-h only) port 2 is a 2-bit port for which i/o setti ngs can be controlled in 1-bit units. port 2 includes the following alternate-function pins. table 4-8. port 2 alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type p20 ? 8 sda04 i/o e-3 p21 ? 9 scl04 i/o n-ch open-drain output selectable e-3 caution the p20 and p21 pins have hysteresis characte ristics in the input mode of the alternate-function pin, but do not have the hysteresis characteristics in the port mode. remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24) (1) port 2 register (p2) 0 outputs 0. outputs 1. p2n 0 1 output data control (in output mode) (n = 0, 1) p2 0 0 0 0 0 p21 p20 after reset: 00h (output latch) r/w address: fffff404h (2) port 2 mode register (pm2) 1 output mode input mode pm2n 0 1 i/o mode control (n = 0, 1) pm2 1 1 1 1 1 pm21 pm20 after reset: ffh r/w address: fffff424h
chapter 4 port functions user?s manual u19201ej3v0ud 147 (3) port 2 mode control register (pmc2) 0 pmc2 0 0 0 0 0 pmc21 pmc20 i/o port scl04 i/o pmc21 0 1 specification of p21 pin operation mode i/o port sda04 i/o pmc20 0 1 specification of p20 pin operation mode after reset: 00h r/w address: fffff444h (4) port 2 function register (pf2) pf2 after reset: 00h r/w address: fffffc64h 0 0 0 0 0 0 pf21 pf20 normal output (cmos output) n-ch open-drain output pf2n 0 1 control of normal output or n-ch open-drain output (n = 0, 1) caution to pull up an output pin at ev dd or higher, be sure to set th e appropriate pf2n bit to 1.
chapter 4 port functions user?s manual u19201ej3v0ud 148 4.3.4 port 3 port 3 is a 10-bit (v850e/sj3-h) or 13-bit (v850e/sk3-h) port for which i/o settings can be controlled in 1-bit units. port 3 includes the following alternate-function pins. table 4-9. port 3 alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type p30 25 30 txda0/sob4 output g-2 p31 26 31 rxda0/intp7/sib4 input n-3 p32 27 32 ascka0/sckb4/tip00/top00 i/o u-1 p33 28 33 tip01/top01/ctxd1 note 2 i/o u-2 p34 29 34 tip10/top10/crxd1 note 2 i/o u-3 p35 30 35 tip11/top11 i/o u-4 p36 31 36 ctxd0 note 3 /ietx0 output g-2 p37 32 37 crxd0 note 3 /ierx0 input g-3 p38 35 40 txda2/sda00/sib2 i/o u-17 p39 36 41 rxda2/scl00/sckb2 i/o u-18 p310 note 1 ? 42 sob2 note 1 output u-19 p311 note 1 ? 43 txda2 note 1 output e-2 p312 note 1 ? 44 rxda2 note 1 input selectable as n-ch open-drain output e-1 notes 1. v850e/sk3-h only 2. can controller (2-channel) version only 3. can controller version only caution the p31 to p35, p37 to p39, and p312 pins have hysteresis characteristi cs in the input mode of the alternate-function pin, but do not have th e hysteresis characteristics in the port mode. remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 4 port functions user?s manual u19201ej3v0ud 149 (1) port 3 register (p3) outputs 0. outputs 1. p3n 0 1 output data control (in output mode) p3 (p3h) after reset: 0000h (output latch) r/w address: p3 fffff406h, p3l fffff406h, p3h fffff407h 0 0 0 p312 note p311 note p310 note p39 p38 p37 p36 p35 p34 p33 p32 p31 p30 8 9 10 11 12 13 14 15 (p3l) note valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/s j3-h. however, the read value becomes undefined. caution be sure to clea r bits 13 to 15 to ?0?. remarks 1. the p3 register can be read or written in 16-bit units. however, when using the higher 8 bits of the p3 register as the p3h register and the lower 8 bits as the p3l register, p3 can be read or written in 8-bit or 1-bit units. 2. to read/write bits 8 to 15 of the p3 register in 8-bit or 1-bit units, specify them as bits 0 to 7 of the p3h register. 3. v850e/sj3-h: n = 0 to 9 v850e/sk3-h: n = 0 to 12
chapter 4 port functions user?s manual u19201ej3v0ud 150 (2) port 3 mode register (pm3) 1 output mode input mode pm3n 0 1 i/o mode control 1 1 pm312 note pm311 note pm310 note pm39 pm38 pm37 pm36 pm35 pm34 pm33 pm32 pm31 pm30 after reset: ffffh r/w address: pm3 fffff426h, pm3l fffff426h, pm3h fffff427h 8 9 10 11 12 13 14 15 pm3 (pm3h) (pm3l) note valid for the v850e/sk3-h only. be sure to set this bi t to 1 in the v850e/sj3-h. caution be sure to set bits 13 to 15 to ?1?. remarks 1. the pm3 register can be read or written in 16-bit units. however, when using the higher 8 bits of t he pm3 register as the pm3h register and the lower 8 bits as the pm3l register, pm3 can be read or written in 8-bit or 1-bit units. 2. to read/write bits 8 to 15 of t he pm3 register in 8-bit or 1-bi t units, specify them as bits 0 to 7 of the pm3h register. 3. v850e/sj3-h: n = 0 to 9 v850e/sk3-h: n = 0 to 12
chapter 4 port functions user?s manual u19201ej3v0ud 151 (3) port 3 mode control register (pmc3) (1/2) i/o port rxda2 input/scl00 i/o/sckb2 i/o pmc39 0 1 specification of p39 pin operation mode i/o port txda2 output/sda00 i/o/sib2 input pmc38 0 1 specification of p38 pin operation mode after reset: 0000h r/w address: pmc3 fffff446h, pmc3l fffff446h, pmc3h fffff447h pmc37 pmc36 pmc35 pmc34 pmc33 pmc32 pmc31 pmc30 00 0 pmc312 note 1 pmc311 note 1 pmc310 note 1 pmc39 pmc38 8 9 10 11 12 13 14 15 pmc3 (pmc3h) (pmc3l) i/o port tip11 input/top11 output pmc35 0 1 specification of p35 pin operation mode i/o port crxd0 note 3 input/ierx0 input pmc37 0 1 specification of p37 pin operation mode i/o port ctxd0 note 3 output/ietx0 output pmc36 0 1 specification of p36 pin operation mode i/o port rxda2 note 2 input pmc312 note 1 0 1 specification of p312 pin operation mode i/o port txda2 note 2 output pmc311 note 1 0 1 specification of p311 pin operation mode i/o port sob2 note 2 output pmc310 note 1 0 1 specification of p310 pin operation mode notes 1. valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. 2. v850e/sk3-h only 3. can controller version only caution be sure to clea r bits 13 to 15 to ?0?.
chapter 4 port functions user?s manual u19201ej3v0ud 152 (2/2) i/o port tip10 input/top10 output/crxd1 note input pmc34 0 1 specification of p34 pin operation mode i/o port tip01 input/top01 output/ctxd1 note output pmc33 0 1 specification of p33 pin operation mode i/o port ascka0 input/sckb4 i/o/tip00 input/top00 output pmc32 0 1 specification of p32 pin operation mode i/o port rxda0 input/intp7 input/sib4 input pmc31 0 1 specification of p31 pin operation mode i/o port txda0 output/sob4 output pmc30 0 1 specification of p30 pin operation mode note can controller (2-channel) version only remarks 1. the pmc3 register can be read or written in 16-bit units. however, when using the higher 8 bits of the pmc3 register as the pmc3h register and the lower 8 bits as the pmc3l register, pmc3 can be read or written in 8-bit or 1-bit units. 2. to read/write bits 8 to 15 of the pmc3 register in 8-bit or 1-bit units, specify them as bits 0 to 7 of the pmc3h register.
chapter 4 port functions user?s manual u19201ej3v0ud 153 (4) port 3 function control register (pfc3) after reset: 0000h r/w address: pfc3 fffff466h, pfc3l fffff466h, pfc3l fffff467h 00 00 0 pfc310 note pfc39 pfc38 pfc37 pfc36 pfc35 pfc34 pfc33 pfc32 pfc31 pfc30 8 9 10 11 12 13 14 15 pfc3 (pfc3h) (pfc3l) note valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. caution be sure to clea r bits 11 to 15 to ?0?. remarks 1. for details of alternate function specification, see 4.3.4 (6) port 3 alternate function specifications . 2. the pfc3 register can be read or written in 16-bit units. however, when using the higher 8 bits of the pfc3 register as the pfc3h register and the lower 8 bits as the pfc3l register, pfc3 can be read or written in 8-bit and 1-bit units. 3. to read/write bits 8 to 15 of the pfc3 register in 8-bit or 1-bit units, specify them as bits 0 to 7 of the pfc3h register. (5) port 3 function control expansion register (pfce3) 00 00 0 pfce310 note pfce39 pfce38 0 0 0 pfce34 pfce33 pfce32 0 0 8 9 10 11 12 13 14 15 pfce3 (pfce3h) (pfce3l) after reset: 0000h r/w address: pfce3 fffff706h, pfce3l fffff706h, pfce3h fffff707h note valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. caution be sure to clear bits 0, 1, 5 to 7, and 11 to 15 to ?0?. remark for details of alternate function specification, see 4.3.4 (6) port 3 alternate function specifications .
chapter 4 port functions user?s manual u19201ej3v0ud 154 (6) port 3 alternate function specifications pfce310 pfc310 specification of p310 pin alternate function 1 0 sob2 note 1 output other than above setting prohibited pfce39 pfc39 specification of p39 pin alternate function 0 0 rxda2 input 0 1 scl00 i/o 1 0 sckb2 i/o 1 1 setting prohibited pfce38 pfc38 specification of p38 pin alternate function 0 0 txda2 output 0 1 sda00 i/o 1 0 sib2 input 1 1 setting prohibited pfc37 specification of p37 pin alternate function 0 crxd0 note 2 input 1 ierx0 input pfc36 specification of p36 pin alternate function 0 ctxd0 note 2 output 1 ietx0 output pfc35 specification of p35 pin alternate function 0 tip11 input 1 top11 output notes 1. v850e/sk3-h only 2. can controller version only
chapter 4 port functions user?s manual u19201ej3v0ud 155 pfce34 pfc34 specification of p34 pin alternate function 0 0 tip10 input 0 1 top10 output 1 0 crxd1 note 1 input 1 1 setting prohibited pfce33 pfc33 specification of p33 pin alternate function 0 0 tip01 input 0 1 top01 output 1 0 ctxd1 note 1 output 1 1 setting prohibited pfce32 pfc32 specification of p32 pin alternate function 0 0 ascka0 input 0 1 sckb4 i/o 1 0 tip00 input 1 1 top00 output pfc31 specification of p31 pin alternate function 0 rxda0 input/intp7 note 2 input 1 sib4 input pfc30 specification of p30 pin alternate function 0 txda0 output 1 sob4 output notes 1. can controller (2-channel) version only 2. the intp7 pin and rxda0 pin are alternate-func tion pins. when using the pin as the rxda0 pin, disable edge detection for the intp7 alternat e-function pin. (clear the intf3.intf31 bit and the intr3.intr31 bit to 0.) when using the pin as the intp7 pin, stop uarta0 reception. (clear the ua0ctl0.ua0rxe bit to 0.)
chapter 4 port functions user?s manual u19201ej3v0ud 156 (7) port 3 function register (pf3) after reset: 0000h r/w address: pf3 fffffc66h, pf3l fffffc66h, pf3h fffffc67h pf37 pf36 pf35 pf34 pf33 pf32 pf31 pf30 0 0 0 pf312 note pf311 note pf310 note pf39 pf38 8 9 10 11 12 13 14 15 normal output (cmos output) n-ch open-drain output pf3n 0 1 control of normal output or n-ch open-drain output pf3 (pf3h) (pf3l) note valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. cautions 1. to pull up an output pin at ev dd or higher, be sure to set the appropriate pf3n bit to 1. 2. be sure to clear bits 13 to 15 to ?0?. remarks 1. the pf3 register can be read or written in 16-bit units. however, when using the higher 8 bits of th e pf3 register as the pf3h register and the lower 8 bits as the pf3l register, pf3 can be read or written in 8-bit or 1-bit units. 2. to read/write bits 8 to 15 of th e pf3 register in 8-bit or 1-bi t units, specify them as bits 0 to 7 of the pf3h register. 3. v850e/sj3-h: n = 0 to 9 v850e/sk3-h: n = 0 to 12
chapter 4 port functions user?s manual u19201ej3v0ud 157 4.3.5 port 4 port 4 is a 3-bit (v850e/sj3-h) or 6-bit (v850e/ sk3-h) port that controls i/o in 1-bit units. port 4 includes the following alternate-function pins. table 4-10. port 4 alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type p40 22 24 sib0/sda01 i/o g-5 p41 23 25 sob0/scl01 i/o g-6 p42 24 26 sckb0/intp2 i/o n-4 p43 note ? 27 ? ? c-1 p44 note ? 28 ietx0 note output e-2 p45 note ? 29 ierx0 note input selectable as n-ch open-drain output e-1 note v850e/sk3-h only caution the p40 to p42 and 45 pins have hysteresis character istics in the input mode of the alternate- function pin, but do not have the hyster esis characteristics in the port mode. remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 4 port functions user?s manual u19201ej3v0ud 158 (1) port 4 register (p4) 0 outputs 0. outputs 1. p4n 0 1 output data control (in output mode) p4 0 p45 note p44 note p43 note p42 p41 p40 after reset: 00h (output latch) r/w address: fffff408h note valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/s j3-h. however, the read value becomes undefined. caution be sure to clear bits 6 and 7 to ?0?. remark v850e/sj3-h: n = 0 to 2 v850e/sk3-h: n = 0 to 5 (2) port 4 mode register (pm4) 1 output mode input mode pm4n 0 1 i/o mode control pm4 1 pm45 note pm44 note pm43 note pm42 pm41 pm40 after reset: ffh r/w address: fffff428h note valid for the v850e/sk3-h only. be sure to set this bi t to 1 in the v850e/sj3-h. caution be sure to set bits 6 and 7 to ?1?. remark v850e/sj3-h: n = 0 to 2 v850e/sk3-h: n = 0 to 5
chapter 4 port functions user?s manual u19201ej3v0ud 159 (3) port 4 mode control register (pmc4) 0 pmc4 0 pmc45 note 1 pmc44 note 1 0 pmc42 pmc41 pmc40 i/o port sckb0 i/o/intp2 input pmc42 0 1 specification of p42 pin operation mode i/o port sob0 output/scl01 i/o pmc41 0 1 specification of p41 pin operation mode i/o port sib0 input/sda01 i/o pmc40 0 1 specification of p40 pin operation mode after reset: 00h r/w address: fffff448h i/o port ierx0 note 2 input pmc45 note 1 0 1 specification of p45 pin operation mode i/o port ierx0 note 2 output pmc44 note 1 0 1 specification of p44 pin operation mode notes 1. valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. 2. v850e/sk3-h only caution be sure to clear bi ts 3, 6, and 7 to ?0?.
chapter 4 port functions user?s manual u19201ej3v0ud 160 (4) port 4 function control register (pfc4) pfc4 after reset: 00h r/w address: fffff468h 0 0 0 0 0 pfc42 pfc41 pfc40 sob0 output scl01 i/o pfc41 0 1 specification of p41 pin alternate function sib0 input sda01 i/o pfc40 0 1 specification of p40 pin alternate function sckb0 i/o intp2 input pfc42 0 1 specification of p42 pin alternate function caution be sure to clea r bits 3 to 7 to ?0?. (5) port 4 function register (pf4) 0 normal output (cmos output) n-ch open-drain output pf4n 0 1 control of normal output or n-ch open-drain output pf4 0 pf45 note pf44 note pf43 note pf42 pf41 pf40 after reset: 00h r/w address: fffffc68h note valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. cautions 1. to pull up an output pin at ev dd or higher, be sure to set the appropriate pf4n bit to 1. 2. be sure to clear bits 6 and 7 to ?0?. remark v850e/sj3-h: n = 0 to 2 v850e/sk3-h: n = 0 to 5
chapter 4 port functions user?s manual u19201ej3v0ud 161 4.3.6 port 5 port 5 is a 6-bit (v850e/sj3-h) or 8-bit (v850e/ sk3-h) port that controls i/o in 1-bit units. port 5 includes the following alternate-function pins. table 4-11. port 5 alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type p50 37 45 kr0/tiq01/toq01/rtp00 i/o u-5 p51 38 46 intp7/kr1/tiq02/toq02/rtp01 i/o u-20 p52 39 47 kr2/tiq03/toq03/rtp02/ddi note 1 i/o u-6 p53 40 48 sib2/kr3/tiq00/toq00/rtp03/ddo note 1 i/o u-7 p54 41 49 sob2/kr4/rtp04/dck note 1 i/o u-8 p55 42 50 sckb2/kr5/rtp05/dms note 1 i/o u-9 p56 note 2 ? 51 rxda4 note 2 input e-1 p57 note 2 ? 52 txda4 note 2 output selectable as n-ch open-drain output e-2 notes 1. the ddi, ddo, dck, and dms pins are for on-chip debugging. if on-chip debugging is not used, fix the p05/intp2/drst pin to low level between when the reset signal of the reset pin is released and when th e ocdm.ocdm0 bit is cleared (0). for details, see 4.6.3 cautions on on-chip debug pins . 2. v850e/sk3-h only cautions 1. when the power is turned on, the p53 pin may momentarily output an undefined level. 2. the p50 to p56 pins have hysteresis charact eristics in the input mode of the alternate function, but do not have hysteresis characteristics in the port mode. remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 4 port functions user?s manual u19201ej3v0ud 162 (1) port 5 register (p5) p57 note outputs 0. outputs 1. p5n 0 1 output data control (in output mode) p5 p56 note p55 p54 p53 p52 p51 p50 after reset: 00h (output latch) r/w address: fffff40ah note valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/s j3-h. however, the read value becomes undefined. remark v850e/sj3-h: n = 0 to 5 v850e/sk3-h: n = 0 to 7 (2) port 5 mode register (pm5) pm57 note output mode input mode pm5n 0 1 i/o mode control pm5 pm56 note pm55 pm54 pm53 pm52 pm51 pm50 after reset: ffh r/w address: fffff42ah note valid for the v850e/sk3-h only. be sure to set this bi t to 1 in the v850e/sj3-h. remark v850e/sj3-h: n = 0 to 5 v850e/sk3-h: n = 0 to 7
chapter 4 port functions user?s manual u19201ej3v0ud 163 (3) port 5 mode control register (pmc5) pmc57 note 1 pmc5 pmc56 note 1 pmc55 pmc54 pmc53 pmc52 pmc51 pmc50 i/o port sckb2 i/o/kr5 input/rtp05 output pmc55 0 1 specification of p55 pin operation mode i/o port sob2 output/kr4 input/rtp04 output pmc54 0 1 specification of p54 pin operation mode i/o port sib2 input/kr3 input/tiq00 input/toq00 output/rtp03 output pmc53 0 1 specification of p53 pin operation mode i/o port kr2 input/tiq03 input/toq03 output/rtp02 output pmc52 0 1 specification of p52 pin operation mode i/o port intp7 input/kr1 input/tiq02 input/toq02 output/rtp01 output pmc51 0 1 specification of p51 pin operation mode i/o port kr0 input/tiq01 input/toq01 output/rtp00 output pmc50 0 1 specification of p50 pin operation mode after reset: 00h r/w address: fffff44ah i/o port txda4 note 2 output pmc57 note 1 0 1 specification of p57 pin operation mode i/o port rxda4 note 2 input pmc56 note 1 0 1 specification of p56 pin operation mode notes 1. valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. 2. v850e/sk3-h only
chapter 4 port functions user?s manual u19201ej3v0ud 164 (4) port 5 function control register (pfc5) 0 pfc5 0 pfc55 pfc54 pfc53 pfc52 pfc51 pfc50 after reset: 00h r/w address: fffff46ah remark for details of alternate function specification, see 4.3.6 (6) port 5 alternate function specifications . (5) port 5 function control expansion register (pfce5) 0 pfce5 0 pfce55 pfce54 pfce53 pfce52 pfce51 pfce50 after reset: 00h r/w address: fffff70ah remark for details of alternate function specification, see 4.3.6 (6) port 5 alternate function specifications . (6) port 5 alternate function specifications pfce55 pfc55 specification of p55 pin alternate function 0 0 sckb2 i/o 0 1 kr5 input 1 0 setting prohibited 1 1 rtp05 output pfce54 pfc54 specification of p54 pin alternate function 0 0 sob2 output 0 1 kr4 input 1 0 setting prohibited 1 1 rtp04 output
chapter 4 port functions user?s manual u19201ej3v0ud 165 pfce53 pfc53 specification of p53 pin alternate function 0 0 sib2 input 0 1 kr3 note input/tiq00 input 1 0 toq00 output 1 1 rtp03 output pfce52 pfc52 specification of p52 pin alternate function 0 0 setting prohibited 0 1 kr2 note input/tiq03 input 1 0 toq03 input 1 1 rtp02 output pfce51 pfc51 specification of p51 pin alternate function 0 0 intp7 input 0 1 kr1 note input/tiq02 input 1 0 toq02 output 1 1 rtp01 output pfce50 pfc50 specification of p50 pin alternate function 0 0 setting prohibited 0 1 kr0 note input/tiq01 input 1 0 toq01 output 1 1 rtp00 output note the krn pin and tiq0m pin are alternate-function pins. when using the pin as the tiq0m pin, disable krn pin key return detection, which is the al ternate function. (clear the krm.krmn bit to 0.) also, when using the pin as the krn pin, disable tiq0m pin edge detection, which is the alternate function (n = 0 to 3, m = 0 to 3). pin name use as tiq0m pin use as krn pin kr0/tiq01 krm.krm0 bit = 0 tq0ioc1.tq0is3, tq0is2 bits = 00 kr1/tiq02 krm.krm1 bit = 0 tq0ioc1.tq0is5, tq0is4 bits = 00 kr2/tiq03 krm.krm2 bit = 0 tq0ioc1.tq0is7, tq0is6 bits = 00 kr3/tiq00 krm.krm3 bit = 0 tq0ioc1.tq0is1, tq0is0 bits = 00 tq0ioc2.tq0ees1, tq0ees0 bits = 00 tq0ioc2.tq0ets1, tq0ets0 bits = 00
chapter 4 port functions user?s manual u19201ej3v0ud 166 (7) port 5 function register (pf5) pf57 note normal output (cmos output) n-ch open-drain output pf5n 0 1 control of normal output or n-ch open-drain output pf5 pf56 note pf55 pf54 pf53 pf52 pf51 pf50 after reset: 00h r/w address: fffffc6ah note valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. caution to pull up an output pin at ev dd or higher, be sure to set th e appropriate pf5n bit to 1. remark v850e/sj3-h: n = 0 to 5 v850e/sk3-h: n = 0 to 7
chapter 4 port functions user?s manual u19201ej3v0ud 167 4.3.7 port 6 port 6 is a 16-bit port for which i/o settings can be controlled in 1-bit units. port 6 includes the following alternate-function pins. table 4-12. port 6 alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type p60 43 53 rtp10/rxda4/sie0 note 1 i/o note 2 p61 44 54 rtp11/txda4/soe0 note 1 output note 2 p62 45 55 rtp12/scke0 note 1 i/o note 2 p63 46 56 rtp13/sie1 note 1 /kr4 i/o note 2 p64 47 57 rtp14/soe1 note 1 /kr5 i/o note 2 p65 48 58 rtp15/scke1 note 1 /kr2/tiq03/toq03 i/o note 2 p66 49 59 sib5/intp9/kr3/tiq00/toq00 i/o u-26 p67 50 60 sob5/rxda5/sda05 note 1 i/o note 2 p68 51 61 sckb5/txda5/scl05 note 1 i/o note 2 p69 52 62 tip70/top70/tenc70 i/o u-29 p610 53 63 tip71/tenc71 input u-30 p611 54 64 top71/tecr7 i/o u-31 p612 55 65 tip80/top80/tenc80 i/o u-29 p613 56 66 tip81/top81/tenc81 i/o u-29 p614 57 67 sda03/tecr8 i/o u-32 p615 58 68 scl03 i/o selectable as n-ch open-drain output e-3 notes 1. these pins are not included in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). 2. block types differ for each product. ? products other than pd70f3931 (v850e/sj3-h), 70f39 32 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) pin name p60 p61 p62 p63 p64 p65 p67 p68 block type u-21 u-22 u-38 u-23 u-24 u-25 u-27 u-28 ? pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h) pin name p60 p61 p62 p63 p64 p65 p67 p68 block type g-1 g-2 e-2 u-36 u-36 u-37 g-1 g-7 caution the p60 and p62 to p615 pins have hysteresis characteristics in the input mode of the alternate- function pin, but do not have the hyster esis characteristics in the port mode. remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 4 port functions user?s manual u19201ej3v0ud 168 (1) port 6 register (p6) p615 outputs 0. outputs 1. p6n 0 1 output data control (in output mode) (n = 0 to 15) p6 (p6h) (p6l) p614 p613 p612 p611 p610 p69 p68 after reset: 0000h (output latch) r/w address: p6 fffff40ch p6l fffff40ch, p6lh fffff40dh p67 p66 p65 p64 p63 p62 p61 p60 8 9 10 11 12 13 14 15 remarks 1. the p6 register can be read or written in 16-bit units. however, when using the higher 8 bits of the p6 register as the p6h register and the lower 8 bits as the p6l register, p6 can be read or written in 8-bit or 1-bit units. 2. to read/write bits 8 to 15 of the p6 register in 8-bit or 1-bit units, specify them as bits 0 to 7 of the p6h register. (2) port 6 mode register (pm6) pm67 output mode input mode pm6n 0 1 i/o mode control (n = 0 to 15) pm66 pm65 pm64 pm63 pm62 pm61 pm60 after reset: ffffh r/w address: pm6 fffff42ch pm6l fffff42ch, pm6h fffff42dh pm615 pm6 (pm6h) (pm6l) pm614 pm613 pm612 pm611 pm610 pm69 pm68 8 9 10 11 12 13 14 15 remarks 1. the pm6 register can be read or written in 16-bit units. however, when using the higher 8 bits of t he pm6 register as the pm6h register and the lower 8 bits as the pm6l register, pm6 can be read or written in 8-bit or 1-bit units. 2. to read/write bits 8 to 15 of t he pm6 register in 8-bit or 1-bi t units, specify them as bits 0 to 7 of the pm6h register.
chapter 4 port functions user?s manual u19201ej3v0ud 169 (3) port 6 mode control register (pmc6) (1/2) i/o port tip81 input/top81 output/tenc81 input pmc613 0 1 specification of p613 pin operation mode pmc67 pmc66 pmc65 pmc64 pmc63 pmc62 pmc61 pmc60 after reset: 0000h r/w address: pmc6 fffff44ch pmc6l fffff44ch, pmc6h fffff44dh pmc615 pmc6 (pmc6h) (pmc6l) pmc614 pmc613 pmc612 pmc611 pmc610 pmc69 pmc68 8 9 10 11 12 13 14 15 i/o port tip80 input/top80 output/tenc80 input pmc612 0 1 specification of p612 pin operation mode i/o port tip70 input/top70 output/tenc70 input pmc69 0 1 specification of p69 pin operation mode i/o port sckb5 i/o/txda5 output/scl05 note i/o pmc68 0 1 specification of p68 pin operation mode i/o port sob5 output/rxda5 input/sda05 note i/o pmc67 0 1 specification of p67 pin operation mode i/o port top71 output/tecr7 input pmc611 0 1 specification of p611 pin operation mode i/o port scl03 i/o pmc615 0 1 specification of p615 pin operation mode i/o port sda03 i/o/tecr8 input pmc614 0 1 specification of p614 pin operation mode i/o port tip71 input/tenc71 input pmc610 0 1 specification of p610 pin operation mode i/o port sib5 input/intp9 input/kr3 input/tiq00 input/toq00 output pmc66 0 1 specification of p66 pin operation mode i/o port rtp15 output/scke1 note i/o/kr2 input/tiq03 input/toq03 output pmc65 0 1 specification of p65 pin operation mode note not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h).
chapter 4 port functions user?s manual u19201ej3v0ud 170 (2/2) i/o port rtp14 output/soe1 note output/kr5 input pmc64 0 1 specification of p64 pin operation mode i/o port rtp13 output/sie1 note input/kr4 input pmc63 0 1 specification of p63 pin operation mode i/o port rtp12 output/scke0 note i/o pmc62 0 1 specification of p62 pin operation mode i/o port rtp11 output/txda4 output/soe0 note output pmc61 0 1 specification of p61 pin operation mode i/o port rtp10 output/rxda4 input/sie0 note input pmc60 0 1 specification of p60 pin operation mode note not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). remarks 1. the pmc6 register can be read or written in 16-bit units. however, when using the higher 8 bits of the pmc6 register as the pmc6h register and the lower 8 bits as the pmc6l register, pmc6 can be read or written in 8-bit or 1-bit units. 2. to read/write bits 8 to 15 of the pmc6 register in 8-bit or 1-bit units, specify them as bits 0 to 7 of the pmc6h register.
chapter 4 port functions user?s manual u19201ej3v0ud 171 (4) port 6 function control register (pfc6) 0 pfc614 pfc613 pfc612 pfc611 pfc61 0 pfc69 pfc68 pfc67 pfc66 pfc65 pfc64 pfc63 pfc62 note pfc61 pfc60 8 9 10 11 12 13 14 15 pfc6 (pfc6h) (pfc6l) after reset: 0000h r/w address: pfc6 fffff46ch, pfc6l fffff46ch, pfc6h fffff46dh note not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). be sure to clear this bit to 0 in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). caution be sure to clear bit 15 to ?0?. remarks 1. for details of alternate function specification, see 4.3.7 (6) port 6 alternate function specifications . 2. the pfc6 register can be read or written in 16-bit units. however, when using the higher 8 bits of the pfc6 register as the pfc6h register and the lower 8 bits as the pfc6l register, pfc6 c an be read or written in 8-bit or 1-bit units. 3. to read/write bits 8 to 15 of the pfc6 register in 8-bit or 1-bit units, specify them as bits 0 to 7 of the pfc6h register. (5) port 6 function control expansion register (pfce6) 0 pfce614 pfce613 pfce612 pfce611 pfce610 pfce69 pfce68 note pfce67 note pfce66 pfce65 pfce64 pfce63 pfce62 note pfce61 note pfce60 note 8 9 10 11 12 13 14 15 pfce6 (pfce6h) (pfce6l) after reset: 0000h r/w address: pfce6 fffff70ch, pfce6l fffff70ch, pfce6h fffff70dh note not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). be sure to clear this bit to 0 in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). caution be sure to clear bit 15 to ?0?. remark for details of alternate function specification, see 4.3.7 (6) port 6 alternate function specifications .
chapter 4 port functions user?s manual u19201ej3v0ud 172 (6) port 6 alternate function specifications pfce614 pfc614 specification of p614 pin alternate function 0 0 sda03 i/o 0 1 setting prohibited 1 0 tecr8 input 1 1 setting prohibited pfce613 pfc613 specification of p613 pin alternate function 0 0 tip81 input 0 1 top81 output 1 0 tenc81 input 1 1 setting prohibited pfce612 pfc612 specification of p612 pin alternate function 0 0 tip80 input 0 1 top80 output 1 0 tenc80 input 1 1 setting prohibited pfce611 pfc611 specification of p611 pin alternate function 0 0 top71 output 0 1 setting prohibited 1 0 tecr7 input 1 1 setting prohibited pfce610 pfc610 specification of p610 pin alternate function 0 0 tip71 input 0 1 setting prohibited 1 0 tenc71 input 1 1 setting prohibited pfce69 pfc69 specification of p69 pin alternate function 0 0 tip70 input 0 1 top70 output 1 0 tenc70 input 1 1 setting prohibited pfce68 note 1 pfc68 specification of p68 pin alternate function 0 0 sckb5 i/o 0 1 txda5 output 1 0 scl05 note 2 i/o 1 1 setting prohibited
chapter 4 port functions user?s manual u19201ej3v0ud 173 pfce67 note 1 pfc67 specification of p67 pin alternate function 0 0 sob5 output 0 1 rxda5 input 1 0 sda05 note 2 i/o 1 1 setting prohibited pfce66 pfc66 specification of p66 pin alternate function 0 0 sib5 input 0 1 intp9 input 1 0 kr3 note 3 input/tiq00 input 1 1 toq00 output pfce65 pfc65 specification of p65 pin alternate function 0 0 rtp15 output 0 1 scke1 note 2 i/o 1 0 kr2 note 3 input/tiq03 input 1 1 toq03 output pfce64 pfc64 specification of p64 pin alternate function 0 0 rtp14 output 0 1 soe1 note 2 output 1 0 kr5 input 1 1 setting prohibited pfce63 pfc63 specification of p63 pin alternate function 0 0 rtp13 output 0 1 sie1 note 2 input 1 0 kr4 input 1 1 setting prohibited pfce62 note 1 pfc62 note 1 specification of p62 pin alternate function 0 0 rtp12 output 0 1 setting prohibited 1 0 scke0 note 2 i/o 1 1 setting prohibited pfce61 note 1 pfc61 specification of p61 pin alternate function 0 0 rtp11 output 0 1 txda4 output 1 0 soe0 note 2 output 1 1 setting prohibited
chapter 4 port functions user?s manual u19201ej3v0ud 174 pfce60 note 1 pfc60 specification of p60 pin alternate function 0 0 rtp10 output 0 1 rxda4 input 1 0 sie0 note 2 input 1 1 setting prohibited notes 1. valid for other than the pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) only. be sure to clear this bit to 0 in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). 2. not available in the pd70f3931 (v850e/sj3-h), 70f393 2 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) 3. the krn pin and tiq0m pin are alternate-function pins. when using the pin as the tiq0m pin, disable krn pin key return detection, which is the alternate function. (clear the krm.krmn bit to 0.) also, when using the pin as the krn pin, disabl e tiq0m pin edge detection, which is the alternate function (n = 2, 3, m = 0, 3). pin name used as tiq0m pin used as krn pin kr2/tiq03 krm.krm2 bit = 0 tq0ioc1.tq0is7, tq0is6 bits = 00 kr3/tiq00 krm.krm3 bit = 0 tq0ioc1.tq0is1, tq0is0 bits = 00 tq0ioc2.tq0ees1, tq0ees0 bits = 00 tq0ioc2.tq0ets1, tq0ets0 bits = 00 (7) port 6 function register (pf6) pf6 (pf6h) (pf6l) after reset: 0000h r/w address: pf6 fffffc6ch pf6l fffffc6ch, pf6h fffffc6dh pf67 pf66 pf65 pf64 pf63 pf62 pf61 pf60 pf615 pf614 pf613 pf612 pf611 pf610 pf69 pf68 8 9 10 11 12 13 14 15 normal output (cmos output) n-ch open-drain output pf6n 0 1 normal output/n-ch open-drain output control (n = 0 to 15) caution to pull up an output pin at ev dd or higher, be sure to set the appropriate pf6n bit to 1. remarks 1. the pf6 register can be read or written in 16-bit units. however, when using the higher 8 bits of the pf6 register as the pf6h register and the lower 8 bits as the pf6l register, pf6 can be read or written in 8-bit and 1-bit units. 2. to read/write bits 8 to 15 of th e pf6 register in 8-bit or 1-bi t units, specify them as bits 0 to 7 of the pf6h register.
chapter 4 port functions user?s manual u19201ej3v0ud 175 4.3.8 port 7 port 7 is a 16-bit port for which i/o settings can be controlled in 1-bit units. port 7 includes the following alternate-function pins. table 4-13. port 7 alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type p70 144 176 ani0 input a-1 p71 143 175 ani1 input a-1 p72 142 174 ani2 input a-1 p73 141 173 ani3 input a-1 p74 140 172 ani4 input a-1 p75 139 171 ani5 input a-1 p76 138 170 ani6 input a-1 p77 137 169 ani7 input a-1 p78 136 168 ani8 input a-1 p79 135 167 ani9 input a-1 p710 134 166 ani10 input a-1 p711 133 165 ani11 input a-1 p712 132 164 ani12 input a-1 p713 131 163 ani13 input a-1 p714 130 162 ani14 input a-1 p715 129 161 ani15 input ? a-1 remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 4 port functions user?s manual u19201ej3v0ud 176 (1) port 7 register h, port 7 register l (p7h, p7l) outputs 0. outputs 1. p7n 0 1 output data control (in output mode) (n = 0 to 15) p7h p7l after reset: 00h (output latch) r/w address: p7l fffff40eh, p7h fffff40fh p77 p76 p75 p74 p73 p72 p71 p70 p715 p714 p713 p712 p711 p710 p79 p78 caution do not read/write the p7h and p7l registers during a/d conversion (see 13.6 (4) alternate i/o). remark these registers cannot be accessed in 16-bit units as the p7 register. they can be read or written in 8-bit or 1-bit units as the p7h and p7l registers. (2) port 7 mode register h, port 7 mode register l (pm7h, pm7l) pm715 output mode input mode pm7n 0 1 i/o mode control (n = 0 to 15) pm7h pm7l pm714 pm713 pm712 pm711 pm710 pm79 pm78 pm77 pm76 pm75 pm74 pm73 pm72 pm71 pm70 after reset: ffh r/w address: pm7l fffff42eh, pm7h fffff42fh caution when using the p7n pin as its alternate function (anin pin), set the pm7n bit to 1. remark these registers cannot be accessed in 16-bit units as the pm7 register. they can be read or written in 8-bit or 1-bit units as the pm7h and pm7l registers.
chapter 4 port functions user?s manual u19201ej3v0ud 177 4.3.9 port 8 port 8 is a 2-bit (v850e/sj3-h) or 6-bit (v850e/sk3-h) port for which i/o settings can be controlled in 1-bit units. port 8 includes the following alternate-function pins. table 4-14. port 8 alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type p80 59 71 rxda3/intp8/rc1ck1hz i/o u-33 p81 60 72 txda3/rc1cko/rc1ckdiv output u-34 p82 note ? 73 sda05 note i/o e-3 p83 note ? 74 scl05 note i/o e-3 p84 note ? 75 rxda5 note input e-1 p85 note ? 76 txda5 note output selectable as n-ch open-drain output e-2 note v850e/sk3-h only. caution the p80 and p82 to p84 pins have hysteresis characteristics in the input mode of the alternate- function pin, but do not have the hyster esis characteristics in the port mode. remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24) (1) port 8 register (p8) 0 outputs 0. outputs 1. p8n 0 1 output data control p8 0 p85 note p84 note p83 note p82 note p81 p80 after reset: 00h (output latch) r/w address: fffff410h note valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/s j3-h. however, the read value becomes undefined. caution be sure to clear bits 6 and 7 to ?0?. remark v850e/sj3-h: n = 0, 1 v850e/sk3-h: n = 0 to 5
chapter 4 port functions user?s manual u19201ej3v0ud 178 (2) port 8 mode register (pm8) 1 output mode input mode pm8n 0 1 i/o mode control pm8 1 pm85 note pm84 note pm83 note pm82 note pm81 pm80 after reset: ffh r/w address: fffff430h note valid for the v850e/sk3-h only. be sure to set this bi t to 1 in the v850e/sj3-h. caution be sure to set bits 6 and 7 to ?1?. remark v850e/sj3-h: n = 0, 1 v850e/sk3-h: n = 0 to 5
chapter 4 port functions user?s manual u19201ej3v0ud 179 (3) port 8 mode control register (pmc8) 0 pmc8 0 pmc85 note 1 pmc84 note 1 pmc83 note 1 pmc82 note 1 pmc81 pmc80 i/o port txda3 output/rc1cko output/rc1ckdiv output pmc81 0 1 specification of p81 pin operation mode i/o port rxda3 input/intp8 note 3 input/rc1ck1hz output pmc80 0 1 specification of p80 pin operation mode i/o port txda5 note 2 output pmc85 note 1 0 1 specification of p85 pin operation mode i/o port rxda5 note 2 input pmc84 note 1 0 1 specification of p84 pin operation mode after reset: 00h r/w r/w address: fffff450h i/o port scl05 note 2 i/o pmc83 note 1 0 1 specification of p83 pin operation mode i/o port sda05 note 2 i/o pmc82 note 1 0 1 specification of p82 pin operation mode notes 1. valid for the v850e/sk3-h only. be sure to set this bi t to 0 in the v850e/sj3-h. 2. v850e/sk3-h only 3. the intp8 and rxda3 pins are alternate-f unction pins. when using the rxda3 pin, disable detection of the edge of the intp8 pi n (intf8.intf80 bit = 0 and intr8.intr80 bit = 0). when using the intp8 pin, stop the reception operation of uarta3 (ua3ctl0.ua3rxe bit = 0). caution be sure to clear bits 6 and 7 to ?0?.
chapter 4 port functions user?s manual u19201ej3v0ud 180 (4) port 8 function control register (pfc8) 0 pfc8 0 0 0 0 0 pfc81 pfc80 after reset: 00h r/w address: fffff470h remark for details of alternate function specification, see 4.3.9 (6) port 8 alternate function specifications . (5) port 8 function contro l expansion register (pfce8) 0 pfce8 0 0 0 0 0 pfce81 pfce80 after reset: 00h r/w address: fffff710h remark for details of alternate function specification, see 4.3.9 (6) port 8 alternate function specifications . (6) port 8 alternate f unction specifications pfce81 pfc81 specification of p81 pin alternate function 0 0 txda3 output 0 1 setting prohibited 1 0 rc1cko output /rc1ckdiv output 1 1 setting prohibited pfce80 pfc80 specification of p80 pin alternate function 0 0 rxda3 input /intp8 input 0 1 setting prohibited 1 0 rc1ck1hz output 1 1 setting prohibited
chapter 4 port functions user?s manual u19201ej3v0ud 181 (7) port 8 function register (pf8) 0 normal output (cmos output) n-ch open-drain output pf8n 0 1 control of normal output or n-ch open-drain output pf8 0 pf85 note pf84 note pf83 note pf82 note pf81 pf80 after reset: 00h r/w address: fffffc70h note valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. cautions 1. to pull up an output pin at ev dd or higher, be sure to set the appropriate pf8n bit to 1. 2. be sure to clear bits 6 and 7 to ?0?. remark v850e/sj3-h: n = 0, 1 v850e/sk3-h: n = 0 to 5
chapter 4 port functions user?s manual u19201ej3v0ud 182 4.3.10 port 9 port 9 is a 16-bit port for which i/o settings can be controlled in 1-bit units. port 9 includes the following alternate-function pins. table 4-15. port 9 alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type p90 61 77 a0/kr6/txda1/sda02 i/o u-10 p91 62 78 a1/kr7/rxda1/scl02 i/o u-11 p92 63 79 a2/tip41/top41 i/o u-12 p93 64 80 a3/tip40/top40/intp8 i/o u-35 p94 65 81 a4/tip31/top31 i/o u-12 p95 66 82 a5/tip30/top30/intp5 i/o u-35 p96 67 83 a6/tip21/top21 i/o u-13 p97 68 84 a7/sib1/tip20/top20 i/o u-14 p98 69 85 a8/sob1 output g-2 p99 70 86 a9/sckb1 i/o g-4 p910 71 87 a10/sib3 i/o g-1 p911 72 88 a11/sob3 output g-2 p912 73 89 a12/sckb3 i/o g-4 p913 74 90 a13/intp4 i/o n-2 p914 75 91 a14/intp5/tip51/top51 i/o u-15 p915 76 92 a15/intp6/tip50/top50 i/o selectable as n-ch open-drain output u-15 caution the p90 to p97, p99, p910, and p912 to p 915 pins have hysteresis char acteristics in the input mode of the alternate-function pin, but do not ha ve the hysteresis characteristics in the port mode. remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 4 port functions user?s manual u19201ej3v0ud 183 (1) port 9 register (p9) p915 outputs 0. outputs 1. p9n 0 1 output data control (in output mode) (n = 0 to 15) p914 p913 p912 p911 p910 p99 p98 after reset: 0000h (output latch) r/w address: p9 fffff412h, p9l fffff412h, p9h fffff413h p97 p96 p95 p94 p93 p92 p91 p90 8 9 10 11 12 13 14 15 p9 (p9h) (p9l) remarks 1. the p9 register can be read or written in 16-bit units. however, when using the higher 8 bits of the p9 register as the p9h register and the lower 8 bits as the p9l register, p9 can be read or written in 8-bit or 1-bit units. 2. to read/write bits 8 to 15 of the p9 register in 8-bit or 1-bit units, specify them as bits 0 to 7 of the p9h register. (2) port 9 mode register (pm9) pm97 output mode input mode pm9n 0 1 i/o mode control (n = 0 to 15) pm96 pm95 pm94 pm93 pm92 pm91 pm90 after reset: ffffh r/w address: pm9 fffff432h, pm9l fffff432h, pm9h fffff433h pm915 pm914 pm913 pm912 pm911 pm910 pm99 pm98 8 9 10 11 12 13 14 15 pm9 (pm9h) (pm9l) remarks 1. the pm9 register can be read or written in 16-bit units. however, when using the higher 8 bits of t he pm9 register as the pm9h register and the lower 8 bits as the pm9l register, pm9 can be read or written in 8-bit and 1-bit units. 2. to read/write bits 8 to 15 of t he pm9 register in 8-bit or 1-bi t units, specify them as bits 0 to 7 of the pm9h register.
chapter 4 port functions user?s manual u19201ej3v0ud 184 (3) port 9 mode control register (pmc9) (1/2) i/o port a15 output/intp6 input/tip50 input/top50 output pmc915 0 1 specification of p915 pin operation mode pmc97 pmc96 pmc95 pmc94 pmc93 pmc92 pmc91 pmc90 after reset: 0000h r/w address: pmc9 fffff452h, pmc9l fffff452h, pmc9h fffff453h pmc915 pmc914 pmc913 pmc912 pmc911 pmc910 pmc99 pmc98 i/o port a14 output/intp5 input/tip51 input/top51 output pmc914 0 1 specification of p914 pin operation mode i/o port a11 output/sob3 output pmc911 0 1 specification of p911 pin operation mode i/o port a10 output/sib3 input pmc910 0 1 specification of p910 pin operation mode i/o port a9 output/sckb1 i/o pmc99 0 1 specification of p99 pin operation mode i/o port a13 output/intp4 input pmc913 0 1 specification of p913 pin operation mode i/o port a12 output/sckb3 i/o pmc912 0 1 specification of p912 pin operation mode 8 9 10 11 12 13 14 15 pmc9 (pmc9h) (pmc9l) remarks 1. the pmc9 register can be read or written in 16-bit units. however, when using the higher 8 bits of the pmc9 register as the pmc9h register and the lower 8 bits as the pmc9l register, pmc9 can be read or written in 8-bit or 1-bit units. 2. to read/write bits 8 to 15 of the pmc9 register in 8-bit or 1-bit units, specify them as bits 0 to 7 of the pmc9h register.
chapter 4 port functions user?s manual u19201ej3v0ud 185 (2/2) i/o port a8 output/sob1 output pmc98 0 1 specification of p98 pin operation mode i/o port a7 output/sib1 input/tip20 input/top20 output pmc97 0 1 specification of p97 pin operation mode i/o port a6 output/tip21 input/top21 output pmc96 0 1 specification of p96 pin operation mode i/o port a5 output/tip30 input/top30 output/intp5 input pmc95 0 1 specification of p95 pin operation mode i/o port a4 output/tip31 input/top31 output pmc94 0 1 specification of p94 pin operation mode i/o port a3 output/tip40 input/top40 output/intp8 input pmc93 0 1 specification of p93 pin operation mode i/o port a2 output/tip41 input/top41 output pmc92 0 1 specification of p92 pin operation mode i/o port a1 output/kr7 input/rxda1 input/kr7 input/scl02 i/o pmc91 0 1 specification of p91 pin operation mode i/o port a0 output/kr6 input/txda1 output/sda02 i/o pmc90 0 1 specification of p90 pin operation mode caution port 9 pins cannot be used as port pins or other alternate-function pins if even one of the a0 to a15 pins is used in the separate bus mode. after setting the pfc9 and pfce9 registers to 0000h, therefore, set all 16 bits of the pmc9 register to ffffh at once. if none of the a0 to a15 pins is u sed in the separate bus mode, port 9 pins can be used as port pins or ot her alternate-function pins.
chapter 4 port functions user?s manual u19201ej3v0ud 186 (4) port 9 function control register (pfc9) caution port 9 pins cannot be used as port pins or ot her alternate-function pins if even one of the a0 to a15 pins is used in the separate bus mode. after setting the pfc9 and pfce9 registers to 0000h, therefore, set all 16 bits of the pmc9 regist er to ffffh at once. if none of the a0 to a15 pins is used in the separate bus mode, po rt 9 pins can be used as port pins or other alternate-function pins. after reset: 0000h r/w address: pfc9 fffff472h, pfc9l fffff472h, pfc9h fffff473h pfc97 pfc96 pfc95 pfc94 pfc93 pfc92 pfc91 pfc90 pfc915 pfc914 pfc913 pfc912 pfc911 pfc910 pfc99 pfc98 8 9 10 11 12 13 14 15 pfc9 (pfc9h) (pfc9l) remarks 1. for details of alternate function specification, see 4.3.10 (6) port 9 alternate function specifications . 2. the pfc9 register can be read or written in 16-bit units. however, when using the higher 8 bits of the pfc9 register as the pfc9h register and the lower 8 bits as the pfc9l register, pfc9 c an be read or written in 8-bit or 1-bit units. 3. to read/write bits 8 to 15 of the pfc9 register in 8-bit or 1-bit units, specify them as bits 0 to 7 of the pfc9h register. (5) port 9 function control expansion register (pfce9) after reset: 0000h r/w address: pfce9 fffff712h, pfce9l fffff712h, pfce9h fffff713h pfce97 pfce96 pfce95 pfce94 pfce93 pfce92 pfce91 pfce90 pfce915 pfce914 0 0 0 0 0 0 8 9 10 11 12 13 14 15 pfce9 (pfce9h) (pfce9l) remarks 1. for details of alternate function specification, see 4.3.10 (6) port 9 alternate function specifications . 2. the pfce9 register can be read or written in 16-bit units. however, when using the higher 8 bits of the pfce9 register as the pfce9h register and the lower 8 bits as the pfce9l register, pf ce9 can be read or written in 8-bit or 1- bit units. 3. to read/write bits 8 to 15 of t he pfce9 register in 8-bit or 1- bit units, specify them as bits 0 to 7 of the pfce9h register.
chapter 4 port functions user?s manual u19201ej3v0ud 187 (6) port 9 alternate function specifications pfce915 pfc915 specification of p915 pin alternate function 0 0 a15 output 0 1 intp6 input 1 0 tip50 input 1 1 top50 output pfce914 pfc914 specification of p914 pin alternate function 0 0 a14 output 0 1 intp5 input 1 0 tip51 input 1 1 top51 output pfc913 specification of p913 pin alternate function 0 a13 output 1 intp4 input pfc912 specification of p912 pin alternate function 0 a12 output 1 sckb3 i/o pfc911 specification of p911 pin alternate function 0 a11 output 1 sob3 output pfc910 specification of p910 pin alternate function 0 a10 output 1 sib3 input pfc99 specification of p99 pin alternate function 0 a9 output 1 sckb1 i/o pfc98 specification of p98 pin alternate function 0 a8 output 1 sob1 output pfce97 pfc97 specification of p97 pin alternate function 0 0 a7 output 0 1 sib1 input 1 0 tip20 input 1 1 top20 output
chapter 4 port functions user?s manual u19201ej3v0ud 188 pfce96 pfc96 specification of p96 pin alternate function 0 0 a6 output 0 1 setting prohibited 1 0 tip21 input 1 1 top21 output pfce95 pfc95 specification of p95 pin alternate function 0 0 a5 output 0 1 tip30 input 1 0 top30 output 1 1 intp5 input pfce94 pfc94 specification of p94 pin alternate function 0 0 a4 output 0 1 tip31 input 1 0 top31 output 1 1 setting prohibited pfce93 pfc93 specification of p93 pin alternate function 0 0 a3 output 0 1 tip40 input 1 0 top40 output 1 1 intp8 input pfce92 pfc92 specification of p92 pin alternate function 0 0 a2 output 0 1 tip41 input 1 0 top41 output 1 1 setting prohibited pfce91 pfc91 specification of p91 pin alternate function 0 0 a1 output 0 1 kr7 input 1 0 rxda1 input/kr7 input note 1 1 scl02 i/o pfce90 pfc90 specification of p90 pin alternate function 0 0 a0 output 0 1 kr6 input 1 0 txda1 output 1 1 sda02 i/o note the rxda1 and kr7 pins must not be used at the same time. when us ing the rxda1 pin, do not use the kr7 pin (clear the krm.krm7 bit to 0). when usi ng the kr7 pin, do not use the rxda1 pin (it is recommended to set the pfc91 bit to 1 and clear the pf ce91 bit to 0). when the pfc91 bit is cleared to 0 and the pfce91 bit is set to 1, clear the ua1ctl0.ua1rxe bit to 0.
chapter 4 port functions user?s manual u19201ej3v0ud 189 (7) port 9 function register (pf9) after reset: 0000h r/w address: pf3 fffffc72h, pf9l fffffc72h, pf9h fffffc73h pf97 pf96 pf95 pf94 pf93 pf92 pf91 pf90 pf915 pf914 pf913 pf912 pf911 pf910 pf99 pf98 normal output (cmos output) n-ch open-drain output pf9n 0 1 control of normal output or n-ch open-drain output (n = 0 to 15) 8 9 10 11 12 13 14 15 pf9 (pf9h) (pf9l) caution to pull up an output pin at ev dd or higher, be sure to set the appropriate pf9n bit to 1. remarks 1. the pf9 register can be read or written in 16-bit units. however, when using the higher 8 bits of th e pf9 register as the pf9h register and the lower 8 bits as the pf9l register, pf9 can be read or written in 8-bit or 1-bit units. 2. to read/write bits 8 to 15 of th e pf9 register in 8-bit or 1-bi t units, specify them as bits 0 to 7 of the pf9h register.
chapter 4 port functions user?s manual u19201ej3v0ud 190 4.3.11 port 13 (v850e/sk3-h only) port 13 is a 4-bit port for which i/o settings can be controlled in 1-bit units. port 13 includes the following alternate-function pins. table 4-16. port 13 alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type p130 ? 125 ? ? b-1 p131 ? 126 ? ? b-1 p132 ? 127 ? ? b-1 p133 ? 128 ? ? ? b-1 remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24) (1) port 13 register (p13) 0 outputs 0. outputs 1. p13n 0 1 output data control (in output mode) (n = 0 to 3) p13 0 0 0 p133 p132 p131 p130 after reset: 00h (output latch) r/w address: fffff41ah caution be sure to clear bits 4 to 7 to ?0?. (2) port 13 mode register (pm13) 1 output mode input mode pm13n 0 1 i/o mode control (n = 0 to 3) pm13 1 1 1 pm133 pm132 pm131 pm130 after reset: ffh r/w address: fffff43ah caution be sure to set bits 4 to 7 to ?1?.
chapter 4 port functions user?s manual u19201ej3v0ud 191 4.3.12 port 14 (v850e/sk3-h only) port 14 is a 6-bit port for which i/o settings can be controlled in 1-bit units. port 14 includes the following alternate-function pins. table 4-17. port 14 alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type p140 ? 155 ? ? b-1 p141 ? 156 ? ? b-1 p142 ? 157 ? ? b-1 p143 ? 158 ? ? b-1 p144 ? 159 ? ? b-1 p145 ? 160 ? ? ? b-1 remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24) (1) port 14 register (p14) 0 outputs 0. outputs 1. p14n 0 1 output data control (in output mode) (n = 0 to 5) p14 0 p145 p144 p143 p142 p141 p140 after reset: 00h (output latch) r/w address: fffff41ch caution be sure to clear bits 6 and 7 to ?0?. (2) port 14 mode register (pm14) 1 output mode input mode pm14n 0 1 i/o mode control (n = 0 to 5) pm14 1 pm145 pm144 pm143 pm142 pm141 pm140 after reset: ffh r/w address: fffff43ch caution be sure to set bits 6 and 7 to ?1?.
chapter 4 port functions user?s manual u19201ej3v0ud 192 4.3.13 port 15 (v850e/sk3-h only) port 15 is a 6-bit port for which i/o settings can be controlled in 1-bit units. port 15 includes the following alternate-function pins. table 4-18. port 15 alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type p150 ? 93 rxda1/kr7 input e-4 p151 ? 94 txda1 output e-2 p152 ? 95 intp9 input l-1 p153 ? 96 intp6 input n-ch open-drain output selectable l-1 caution the p150, p152, and p153 pins have hysteresis ch aracteristics in the input mode of the alternate- function pin, but do not have the hyster esis characteristics in the port mode. remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24) (1) port 15 register (p15) 0 outputs 0. outputs 1. p15n 0 1 output data control (in output mode) (n = 0 to 3) p15 0 0 0 p153 p152 p151 p150 after reset: 00h (output latch) r/w address: fffff41eh caution be sure to clear bits 4 to 7 to ?0?. (2) port 15 mode register (pm15) 1 output mode input mode pm15n 0 1 i/o mode control (n = 0 to 3) pm15 1 1 1 pm153 pm152 pm151 pm150 after reset: ffh r/w address: fffff43eh caution be sure to set bits 4 to 7 to ?1?.
chapter 4 port functions user?s manual u19201ej3v0ud 193 (3) port 15 mode control register (pmc15) 0 pmc15 0 0 0 pmc153 pmc152 pmc151 pmc150 i/o port intp6 input pmc153 0 1 specification of p153 pin operation mode i/o port intp9 input pmc152 0 1 specification of p152 pin operation mode i/o port txda1 output pmc151 0 1 specification of p151 pin operation mode i/o port rxda1 input/kr7 input note pmc150 0 1 specification of p150 pin operation mode after reset: 00h r/w address: fffff45eh note the rxda1 and kr7 pins must not be used at the same time. when using the rxda1 pin, do not use the kr7 pin (clear the krm.krm7 bit to 0). when using the kr7 pin, do not use the rxda1 pin (clear the ua1ctl0.ua1rxe bit to 0). caution be sure to clear bits 4 to 7 to ?0?. (4) port 15 function register (pf15) 0 normal output (cmos output) n-ch open-drain output pf15n 0 1 control of normal output or n-ch open-drain output (n = 0 to 3) pf15 0 0 0 pf153 pf152 pf151 pf150 after reset: 00h r/w address: fffffc7eh cautions 1. to pull up an output pin at ev dd or higher, be sure to set the appropriate pf15n bit to 1. 2. be sure to clear bits 4 to 7 to ?0?.
chapter 4 port functions user?s manual u19201ej3v0ud 194 4.3.14 port cd port cd is a 4-bit port for which i/o setti ngs can be controlled in 1-bit units. port cd includes the following alternate-function pins. table 4-19. port cd alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type pcd0 77 97 rxdb0 input f-1 pcd1 78 98 txdb0 output f-2 pcd2 79 99 rxdb1 input f-1 pcd3 80 100 txdb1 output ? f-2 caution the pcd0 and pcd2 pins have hysteresis ch aracteristics in the input mode of the alternate- function pin, but do not have the hyster esis characteristics in the port mode. remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24) (1) port cd register (pcd) 0 outputs 0. outputs 1. pcdn 0 1 output data control (in output mode) (n = 0 to 3) pcd 0 0 0 pcd3 pcd2 pcd1 pcd0 after reset: 00h (output latch) r/w address: fffff00eh caution be sure to clea r bits 4 to 7 to ?0?. (2) port cd mode register (pmcd) 1 output mode input mode pmcdn 0 1 i/o mode control (n = 0 to 3) pmcd 1 1 1 pmcd3 pmcd2 pmcd1 pmcd0 after reset: ffh r/w address: fffff02eh caution be sure to set bits 4 to 7 to ?1?.
chapter 4 port functions user?s manual u19201ej3v0ud 195 (3) port cd mode control register (pmccd) 0 pmccd 0 0 0 pmccd3 pmccd2 pmccd1 pmccd0 after reset: 00h r/w address: fffff04eh i/o port txdb1 output pmccd3 0 1 specification of pcd3 pin operation mode i/o port rxdb1 input pmccd2 0 1 specification of pcd2 pin operation mode i/o port txdb0 output pmccd1 0 1 specification of pcd1 pin operation mode i/o port rxdb0 input pmccd0 0 1 specification of pcd0 pin operation mode caution be sure to clea r bits 4 to 7 to ?0?. (4) port cd function control register (pfccd) 0 pfccd 0 0 0 pfccd3 pfccd2 pfccd1 pfccd0 after reset: 00h r/w address: fffff04fh setting prohibited txdb0 output pfccd1 0 1 specification of pcd1 pin alternate function setting prohibited rxdb0 input pfccd0 0 1 specification of pcd0 pin alternate function setting prohibited rxdb1 input pfccd2 0 1 specification of pcd2 pin alternate function setting prohibited txdb1 input pfccd3 0 1 specification of pcd3 pin alternate function caution be sure to clea r bits 4 to 7 to ?0?.
chapter 4 port functions user?s manual u19201ej3v0ud 196 4.3.15 port cm port cm is a 6-bit port for which i/o setti ngs can be controlled in 1-bit units. port cm includes the following alternate-function pins. table 4-20. port cm alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type pcm0 85 105 wait input d-1 pcm1 86 106 clkout output d-2 pcm2 87 107 hldak output d-2 pcm3 88 108 hldrq input d-1 pcm4 89 109 ? ? b-1 pcm5 90 110 ? ? ? b-1 remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24) (1) port cm register (pcm) 0 outputs 0. outputs 1. pcmn 0 1 output data control (in output mode) (n = 0 to 5) pcm 0 pcm5 pcm4 pcm3 pcm2 pcm1 pcm0 after reset: 00h (output latch) r/w address: fffff00ch (2) port cm mode register (pmcm) 1 output mode input mode pmcmn 0 1 i/o mode control (n = 0 to 5) pmcm 1 pmcm5 pmcm4 pmcm3 pmcm2 pmcm1 pmcm0 after reset: ffh r/w address: fffff02ch
chapter 4 port functions user?s manual u19201ej3v0ud 197 (3) port cm mode control register (pmccm) 0 pmccm 0 0 0 pmccm3 pmccm2 pmccm1 pmccm0 i/o port hldrq input pmccm3 0 1 specification of pcm3 pin operation mode i/o port hldak output pmccm2 0 1 specification of pcm2 pin operation mode i/o port clkout output pmccm1 0 1 specification of pcm1 pin operation mode i/o port wait input pmccm0 0 1 specification of pcm0 pin operation mode after reset: 00h r/w address: fffff04ch
chapter 4 port functions user?s manual u19201ej3v0ud 198 4.3.16 port cs port cs is an 8-bit port for which i/o se ttings can be controll ed in 1-bit units. port cs includes the following alternate-function pins. table 4-21. port cs alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type pcs0 81 101 ? ? b-1 pcs1 82 102 cs1 output d-2 pcs2 83 103 cs2 output d-2 pcs3 84 104 cs3 output d-2 pcs4 91 111 ? ? b-1 pcs5 92 112 ? ? b-1 pcs6 93 113 ? ? b-1 pcs7 94 114 ? ? ? b-1 remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24) (1) port cs register (pcs) pcs7 outputs 0. outputs 1. pcsn 0 1 output data control (in output mode) (n = 0 to 7) pcs pcs6 pcs5 pcs4 pcs3 pcs2 pcs1 pcs0 after reset: 00h (output latch) r/w address: fffff008h (2) port cs mode register (pmcs) pmcs7 output mode input mode pmcsn 0 1 i/o mode control (n = 0 to 7) pmcs pmcs6 pmcs5 pmcs4 pmcs3 pmcs2 pmcs1 pmcs0 after reset: ffh r/w address: fffff028h
chapter 4 port functions user?s manual u19201ej3v0ud 199 (3) port cs mode control register (pmccs) 0 pmccs 0 0 0 pmccs3 pmccs2 pmccs1 0 i/o port cs3 output pmccs3 0 1 specification of pcs3 pin operation mode i/o port cs2 output pmccs2 0 1 specification of pcs2 pin operation mode i/o port cs1 output pmccs1 0 1 specification of pcs1 pin operation mode after reset: 00h r/w address: fffff048h caution be sure to clear bits 0 and 4 to 7 to ?0?.
chapter 4 port functions user?s manual u19201ej3v0ud 200 4.3.17 port ct port ct is an 8-bit port for which i/o setti ngs can be controlled in 1-bit units. port ct includes the following alternate-function pins. table 4-22. port ct alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type pct0 95 115 wr0 output d-2 pct1 96 116 wr1 output d-2 pct2 97 117 ? ? b-1 pct3 98 118 ? ? b-1 pct4 99 119 rd output d-2 pct5 100 120 ? ? b-1 pct6 101 121 astb output d-2 pct7 102 122 ? ? ? b-1 remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24) (1) port ct register (pct) pct7 outputs 0. outputs 1. pctn 0 1 output data control (in output mode) (n = 0 to 7) pct pct6 pct5 pct4 pct3 pct2 pct1 pct0 after reset: 00h (output latch) r/w address: fffff00ah (2) port ct mode register (pmct) pmct7 output mode input mode pmctn 0 1 i/o mode control (n = 0 to 7) pmct pmct6 pmct5 pmct4 pmct3 pmct2 pmct1 pmct0 after reset: ffh r/w address: fffff02ah
chapter 4 port functions user?s manual u19201ej3v0ud 201 (3) port ct mode control register (pmcct) 0 pmcct pmcct6 0 pmcct4 0 0 pmcct1 pmcct0 i/o port astb output pmcct6 0 1 specification of pct6 pin operation mode i/o port rd output pmcct4 0 1 specification of pct4 pin operation mode i/o port wr1 output pmcct1 0 1 specification of pct1 pin operation mode i/o port wr0 output pmcct0 0 1 specification of pct0 pin operation mode after reset: 00h r/w address: fffff04ah
chapter 4 port functions user?s manual u19201ej3v0ud 202 4.3.18 port dh port dh is an 8-bit port for which i/o setti ngs can be controlled in 1-bit units. port dh includes the following alternate-function pins. table 4-23. port dh alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type pdh0 121 145 a16 output d-2 pdh1 122 146 a17 output d-2 pdh2 123 147 a18 output d-2 pdh3 124 148 a19 output d-2 pdh4 125 149 a20 output d-2 pdh5 126 150 a21 output d-2 pdh6 127 151 a22 output d-2 pdh7 128 152 a23 output ? d-2 remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24) (1) port dh register (pdh) outputs 0. outputs 1. pdhn 0 1 output data control (in output mode) (n = 0 to 7) pdh after reset: 00h (output latch) r/w address: fffff006h pdh7 pdh6 pdh5 pdh4 pdh3 pdh2 pdh1 pdh0 (2) port dh mode register (pmdh) pmdh7 output mode input mode pmdhn 0 1 i/o mode control (n = 0 to 7) pmdh6 pmdh5 pmdh4 pmdh3 pmdh2 pmdh1 pmdh0 after reset: ffh r/w address: fffff026h pmdh
chapter 4 port functions user?s manual u19201ej3v0ud 203 (3) port dh mode control register (pmcdh) i/o port am output (address bus output) (m = 16 to 23) pmcdhn 0 1 specification of pdhn pin operation mode (n = 0 to 7) pmcdh7 pmcdh6 pmcdh5 pmcdh4 pmcdh3 pmcdh2 pmcdh1 pmcdh0 after reset: 00h r/w address: fffff046h pmcdh
chapter 4 port functions user?s manual u19201ej3v0ud 204 4.3.19 port dl port dl is a 16-bit port for which i/o se ttings can be controll ed in 1-bit units. port dl includes the following alternate-function pins. table 4-24. port dl alternate-function pins pin no. sj3-h sk3-h pin name gj gm alternate-function pin name i/o remark block type pdl0 105 129 ad0 i/o d-3 pdl1 106 130 ad1 i/o d-3 pdl2 107 131 ad2 i/o d-3 pdl3 108 132 ad3 i/o d-3 pdl4 109 133 ad4 i/o d-3 pdl5 110 134 ad5/flmd1 note i/o d-3 pdl6 111 135 ad6 i/o d-3 pdl7 112 136 ad7 i/o d-3 pdl8 113 137 ad8 i/o d-3 pdl9 114 138 ad9 i/o d-3 pdl10 115 139 ad10 i/o d-3 pdl11 116 140 ad11 i/o d-3 pdl12 117 141 ad12 i/o d-3 pdl13 118 142 ad13 i/o d-3 pdl14 119 143 ad14 i/o d-3 pdl15 120 144 ad15 i/o ? d-3 note since this pin is set in the flash memory progra mming mode, it does not need to be manipulated with the port control register. for details, see chapter 32 flash memory . remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 4 port functions user?s manual u19201ej3v0ud 205 (1) port dl register (pdl) pdl15 outputs 0. outputs 1. pdln 0 1 output data control (in output mode) (n = 0 to 15) pdl14 pdl13 pdl12 pdl11 pdl10 pdl9 pdl8 after reset: 0000h (output latch) r/w address: pdl fffff004h, pdll fffff004h, pdlh fffff005h pdl7 pdl6 pdl5 pdl4 pdl3 pdl2 pdl1 pdl0 8 9 10 11 12 13 14 15 pdl (pdlh) (pdll) remarks 1. the pdl register can be read or written in 16-bit units. however, when using the higher 8 bits of the pdl register as the pdlh register and the lower 8 bits as the pdll register, pdl can be read or written in 8-bit or 1-bit units. 2. to read/write bits 8 to 15 of t he pdl register in 8-bit or 1-bit units, specify them as bits 0 to 7 of the pdlh register. (2) port dl mode register (pmdl) pmdl7 output mode input mode pmdln 0 1 i/o mode control (n = 0 to 15) pmdl6 pmdl5 pmdl4 pmdl3 pmdl2 pmdl1 pmdl0 after reset: ffffh r/w address: pmdl fffff024h, pmdll fffff024h, pmdlh fffff025h pmdl15 pmdl14 pmdl13 pmdl12 pmdl11 pmdl10 pmdl9 pmdl8 8 9 10 11 12 13 14 15 pmdl (pmdlh) (pmdll) remarks 1. the pmdl register can be read or written in 16-bit units. however, when using the higher 8 bits of the pmdl register as the pmdlh register and the lower 8 bits as the pmdll register, pmdl can be read or written in 8-bit or 1-bit units. 2. to read/write bits 8 to 15 of the pmdl register in 8-bit or 1-bit units, specify them as bits 0 to 7 of the pmdlh register.
chapter 4 port functions user?s manual u19201ej3v0ud 206 (3) port dl mode control register (pmcdl) i/o port adn i/o (address/data bus i/o) pmcdln 0 1 specification of pdln pin operation mode (n = 0 to 15) pmcdl7 pmcdl6 pmcdl5 pmcdl4 pmcdl3 pmcdl2 pmcdl1 pmcdl0 after reset: 0000h r/w address: pmcdl fffff044h, pmcdll fffff044h, pmcdlh fffff045h pmcdl15 pmcdl14pmcdl13 pmcdl12 pmcdl11pmcdl10 pmcdl9 pmcdl8 8 9 10 11 12 13 14 15 pmcdl (pmcdlh) (pmcdll) caution when the eximc.smsel bit = 1 (separate mode) and th e bsc.bs30 to bsc.bs00 bits = 0 (8-bit bus width), do not sp ecify the ad8 to ad15 pins. remarks 1. the pmcdl register can be read or written in 16-bit units. however, when using the higher 8 bits of the pmcdl register as the pmcdlh register and the lower 8 bits as the pmcdll register, pmcdl can be read or written in 8-bit or 1- bit units. 2. to read/write bits 8 to 15 of the pmcdl register in 8-bit or 1-bit units, specify them as bits 0 to 7 of the pmcdlh register.
chapter 4 port functions user?s manual u19201ej3v0ud 207 4.4 block diagrams figure 4-4. block diagram of type a-1 rd wr pm pmmn wr port pmn pmn p-ch n-ch address a/d input signal internal bus selector selector
chapter 4 port functions user?s manual u19201ej3v0ud 208 figure 4-5. block diagram of type a-2 rd wr pm pmmn wr port pmn pmn p-ch n-ch address d/a input signal internal bus selector selector figure 4-6. block diagram of type b-1 rd wr pm pmmn wr port pmn pmn address internal bus selector selector
chapter 4 port functions user?s manual u19201ej3v0ud 209 figure 4-7. block diagram of type c-1 rd wr port pmn wr pf pfmn wr pm pmmn pmn ev dd ev ss p-ch n-ch note address internal bus selector selector note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 210 figure 4-8. block diagram of type d-1 wr port pmn wr pm pmmn wr pmc pmcmn rd pmn input signal when alternate function is used internal bus selector selector address
chapter 4 port functions user?s manual u19201ej3v0ud 211 figure 4-9. block diagram of type d-2 wr port pmn wr pm pmmn wr pmc pmcmn rd pmn internal bus selector selector address output signal when alternate function is used selector
chapter 4 port functions user?s manual u19201ej3v0ud 212 figure 4-10. block diagram of type d-3 wr port pmn wr pm pmmn wr pmc pmcmn rd pmn output signal when alternate function is used input signal when alternate function is used output enable signal of address/data bus input enable signal of address/data bus output buffer off signal internal bus selector selector selector selector address
chapter 4 port functions user?s manual u19201ej3v0ud 213 figure 4-11. block diagram of type e-1 rd wr port pmn wr pmc pmcmn wr pf pfmn wr pm pmmn pmn ev dd ev ss p-ch n-ch note input signal when alternate function is used internal bus selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 214 figure 4-12. block diagram of type e-2 rd wr port pmn wr pmc pmcmn wr pf pfmn wr pm pmmn pmn ev dd ev ss p-ch n-ch output signal when alternate function is used internal bus selector selector address selector
chapter 4 port functions user?s manual u19201ej3v0ud 215 figure 4-13. block diagram of type e-3 rd wr pmc pmcmn wr pf pfmn wr pm pmmn wr port pmn pmn ev dd ev ss p-ch n-ch note input signal when alternate function is used selector selector output signal when alternate function is used internal bus selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 216 figure 4-14. block diagram of type e-4 rd wr port pmn wr pmc pmcmn wr pf pfmn wr pm pmmn pmn ev dd ev ss p-ch n-ch input signal 1-2 when alternate function is used input signal 1-1 when alternate function is used note internal bus selector selector address noise elimination note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 217 figure 4-15. block diagram of type f-1 rd wr pmc pmcmn wr pfc pfcmn wr pm pmmn wr port pmn pmn ev dd ev ss p-ch n-ch note input signal when alternate function is used internal bus selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 218 figure 4-16. block diagram of type f-2 rd wr port pmn wr pfc pfcmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch internal bus selector selector address output signal when alternate function is used selector
chapter 4 port functions user?s manual u19201ej3v0ud 219 figure 4-17. block diagram of type g-1 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch note input signal when alternate function is used internal bus selector output signal when alternate function is used selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 220 figure 4-18. block diagram of type g-2 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch output signal 2 when alternate function is used output signal 1 when alternate function is used internal bus selector selector selector selector address
chapter 4 port functions user?s manual u19201ej3v0ud 221 figure 4-19. block diagram of type g-3 address rd wr port pmn wr pmc pmcmn wr pfc pfcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pf pfmn input signal 1 when alternate function is used input signal 2 when alternate function is used note internal bus selector selector selector note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 222 figure 4-20. block diagram of type g-4 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch input signal when alternate function is used output signal when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note internal bus selector selector selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 223 figure 4-21. block diagram of type g-5 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch input signal 1 when alternate function is used input signal 2 when alternate function is used output signal when alternate function is used note internal bus selector selector selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 224 figure 4-22. block diagram of type g-6 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch input signal when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note internal bus selector selector selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 225 figure 4-23. block diagram of type g-7 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd address ev ss p-ch n-ch output enable signal when alternate function is used input signal when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used internal bus selector selector selector selector note note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 226 figure 4-24. block diagram of type l-1 rd wr port pmn wr pmc pmcmn wr intr intrmn note 1 wr intf intfmn note 1 wr pf pfmn wr pm pmmn pmn ev dd ev ss p-ch n-ch input signal 1 when alternate function is used note 2 internal bus selector selector address edge detection noise elimination notes 1. see 24.6 external interrupt request i nput pins (nmi and intp0 to intp9) . 2. hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 227 figure 4-25. block diagram of type n-1 rd wr port pmn wr pmc pmcmn wr intr intrmn note 1 wr intf intfmn note 1 wr pf pfmn wr pm wr pfc pfcmn pmmn pmn ev dd ev ss p-ch n-ch internal bus address input signal 1 when alternate function is used selector selector selector edge detection noise elimination note 2 input signal 2 when alternate function is used notes 1. see 24.6 external interrupt request i nput pins (nmi and intp0 to intp9) . 2. hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 228 figure 4-26. block diagram of type n-2 rd wr port pmn wr pmc pmcmn wr intr intrmn note 1 wr intf intfmn note 1 wr pf pfmn wr pm wr pfc pfcmn pmmn pmn ev dd ev ss p-ch n-ch internal bus address input signal when alternate function is used selector selector selector edge detection noise elimination note 2 output signal when alternate function is used notes 1. see 24.6 external interrupt request i nput pins (nmi and intp0 to intp9) . 2. hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 229 figure 4-27. block diagram of type n-3 rd wr port pmn wr pmc pmcmn wr intr intrmn note 1 wr intf intfmn note 1 wr pf pfmn wr pm wr pfc pfcmn pmmn pmn ev dd ev ss p-ch n-ch internal bus address input signal 1-1 when alternate function is used selector selector selector edge detection noise elimination note 2 input signal 1-2 when alternate function is used input signal 2 when alternate function is used notes 1. see 24.6 external interrupt request i nput pins (nmi and intp0 to intp9) . 2. hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 230 figure 4-28. block diagram of type n-4 rd wr port pmn wr pmc pmcmn wr intr intrmn note 1 wr intf intfmn note 1 wr pf pfmn wr pm wr pfc pfcmn pmmn pmn ev dd ev ss p-ch n-ch internal bus address input signal 1 when alternate function is used selector selector selector edge detection noise elimination note 2 output signal when alternate function is used output signal when alternate function is used selector input signal 2 when alternate function is used notes 1. see 24.6 external interrupt request i nput pins (nmi and intp0 to intp9) . 2. hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 231 figure 4-29. block diagram of type u-1 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 2 when alternate function is used input signal 1 when alternate function is used input signal 3 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used output enable signal when alternate function is used note internal bus selector selector selector selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 232 figure 4-30. block diagram of type u-2 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note internal bus selector selector selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 233 figure 4-31. block diagram of type u-3 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 1 when alternate function is used input signal 2 when alternate function is used output signal when alternate function is used note internal bus selector selector selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 234 figure 4-32. block diagram of type u-4 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch input signal when alternate function is used output signal when alternate function is used note internal bus selector selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 235 figure 4-33. block diagram of type u-5 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 1-1 when alternate function is used input signal 1-2 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note internal bus selector selector selector selector address noise elimination note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 236 figure 4-34. block diagram of type u-6 rd wr port pmn wr pfc pfcmn wr pf pfmn wr ocdm0 ocdm0 wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 1-1 when alternate function is used input signal 1-2 when alternate function is used input signal when on-chip debugging note selector selector selector selector address output signal 2 when alternate function is used output signal 1 when alternate function is used noise elimination internal bus note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 237 figure 4-35. block diagram of type u-7 rd wr port pmn wr pfc pfcmn wr pf pfmn wr ocdm0 ocdm0 wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 1 when alternate function is used input signal 2-1 when alternate function is used input signal when on-chip debugging note selector selector selector selector address output signal 2 when alternate function is used output signal 1 when alternate function is used noise elimination internal bus selector input signal 2-2 when alternate function is used selector note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 238 figure 4-36. block diagram of type u-8 rd wr port pmn wr pfc pfcmn wr pf pfmn wr ocdm0 ocdm0 wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal when alternate function is used input signal when on-chip debugging note selector selector selector selector address output signal 2 when alternate function is used output signal 1 when alternate function is used noise elimination internal bus note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 239 figure 4-37. block diagram of type u-9 rd wr port pmn wr pfc pfcmn wr pf pfmn wr ocdm0 ocdm0 wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 2 when alternate function is used input signal 1 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used output enable signal when alternate function is used note internal bus selector selector selector selector selector address noise elimination input signal when on-chip debugging note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 240 figure 4-38. block diagram of type u-10 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn output signal 2 when alternate function is used output signal 1 when alternate function is used note internal bus selector selector noise elimination input signal 1 when alternate function is used input signal 2 when alternate function is used output signal 3 when alternate function is used selector selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 241 figure 4-39. block diagram of type u-11 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 1 when alternate function is used input signal 2-1 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note internal bus selector selector selector address noise elimination input signal 2-2 when alternate function is used input signal 3 when alternate function is used selector selector noise elimination note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 242 figure 4-40. block diagram of type u-12 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note internal bus selector selector selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 243 figure 4-41. block diagram of type u-13 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note internal bus selector selector selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 244 figure 4-42. block diagram of type u-14 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 1 when alternate function is used input signal 2 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note internal bus selector selector selector selector address selector note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 245 figure 4-43. block diagram of type u-15 rd wr port pmn wr pmc pmcmn wr intr intrmn note 1 wr intf intfmn note 1 wr pf pfmn wr pm wr pfc pfcmn wr pfce pfcemn pmmn pmn ev dd ev ss p-ch n-ch input signal 1 when alternate function is used input signal 2 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note 2 internal bus selector selector selector selector address edge detection noise elimination selector notes 1. see 24.6 external interrupt request i nput pins (nmi and intp0 to intp9) . 2. hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 246 figure 4-44. block diagram of type u-16 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 1 when alternate function is used input signal 2 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note internal bus selector selector selector selector address selector note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 247 figure 4-45. block diagram of type u-17 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 1 when alternate function is used input signal 2 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note internal bus selector selector selector selector address selector note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 248 figure 4-46. block diagram of type u-18 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 2 when alternate function is used input signal 1 when alternate function is used input signal 3 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used output enable signal when alternate function is used note internal bus selector selector selector selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 249 figure 4-47. block diagram of type u-19 rd wr port pmn wr pfc pfcmn wr pfce pfcemn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pf pfmn output signal when alternate function is used internal bus selector selector selector address
chapter 4 port functions user?s manual u19201ej3v0ud 250 figure 4-48. block diagram of type u-20 rd wr port pmn wr pmc pmcmn wr intr intrmn note 1 wr intf intfmn note 1 wr pf pfmn wr pm wr pfc pfcmn wr pfce pfcemn pmmn pmn ev dd ev ss p-ch n-ch input signal 1 when alternate function is used input signal 2-1 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note 2 internal bus selector selector selector selector address edge detection noise elimination selector noise elimination input signal 2-2 when alternate function is used notes 1. see 24.6 external interrupt request i nput pins (nmi and intp0 to intp9) . 2. hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 251 figure 4-49. block diagram of type u-21 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 1 when alternate function is used input signal 2 when alternate function is used output signal when alternate function is used note internal bus selector selector selector address selector note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 252 figure 4-50. block diagram of type u-22 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn output signal 3 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used internal bus selector selector selector selector address
chapter 4 port functions user?s manual u19201ej3v0ud 253 figure 4-51. block diagram of type u-23 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 1 when alternate function is used input signal 2 when alternate function is used output signal when alternate function is used note internal bus selector selector selector address selector noise elimination note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 254 figure 4-52. block diagram of type u-24 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note internal bus selector selector selector selector address noise elimination note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 255 figure 4-53. block diagram of type u-25 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 2-1 when alternate function is used input signal 1 when alternate function is used input signal 2-2 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used output enable signal when alternate function is used note internal bus selector selector selector selector selector address output signal 3 when alternate function is used noise elimination note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 256 figure 4-54. block diagram of type u-26 rd wr port pmn wr pmc pmcmn wr intr intrmn note 1 wr intf intfmn note 1 wr pf pfmn wr pm wr pfc pfcmn wr pfce pfcemn pmmn pmn ev dd ev ss p-ch n-ch input signal 1 when alternate function is used note 2 internal bus selector selector address edge detection noise elimination output signal when alternate function is used input signal 2 when alternate function is used input signal 3-1 when alternate function is used input signal 3-2 when alternate function is used noise elimination selector selector notes 1. see 24.6 external interrupt request i nput pins (nmi and intp0 to intp9) . 2. hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 257 figure 4-55. block diagram of type u-27 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 1 when alternate function is used input signal 2 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note internal bus selector selector selector selector address selector note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 258 figure 4-56. block diagram of type u-28 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 2 when alternate function is used input signal 1 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used output enable signal when alternate function is used note internal bus selector selector selector selector selector address output signal 3 when alternate function is used note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 259 figure 4-57. block diagram of type u-29 rd wr port pmn wr pfc pfcmn wr pfce pfcemn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch input signal 1 when alternate function is used input signal 2 when alternate function is used output signal when alternate function is used note internal bus selector selector selector address selector note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 260 figure 4-58. block diagram of type u-30 rd wr port pmn wr pmc pmcmn wr pfce pfcemn wr pf pfmn wr pm wr pfc pfcmn pmmn pmn ev dd ev ss p-ch n-ch input signal 1 when alternate function is used input signal 2 when alternate function is used note internal bus selector selector address selector note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 261 figure 4-59. block diagram of type u-31 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal when alternate function is used output signal when alternate function is used note internal bus selector selector selector address note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 262 figure 4-60. block diagram of type u-32 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn input signal 1 when alternate function is used input signal 2 when alternate function is used output signal when alternate function is used note internal bus selector selector selector address selector note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 263 figure 4-61. block diagram of type u-33 rd wr port pmn wr pmc pmcmn wr intr intrmn note 1 wr intf intfmn note 1 wr pf pfmn wr pm wr pfc pfcmn wr pfce pfcemn pmmn pmn ev dd ev ss p-ch n-ch input signal 1-1 when alternate function is used input signal 1-2 when alternate function is used output signal when alternate function is used note 2 internal bus selector selector address edge detection noise elimination selector notes 1. see 24.6 external interrupt request i nput pins (nmi and intp0 to intp9) . 2. hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 264 figure 4-62. block diagram of type u-34 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn output signal 2-1 when alternate function is used output signal 1 when alternate function is used internal bus selector selector selector selector address output signal 2-2 when alternate function is used
chapter 4 port functions user?s manual u19201ej3v0ud 265 figure 4-63. block diagram of type u-35 rd wr port pmn wr pmc pmcmn wr intr intrmn note 1 wr intf intfmn note 1 wr pf pfmn wr pm wr pfc pfcmn wr pfce pfcemn pmmn pmn ev dd ev ss p-ch n-ch input signal 1 when alternate function is used input signal 2 when alternate function is used output signal 2 when alternate function is used output signal 1 when alternate function is used note 2 internal bus selector selector selector selector address edge detection noise elimination selector notes 1. see 24.6 external interrupt request i nput pins (nmi and intp0 to intp9) . 2. hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 266 figure 4-64. block diagram of type u-36 wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn rd noise elimination selector selector selector internal bus input signal when alternate function is used output signal when alternate function is used address note note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 267 figure 4-65. block diagram of type u-37 wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn rd noise elimination selector selector selector selector input signal 1-1 when alternate function is used input signal 1-2 when alternate function is used output signal 1 when alternate function is used output signal 2 when alternate function is used address note internal bus note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 268 figure 4-66. block diagram of type u-38 rd wr port pmn wr pfc pfcmn wr pf pfmn wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch wr pfce pfcemn selector selector selector selector input signal when alternate function is used output signal 1 when alternate function is used output enable signal when alternate function is used output signal 2 when alternate function is used address note internal bus note hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 269 figure 4-67. block diagram of type aa-1 rd wr port pmn wr intf intfmn note 1 wr pf pfmn wr ocdm0 ocdm0 wr pmc pmcmn wr pm pmmn pmn ev dd ev ss p-ch n-ch n-ch wr intr intrmn note 1 ev ss input signal when on-chip debugging external reset signal input signal when alternate function is used note 2 internal bus selector selector address edge detection noise elimination notes 1. see 24.6 external interrupt request i nput pins (nmi and intp0 to intp9) . 2. hysteresis characteristics are not available in port mode.
chapter 4 port functions user?s manual u19201ej3v0ud 270 4.5 port register settings when alternate function is used table 4-25 shows the port register settings when each port is used for an alternate function. when using a port pin as an alternate-function pin, refer to the description of each pin.
chapter 4 port functions user?s manual u19201ej3v0ud 271 table 4-25. using port pin as alternate-function pin (1/13) alternate function pin name name i/o pnx bit of pn register pmnx bit of pmn register pmcnx bit of pmcn register pfcenx bit of pfcen register pfcnx bit of pfcn register other bits (registers) tip61 input p00 = setting not required pm00 = setting not required pmc00 = 1 pfce00 = 0 note 3 pfc00 = 0 top61 output p00 = setting not required pm00 = setting not required pmc00 = 1 pfce00 = 0 note 3 pfc00 = 1 p00 sda04 note 2 i/o p00 = setting not required pm00 = setting not required pmc00 = 1 pfce00 = 1 note 3 pfc00 = 0 pf00 (pf0) = 1 tip60 input p01 = setting not required pm01 = setting not required pmc01 = 1 pfce01 = 0 note 3 pfc01 = 0 top60 output p01 = setting not required pm01 = setting not required pmc01 = 1 pfce01 = 0 note 3 pfc01 = 1 p01 scl04 note 2 i/o p01 = setting not required pm01 = setting not required pmc01 = 1 pfce01 = 1 pfc01 = 0 pf01 (pf0) = 1 p02 nmi input p02 = setting not required pm02 = setting not required pmc02 = 1 ? ? intp0 input p03 = setting not required pm03 = setting not required pmc03 = 1 ? pfc03 = 0 p03 adtrg input p03 = setting not required pm03 = setting not required pmc03 = 1 ? pfc03 = 1 p04 intp1 input p04 = setting not required pm04 = setting not required pmc04 = 1 ? ? intp2 input p05 = setting not required pm05 = setting not required pmc05 = 1 ? ? p05 drst input p05 = setting not required pm05 = setting not required pmc05 = setting not required ? ? ocdm0 (ocdm) = 1 p06 intp3 input p06 = setting not required pm06 = setting not required pmc06 = 1 ? ? p10 ano0 output p10 = setting not required pm10 = 1 ? ? ? p11 ano1 output p11 = setting not required pm11 = 1 ? ? ? p20 note 1 sda04 note 1 i/o p20 = setting not required pm20 = setting not required pm20 = 1 ? ? pf20 (pf2) = 1 p21 note 1 scl04 note 1 i/o p21 = setting not required pm21 = setting not required pm21 = 1 ? ? pf21 (pf2) = 1 txda0 output p30 = setting not required pm30 = setting not required pmc30 = 1 ? pfc30 = 0 p30 sob4 output p30 = setting not required pm30 = setting not required pmc30 = 1 ? pfc30 = 1 notes 1. valid for the v850e/sk3-h only. 2. the sda04 and scl04 pins are not included in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h). 3. this setting is valid in products other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h). this setting cannot be specified in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h). caution between the p10 and p11 pins, when one pin is used as the i/o port, and the ot her pin is used as the d/a output pin (an o0, ano1), make sure that the port i/o level does not change during d/a output.
chapter 4 port functions 272 user?s manual u19201ej3v0ud table 4-25. using port pin as alternate-function pin (2/13) alternate function pin name name i/o pnx bit of pn register pmnx bit of pmn register pmcnx bit of pmcn register pfcenx bit of pfcen register pfcnx bit of pfcn register other bits (registers) rxda0 input p31 = setting not required pm31 = setting not required pmc31 = 1 ? note 3 , pfc31 = 0 intp7 input p31 = setting not required pm31 = setting not required pmc31 = 1 ? note 3 , pfc31 = 0 p31 sib4 input p31 = setting not required pm31 = setting not required pmc31 = 1 ? pfc31 = 1 ascka0 input p32 = setting not required pm32 = setting not required pmc32 = 1 pfce32 = 0 pfc32 = 0 sckb4 i/o p32 = setting not required pm32 = setting not required pmc32 = 1 pfce32 = 0 pfc32 = 1 tip00 input p32 = setting not required pm32 = setting not required pmc32 = 1 pfce32 = 1 pfc32 = 0 p32 top00 output p32 = setting not required pm32 = setting not required pmc32 = 1 pfce32 = 1 pfc32 = 1 tip01 input p33 = setting not required pm33 = setting not required pmc33 = 1 pfce33 = 0 pfc33 = 0 top01 output p33 = setting not required pm33 = setting not required pmc33 = 1 pfce33 = 0 pfc33 = 1 p33 ctxd1 note 1 output p33 = setting not required pm33 = setting not required pmc33 = 1 pfce33 = 1 pfc33 = 0 tip10 input p34 = setting not required pm34 = setting not required pmc34 = 1 pfce34 = 0 pfc34 = 0 top10 output p34 = setting not required pm34 = setting not required pmc34 = 1 pfce34 = 0 pfc34 = 1 p34 crxd1 note 1 input p34 = setting not required pm34 = setting not required pmc34 = 1 pfce34 = 1 pfc34 = 0 tip11 input p35 = setting not required pm35 = setting not required pmc35 = 1 ? pfc35 = 0 p35 top11 output p35 = setting not required pm35 = setting not required pmc35 = 1 ? pfc35 = 1 ctxd0 note 2 output p36 = setting not required pm36 = setting not required pmc36 = 1 ? pfc36 = 0 p36 ietx0 output p36 = setting not required pm36 = setting not required pmc36 = 1 ? pfc36 = 1 crxd0 note 2 input p37 = setting not required pm37 = setting not required pmc37 = 1 ? pfc37 = 0 p37 ierx0 input p37 = setting not required pm37 = setting not required pmc37 = 1 ? pfc37 = 1 txda2 output p38 = setting not required pm38 = setting not required pmc38 = 1 pfce38 = 0 pfc38 = 0 sda00 i/o p38 = setting not required pm38 = setting not required pmc38 = 1 pfce38 = 0 pfc38 = 1 pf38 (pf3) = 1 p38 sib2 input p38 = setting not required pm38 = setting not required pmc38 = 1 pfce38 = 1 pfc38 = 0 notes 1. can controller (2-channel) version only 2. can controller version only 3. the intp7 pin and rxda0 pin are alternate-function pins. when us ing the pin as the rxda0 pin, disable edge detection for the intp7 alternate-function pin. (clear the intf3.intf31 bit and the in rt3.intr31 bit to 0.) when using the pin as the intp7 pin, stop uarta0 reception. (clear the ua0ctl0.ua0rxe bit to 0.)
chapter 4 port functions user?s manual u19201ej3v0ud 273 table 4-25. using port pin as alternate-function pin (3/13) alternate function pin name name i/o pnx bit of pn register pmnx bit of pmn register pmcnx bit of pmcn register pfcenx bit of pfcen register pfcnx bit of pfcn register other bits (registers) rxda2 input p39 = setting not required pm39 = setting not required pmc39 = 1 pfce39 = 0 pfc39 = 0 scl00 i/o p39 = setting not required pm39 = setting not required pmc39 = 1 pfce39 = 0 pfc39 = 1 pf39 (pf3) = 1 p39 sckb2 i/o p39 = setting not required pm39 = setting not required pmc39 = 1 pfce39 = 1 pfc39 = 0 p310 note sob2 note output p310 = setting not required pm310 = setting not required pmc310 = 1 pfce310 = 1 pfc310 = 0 p311 note txda2 note output p311 = setting not required pm311 = setting not required pmc311 = 1 ? ? p312 note rxda2 note input p312 = setting not required pm312 = setting not required pmc312 = 1 ? ? sib0 input p40 = setting not required pm40 = setting not required pmc40 = 1 ? pfc40 = 0 p40 sda01 i/o p40 = setting not required pm40 = setting not required pmc40 = 1 ? pfc40 = 1 pf40 (pf4) = 1 sob0 output p41 = setting not required pm41 = setting not required pmc41 = 1 ? pfc41 = 0 p41 scl01 i/o p41 = setting not required pm41 = setting not required pmc41 = 1 ? pfc41 = 1 pf41 (pf4) = 1 sckb0 i/o p42 = setting not required pm42 = setting not required pmc42 = 1 ? pfc42 = 0 p42 intp2 input p42 = setting not required pm42 = setting not required pmc42 = 1 ? pfc42 = 1 p44 note ietx0 note output p44 = setting not required pm44 = setting not required pmc44 = 1 ? ? p45 note ierx0 note input p45 = setting not required pm45 = setting not required pmc45 = 1 ? ? kr0 input p50 = setting not required pm50 = setting not required pmc50 = 1 pfce50 = 0 pfc50 = 1 tq0is3, tq0is2 (tq0ioc1) = 00 tiq01 input p50 = setting not required pm50 = setting not required pmc50 = 1 pfce50 = 0 pfc50 = 1 krm0 (krm) = 0 toq01 output p50 = setting not required pm50 = setting not required pmc50 = 1 pfce50 = 1 pfc50 = 0 p50 rtp00 output p50 = setting not required pm50 = setting not required pmc50 = 1 pfce50 = 1 pfc50 = 1 intp7 input p51 = setting not required pm51 = setting not required pmc51 = 1 pfce51 = 0 pfc51 = 0 kr1 input p51 = setting not required pm51 = setting not required pmc51 = 1 pfce51 = 0 pfc51 = 1 tq0is5, tq0is4 (tq0ioc1) = 00 tiq02 input p51 = setting not required pm51 = setting not required pmc51 = 1 pfce51 = 0 pfc51 = 1 krm1 (krm) = 0 toq02 output p51 = setting not required pm51 = setting not required pmc51 = 1 pfce51 = 1 pfc51 = 0 p51 rtp01 output p51 = setting not required pm51 = setting not required pmc51 = 1 pfce51 = 1 pfc51 = 1 note valid for the v850e/sk3-h only.
chapter 4 port functions 274 user?s manual u19201ej3v0ud table 4-25. using port pin as alternate-function pin (4/13) alternate function pin name name i/o pnx bit of pn register pmnx bit of pmn register pmcnx bit of pmcn register pfcenx bit of pfcen register pfcnx bit of pfcn register other bits (registers) kr2 input p52 = setting not required pm52 = setting not required pmc52 = 1 pfce52 = 0 pfc52 = 1 tq0is7, tq0is6 (tq0i0c1) = 00 tiq03 input p52 = setting not required pm52 = setting not required pmc52 = 1 pfce52 = 0 pfc52 = 1 krm2 (krm) = 0 toq03 output p52 = setting not required pm52 = setting not required pmc52 = 1 pfce52 = 1 pfc52 = 0 rtp02 output p52 = setting not required pm52 = setting not required pmc52 = 1 pfce52 = 1 pfc52 = 1 p52 ddi input p52 = setting not required pm52 = setting not required pmc52 = setting not required pfce52 = setting not required pfc52 = setting not required ocdm0 (ocdm) = 1 sib2 input p53 = setting not required pm53 = setting not required pmc53 = 1 pfce53 = 0 pfc53 = 0 kr3 input p53 = setting not required pm53 = setting not required pmc53 = 1 pfce53 = 0 pfc53 = 1 tq0is1, tq0is0 (tq0ioc1) = 00, tq0ees1, tq0ees0 (tq0ioc2) = 00, tq0ets1, tq0ets0 (tq0ioc2) = 00 tiq00 input p53 = setting not required pm53 = setting not required pmc53 = 1 pfce53 = 0 pfc53 = 1 krm3 (krm) = 0 toq00 input p53 = setting not required pm53 = setting not required pmc53 = 1 pfce53 = 1 pfc53 = 0 rtp03 output p53 = setting not required pm53 = setting not required pmc53 = 1 pfce53 = 1 pfc53 = 1 p53 ddo output p53 = setting not required pm53 = setting not required pmc53 = setting not required pfce53 = setting not required pfc53 = setting not required ocdm0 (ocdm) = 1 sob2 output p54 = setting not required pm54 = setting not required pmc54 = 1 pfce54 = 0 pfc54 = 0 kr4 input p54 = setting not required pm54 = setting not required pmc54 = 1 pfce54 = 0 pfc54 = 1 rtp04 output p54 = setting not required pm54 = setting not required pmc54 = 1 pfce54 = 1 pfc54 = 1 p54 dck input p54 = setting not required pm54 = setting not required pmc54 = setting not required pfce54 = setting not required pfc54 = setting not required ocdm0 (ocdm) = 1 sckb2 i/o p55 = setting not required pm55 = setting not required pmc55 = 1 pfce55 = 0 pfc55 = 0 kr5 input p55 = setting not required pm55 = setting not required pmc55 = 1 pfce55 = 0 pfc55 = 1 rtp05 output p55 = setting not required pm55 = setting not required pmc55 = 1 pfce55 = 1 pfc55 = 1 p55 dms input p55 = setting not required pm55 = setting not required pmc55 = setting not required pfce55 = setting not required pfc55 = setting not required ocdm0 (ocdm) = 1 p56 note rxda4 note input p56 = setting not required pm56 = setting not required pmc56 = 1 ? ? p57 note txda4 note output p57 = setting not required pm57 = setting not required pmc57 = 1 ? ? note valid for the v850e/sk3-h only.
chapter 4 port functions user?s manual u19201ej3v0ud 275 table 4-25. using port pin as alternate-function pin (5/13) alternate function pin name name i/o pnx bit of pn register pmnx bit of pmn register pmcnx bit of pmcn register pfcenx bit of pfcen register pfcnx bit of pfcn register other bits (registers) rtp10 output p60 = setting not required pm60 = setting not required pmc60 = 1 pfce60 = 0 note 2 pfc60 = 0 rxda4 input p60 = setting not required pm60 = setting not required pmc60 = 1 pfce60 = 0 note 2 pfc60 = 1 p60 sie0 note 1 input p60 = setting not required pm60 = setting not required pmc60 = 1 pfce60 = 1 note 2 pfc60 = 0 rtp11 output p61 = setting not required pm61 = setting not required pmc61 = 1 pfce61 = 0 note 2 pfc61 = 0 txda4 output p61 = setting not required pm61 = setting not required pmc61 = 1 pfce61 = 0 note 2 pfc61 = 1 p61 soe0 note 1 output p61 = setting not required pm61 = setting not required pmc61 = 1 pfce61 = 1 note 2 pfc61 = 0 note 2 rtp12 output p62 = setting not required pm62 = setting not required pmc62 = 1 pfce62 = 0 note 2 pfc62 = 0 note 2 p62 scke0 note 1 i/o p62 = setting not required pm62 = setting not required pmc62 = 1 pfce62 = 1 pfc62 = 0 rtp13 output p63 = setting not required pm63 = setting not required pmc63 = 1 pfce63 = 0 pfc63 = 0 sie1 note 1 input p63 = setting not required pm63 = setting not required pmc63 = 1 pfce63 = 0 pfc63 = 1 p63 kr4 input p63 = setting not required pm63 = setting not required pmc63 = 1 pfce63 = 1 pfc63 = 0 rtp14 output p64 = setting not required pm64 = setting not required pmc64 = 1 pfce64 = 0 pfc64 = 0 soe1 note 1 output p64 = setting not required pm64 = setting not required pmc64 = 1 pfce64 = 0 pfc64 = 1 p64 kr5 input p64 = setting not required pm64 = setting not required pmc64 = 1 pfce64 = 1 pfc64 = 0 rtp15 output p65 = setting not required pm65 = setting not required pmc65 = 1 pfce65 = 0 pfc65 = 0 scke1 note 1 i/o note 1 p65 = setting not required pm65 = setting not required pmc65 = 1 pfce65 = 0 pfc65 = 1 kr2 input p65 = setting not required pm65 = setting not required pmc65 = 1 pfce65 = 1 pfc65 = 0 tq0is7, tq0is6 (tq0i0c1) = 00 tiq03 input p65 = setting not required pm65 = setting not required pmc65 = 1 pfce65 = 1 pfc65 = 0 krm2 (krm) = 0 p65 toq03 output p65 = setting not required pm65 = setting not required pmc65 = 1 pfce65 = 1 pfc65 = 1 notes 1. these pins are not included in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h). 2. this setting is valid in products other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h). this setting cannot be specified in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h).
chapter 4 port functions 276 user?s manual u19201ej3v0ud table 4-25. using port pin as alternate-function pin (6/13) alternate function pin name name i/o pnx bit of pn register pmnx bit of pmn register pmcnx bit of pmcn register pfcenx bit of pfcen register pfcnx bit of pfcn register other bits (registers) sib5 input p66 = setting not required pm66 = setting not required pmc66 = 1 pfce66 = 0 pfc66 = 0 intp9 input p66 = setting not required pm66 = setting not required pmc66 = 1 pfce66 = 0 pfc66 = 1 kr3 input p66 = setting not required pm66 = setting not required pmc66 = 1 pfce66 = 1 pfc66 = 0 tq0is1, tq0is0 (tq0ioc1) = 00, tq0ees1, tq0ees0 (tq0ioc2) = 00, tq0ets1, tq0ets0 (tq0ioc2) = 00 tiq00 input p66 = setting not required pm66 = setting not required pmc66 = 1 pfce66 = 1 pfc66 = 0 krm3 (krm) = 0 p66 toq00 output p66 = setting not required pm66 = setting not required pmc66 = 1 pfce66 = 1 pfc66 = 1 sob5 output p67 = setting not required pm67 = setting not required pmc67 = 1 pfce67 = 0 note 2 pfc67 = 0 rxda5 input p67 = setting not required pm67 = setting not required pmc67 = 1 pfce67 = 0 note 2 pfc67 = 1 p67 sda05 note 1 i/o p67 = setting not required pm67 = setting not required pmc67 = 1 pfce67 = 1 pfc67 = 0 pf67 (pf6) = 1 sckb5 i/o p68 = setting not required pm68 = setting not required pmc68 = 1 pfce68 = 0 note 2 pfc68 = 0 txda5 output p68 = setting not required pm68 = setting not required pmc68 = 1 pfce68 = 0 note 2 pfc68 = 1 p68 scl05 note 1 i/o p68 = setting not required pm68 = setting not required pmc68 = 1 pfce68 = 1 pfc68 = 0 pf68 (pf6) = 1 tip70 input p69 = setting not required pm69 = setting not required pmc69 = 1 pfce69 = 0 pfc69 = 0 top70 output p69 = setting not required pm69 = setting not required pmc69 = 1 pfce69 = 0 pfc69 = 1 p69 tenc70 input p69 = setting not required pm69 = setting not required pmc69 = 1 pfce69 = 1 pfc69 = 0 tip71 input p610 = setting not required pm610 = setting not required pmc610 = 1 pfce610 = 0 pfc610 = 0 p610 tenc71 input p610 = setting not required pm610 = setting not required pmc610 = 1 pfce610 = 1 pfc610 = 0 top71 output p611 = setting not required pm611 = setting not required pmc611 = 1 pfce611 = 0 pfc611 = 0 p611 tecr7 input p611 = setting not required pm611 = setting not required pmc611 = 1 pfce611 = 1 pfc611 = 0 tip80 input p612 = setting not required pm612 = setting not required pmc612 = 1 pfce612 = 0 pfc612 = 0 top80 output p612 = setting not required pm612 = setting not required pmc612 = 1 pfce612 = 0 pfc612 = 1 p612 tenc80 input p612 = setting not required pm612 = setting not required pmc612 = 1 pfce612 = 1 pfc612 = 0 notes 1. these pins are not included in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h). 2. this setting is valid in products other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h). this setting cannot be specified in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h).
chapter 4 port functions user?s manual u19201ej3v0ud 277 table 4-25. using port pin as alternate-function pin (7/13) alternate function pin name name i/o pnx bit of pn register pmnx bit of pmn register pmcnx bit of pmcn register pfcenx bit of pfcen register pfcnx bit of pfcn register other bits (registers) tip81 input p613 = setting not required pm613 = setting not required pmc613 = 1 pfce613 = 0 pfc613 = 0 top81 output p613 = setting not required pm613 = setting not required pmc613 = 1 pfce613 = 0 pfc613 = 1 p613 tenc81 input p613 = setting not required pm613 = setting not required pmc613 = 1 pfce613 = 1 pfc613 = 0 sda03 i/o p614 = setting not required pm614 = setting not required pmc614 = 1 pfce614 = 0 pfc614 = 0 pf614 (pf6) = 1 p614 tecr8 input p614 = setting not required pm614 = setting not required pmc614 = 1 pfce614 = 1 pfc614 = 0 p615 scl03 i/o p615 = setting not required pm615 = setting not required pmc615 = 1 ? ? pf615 (pf6) = 1 p70 ani0 input p70 = setting not required pm70 = 1 ? ? ? p71 ani1 input p71 = setting not required pm71 = 1 ? ? ? p72 ani2 input p72 = setting not required pm72 = 1 ? ? ? p73 ani3 input p73 = setting not required pm73 = 1 ? ? ? p74 ani4 input p74 = setting not required pm74 = 1 ? ? ? p75 ani5 input p75 = setting not required pm75 = 1 ? ? ? p76 ani6 input p76 = setting not required pm76 = 1 ? ? ? p77 ani7 input p77 = setting not required pm77 = 1 ? ? ? p78 ani8 input p78 = setting not required pm78 = 1 ? ? ? p79 ani9 input p79 = setting not required pm79 = 1 ? ? ? p710 ani10 input p710 = setting not required pm710 = 1 ? ? ? p711 ani11 input p711 = setting not required pm711 = 1 ? ? ? p712 ani12 input p712 = setting not required pm712 = 1 ? ? ? p713 ani13 input p713 = setting not required pm713 = 1 ? ? ? p714 ani14 input p714 = setting not required pm714 = 1 ? ? ? p715 ani15 input p715 = setting not required pm715 = 1 ? ? ?
chapter 4 port functions 278 user?s manual u19201ej3v0ud table 4-25. using port pin as alternate-function pin (8/13) alternate function pin name name i/o pnx bit of pn register pmnx bit of pmn register pmcnx bit of pmcn register pfcenx bit of pfcen register pfcnx bit of pfcn register other bits (registers) rxda3 input p80 = setting not required pm80 = setting not required pmc80 = 1 pfce80 = 0 pfc80 = 0 note 2 intp8 input p80 = setting not required pm80 = setting not required pmc80 = 1 pfce80 = 0 pfc80 = 0 note 2 p80 rc1ck1hz output p80 = setting not required pm80 = setting not required pmc80 = 1 pfce80 = 1 pfc80 = 0 txda3 output p81 = setting not required pm81 = setting not required pmc81 = 1 pfce81 = 0 pfc81 = 0 rc1cko output p81 = setting not required pm81 = setting not required pmc81 = 1 pfce81 = 1 pfc81 = 0 rc1cc3.cloe2 bit = 0 p81 rc1ckdiv output p81 = setting not required pm81 = setting not required pmc81 = 1 pfce81 = 1 pfc81 = 0 rc1cc1.cloe0 bit = 0 p82 note 1 sda05 note 1 i/o p82 = setting not required pm82 = setting not required pmc82 = 1 ? ? pf82 (pf8) = 1 p83 note 1 scl05 note 1 i/o p83 = setting not required pm83 = setting not required pmc83 = 1 ? ? pf83 (pf8) = 1 p84 note 1 rxda5 note 1 input p84 = setting not required pm84 = setting not required pmc84 = 1 ? ? p85 note 1 txda5 note 1 output p85 = setting not required pm85 = setting not required pmc85 = 1 ? ? a0 output p90 = setting not required pm90 = setting not required pmc90 = 1 pfce90 = 0 pfc90 = 0 note 3 kr6 input p90 = setting not required pm90 = setting not required pmc90 = 1 pfce90 = 0 pfc90 = 1 txda1 output p90 = setting not required pm90 = setting not required pmc90 = 1 pfce90 = 1 pfc90 = 0 p90 sda02 i/o p90 = setting not required pm90 = setting not required pmc90 = 1 pfce90 = 1 pfc90 = 1 pf90 (pf9) = 1 notes 1. valid for the v850e/sk3-h only. 2. the intp8 pin and rxda3 pin are alternate-function pins. when using the pin as the rxda3 pin, disable edge detection for the intp8 alternate-function pin. (clear the intf8.intf80 bit and the intr 8.intr80 bit to 0.) when using the pin as the intp8 pin, stop uarta3 reception. (clear the ua3ctl0.ua3rxe bit to 0.) 3. port 9 pins cannot be used as port pins or other alternate-func tion pins if even one of the a0 to a15 pins is used in the sepa rate bus mode. after setting the pfc9 and pfce9 registers to 0000h, therefore, set all 16 bits of the pmc9 register to ffffh at once.
chapter 4 port functions user?s manual u19201ej3v0ud 279 table 4-25. using port pin as alternate-function pin (9/13) alternate function pin name name i/o pnx bit of pn register pmnx bit of pmn register pmcnx bit of pmcn register pfcenx bit of pfcen register pfcnx bit of pfcn register other bits (registers) a1 output p91 = setting not required pm91 = setting not required pmc91 = 1 pfce91 = 0 pfc91 = 0 note 2 kr7 input p91 = setting not required pm91 = setting not required pmc91 = 1 pfce91 = 0 pfc91 = 1 rxda1 note 1 input p91 = setting not required pm91 = setting not required pmc91 = 1 pfce91 = 1 pfc91 = 0 kr7 note 1 input p91 = setting not required pm91 = setting not required pmc91 = 1 pfce91 = 1 pfc91 = 0 p91 scl02 i/o p91 = setting not required pm91 = setting not required pmc91 = 1 pfce91 = 1 pfc91 = 1 pf91 (pf9) = 1 a2 output p92 = setting not required pm92 = setting not required pmc92 = 1 pfce92 = 0 pfc92 = 0 note 2 tip41 input p92 = setting not required pm92 = setting not required pmc92 = 1 pfce92 = 0 pfc92 = 1 p92 top41 output p92 = setting not required pm92 = setting not required pmc92 = 1 pfce92 = 1 pfc92 = 0 a3 output p93 = setting not required pm93 = setting not required pmc93 = 1 pfce93 = 0 pfc93 = 0 note 2 tip40 input p93 = setting not required pm93 = setting not required pmc93 = 1 pfce93 = 0 pfc93 = 1 top40 output p93 = setting not required pm93 = setting not required pmc93 = 1 pfce93 = 1 pfc93 = 0 p93 intp8 input p93 = setting not required pm93 = setting not required pmc93 = 1 pfce93 = 1 pfc93 = 1 a4 output p94 = setting not required pm94 = setting not required pmc94 = 1 pfce94 = 0 pfc94 = 0 note 2 tip31 input p94 = setting not required pm94 = setting not required pmc94 = 1 pfce94 = 0 pfc94 = 1 p94 top31 output p94 = setting not required pm94 = setting not required pmc94 = 1 pfce94 = 1 pfc94 = 0 a5 output p95 = setting not required pm95 = setting not required pmc95 = 1 pfce95 = 0 pfc95 = 0 note 2 tip30 input p95 = setting not required pm95 = setting not required pmc95 = 1 pfce95 = 0 pfc95 = 1 top30 output p95 = setting not required pm95 = setting not required pmc95 = 1 pfce95 = 1 pfc95 = 0 p95 intp5 input p95 = setting not required pm95 = setting not required pmc95 = 1 pfce95 = 1 pfc95 = 1 notes 1. the rxda1 and kr7 pins must not be used at the same time. when using the rxda1 pin, do not use the kr7 pin (clear the krm.krm7 bit to 0). when using the kr7 pin, do not use the rxda1 pin (it is recommended to set the pfc91 bit to 1 and clear the pfce91 bit to 0. when t he pfc91 bit is cleared to 0 and the pfce91 bit is set to one, clear the ua1rxe bit to 0). 2. port 9 pins cannot be used as port pins or other alternate-func tion pins if even one of the a0 to a15 pins is used in the sepa rate bus mode. after setting the pfc9 and pfce9 registers to 0000h, therefore, set all 16 bits of the pmc9 register to ffffh at once.
chapter 4 port functions 280 user?s manual u19201ej3v0ud table 4-25. using port pin as alternate-function pin (10/13) alternate function pin name name i/o pnx bit of pn register pmnx bit of pmn register pmcnx bit of pmcn register pfcenx bit of pfcen register pfcnx bit of pfcn register other bits (registers) a6 output p96 = setting not required pm96 = setting not required pmc96 = 1 pfce96 = 0 pfc96 = 0 note tip21 input p96 = setting not required pm96 = setting not required pmc96 = 1 pfce96 = 1 pfc96 = 0 p96 top21 output p96 = setting not required pm96 = setting not required pmc96 = 1 pfce96 = 1 pfc96 = 1 a7 output p97 = setting not required pm97 = setting not required pmc97 = 1 pfce97 = 0 pfc97 = 0 note sib1 input p97 = setting not required pm97 = setting not required pmc97 = 1 pfce97 = 0 pfc97 = 1 tip20 input p97 = setting not required pm97 = setting not required pmc97 = 1 pfce97 = 1 pfc97 = 0 p97 top20 output p97 = setting not required pm97 = setting not required pmc97 = 1 pfce97 = 1 pfc97 = 1 a8 output p98 = setting not required pm98 = setting not required pmc98 = 1 ? pfc98 = 0 note p98 sob1 output p98 = setting not required pm98 = setting not required pmc98 = 1 ? pfc98 = 1 a9 output p99 = setting not required pm99 = setting not required pmc99 = 1 ? pfc99 = 0 note p99 sckb1 i/o p99 = setting not required pm99 = setting not required pmc99 = 1 ? pfc99 = 1 a10 output p910 = setting not required pm910 = setting not required pmc910 = 1 ? pfc910 = 0 note p910 sib3 input p910 = setting not required pm910 = setting not required pmc910 = 1 ? pfc910 = 1 a11 output p911 = setting not required pm911 = setting not required pmc911 = 1 ? pfc911 = 0 note p911 sob3 output p911 = setting not required pm911 = setting not required pmc911 = 1 ? pfc911 = 1 a12 output p912 = setting not required pm912 = setting not required pmc912 = 1 ? pfc912 = 0 note p912 sckb3 i/o p912 = setting not required pm912 = setting not required pmc912 = 1 ? pfc912 = 1 a13 output p913 = setting not required pm913 = setting not required pmc913 = 1 ? pfc913 = 0 note p913 intp4 input p913 = setting not required pm913 = setting not required pmc913 = 1 ? pfc913 = 1 a14 output p914 = setting not required pm914 = setting not required pmc914 = 1 pfce914 = 0 pfc914 = 0 note intp5 input p914 = setting not required pm914 = setting not required pmc914 = 1 pfce914 = 0 pfc914 = 1 tip51 input p914 = setting not required pm914 = setting not required pmc914 = 1 pfce914 = 1 pfc914 = 0 p914 top51 output p914 = setting not required pm914 = setting not required pmc914 = 1 pfce914 = 1 pfc914 = 1 note port 9 pins cannot be used as port pins or other alternate-function pins if even one of the a0 to a15 pins is used in the sepa rate bus mode. after setting the pfc9 and pfce9 registers to 0000h, therefore, set all 16 bits of the pmc9 register to ffffh at once.
chapter 4 port functions user?s manual u19201ej3v0ud 281 table 4-25. using port pin as alternate-function pin (11/13) alternate function pin name name i/o pnx bit of pn register pmnx bit of pmn register pmcnx bit of pmcn register pfcenx bit of pfcen register pfcnx bit of pfcn register other bits (registers) a15 output p915 = setting not required pm915 = setting not required pmc915 = 1 pfce915 = 0 pfc915 = 0 note 3 intp6 input p915 = setting not required pm915 = setting not required pmc915 = 1 pfce915 = 0 pfc915 = 1 tip50 input p915 = setting not required pm915 = setting not required pmc915 = 1 pfce915 = 1 pfc915 = 0 p915 top50 output p915 = setting not required pm915 = setting not required pmc915 = 1 pfce915 = 1 pfc915 = 1 rxda1 notes 1, 2 input p150 = setting not required pm150 = setting not required pmc150 = 1 ? ? p150 note 1 kr7 notes 1, 2 input p150 = setting not required pm150 = setting not required pmc150 = 1 ? ? p151 note 1 txda1 note 1 output p151 = setting not required pm151 = setting not required pmc151 = 1 ? ? p152 note 1 intp9 note 1 input p152 = setting not required pm152 = setting not required pmc152 = 1 ? ? p153 note 1 intp6 note 1 input p153 = setting not required pm153 = setting not required pmc153 = 1 ? ? pcd0 rxdb0 input pcd0 = setting not required pmcd0 = setting not required pmccd0 = 1 ? pfccd0 = 1 pcd1 txdb0 output pcd1 = setting not required pmcd1 = setting not required pmccd1 = 1 ? pfccd1 = 1 pcd2 rxdb1 input pcd2 = setting not required pmcd2 = setting not required pmccd2 = 1 ? pfccd2 = 1 pcd3 txdb1 output pcd3 = setting not required pmcd3 = setting not required pmccd3 = 1 ? pfccd3 = 1 pcm0 wait input pcm0 = setting not required pmcm0 = setting not required pmccm0 = 1 ? ? pcm1 clkout output pcm1 = setting not required pmcm1 = setting not required pmccm1 = 1 ? ? pcm2 hldak output pcm2 = setting not required pmcm2 = setting not required pmccm2 = 1 ? ? pcm3 hldrq input pcm3 = setting not required pmcm3 = setting not required pmccm3 = 1 ? ? pcs1 cs1 output pcs1 = setting not required pmcs1 = setting not required pmccs1 = 1 ? ? pcs2 cs2 output pcs2 = setting not required pmcs2 = setting not required pmccs2 = 1 ? ? pcs3 cs3 output pcs3 = setting not required pmcs3 = setting not required pmccs3 = 1 ? ? notes 1. v850e/sk3-h only. 2. the rxda1 and kr7 pins must not be used at the same time. when using the rxda1 pin, do not use the kr7 pin (clear the krm.krm7 bit to 0). when using the kr7 pin, do not use the rxda1 pin (clear the ua1ctl0.ua1rxe bit to 0). 3. port 9 pins cannot be used as port pins or other alternate-function pins if even one of the a0 to a15 pins is used in the sepa rate bus mode. after setting the pfc9 and pfce9 registers to 0000h, therefore, set all 16 bits of the pmc9 register to ffffh at once.
chapter 4 port functions 282 user?s manual u19201ej3v0ud table 4-25. using port pin as alternate-function pin (12/13) alternate function pin name name i/o pnx bit of pn register pmnx bit of pmn register pmcnx bit of pmcn register pfcenx bit of pfcen register pfcnx bit of pfcn register other bits (registers) pct0 wr0 output pct0 = setting not required pmct0 = setting not required pmcct0 = 1 ? ? pct1 wr1 output pct1 = setting not required pmct1 = setting not required pmcct1 = 1 ? ? pct4 rd output pct4 = setting not required pmct4 = setting not required pmcct4 = 1 ? ? pct6 astb output pct6 = setting not required pmct6 = setting not required pmcct6 = 1 ? ? pdh0 a16 output pdh0 = setting not required pmdh0 = setting not required pmcdh0 = 1 ? ? pdh1 a17 output pdh1 = setting not required pmdh1 = setting not required pmcdh1 = 1 ? ? pdh2 a18 output pdh2 = setting not required pmdh2 = setting not required pmcdh2 = 1 ? ? pdh3 a19 output pdh3 = setting not required pmdh3 = setting not required pmcdh3 = 1 ? ? pdh4 a20 output pdh4 = setting not required pmdh4 = setting not required pmcdh4 = 1 ? ? pdh5 a21 output pdh5 = setting not required pmdh5 = setting not required pmcdh5 = 1 ? ? pdh6 a22 output pdh6 = setting not required pmdh6 = setting not required pmcdh6 = 1 ? ? pdh7 a23 output pdh7 = setting not required pmdh7 = setting not required pmcdh7 = 1 ? ?
chapter 4 port functions user?s manual u19201ej3v0ud 283 table 4-25. using port pin as alternate-function pin (13/13) alternate function pin name name i/o pnx bit of pn register pmnx bit of pmn register pmcnx bit of pmcn register pfcenx bit of pfcen register pfcnx bit of pfcn register other bits (registers) pdl0 ad0 i/o pdl0 = setting not required pmdl0 = setting not required pmcdl0 = 1 ? ? pdl1 ad1 i/o pdl1 = setting not required pmdl1 = setting not required pmcdl1 = 1 ? ? pdl2 ad2 i/o pdl2 = setting not required pmdl2 = setting not required pmcdl2 = 1 ? ? pdl3 ad3 i/o pdl3 = setting not required pmdl3 = setting not required pmcdl3 = 1 ? ? pdl4 ad4 i/o pdl4 = setting not required pmdl4 = setting not required pmcdl4 = 1 ? ? ad5 i/o pdl5 = setting not required pmdl5 = setting not required pmcdl5 = 1 ? ? pdl5 flmd1 note input pdl5 = setting not required pmdl5 = setting not required pmcdl5 = setting not required ? ? pdl6 ad6 i/o pdl6 = setting not required pmdl6 = setting not required pmcdl6 = 1 ? ? pdl7 ad7 i/o pdl7 = setting not required pmdl7 = setting not required pmcdl7 = 1 ? ? pdl8 ad8 i/o pdl8 = setting not required pmdl8 = setting not required pmcdl8 = 1 ? ? pdl9 ad9 i/o pdl9 = setting not required pmdl9 = setting not required pmcdl9 = 1 ? ? pdl10 ad10 i/o pdl10 = setting not required pmdl10 = setting not required pmcdl10 = 1 ? ? pdl11 ad11 i/o pdl11 = setting not required pmdl11 = setting not required pmcdl11 = 1 ? ? pdl12 ad12 i/o pdl12 = setting not required pmdl12 = setting not required pmcdl12 = 1 ? ? pdl13 ad13 i/o pdl13 = setting not required pmdl13 = setting not required pmcdl13 = 1 ? ? pdl14 ad14 i/o pdl14 = setting not required pmdl14 = setting not required pmcdl14 = 1 ? ? pdl15 ad15 i/o pdl15 = setting not required pmdl15 = setting not required pmcdl15 = 1 ? ? note since this pin is set in the flash memory programming mode , it does not need to be manipulate d with the port control register. for details, see chapter 32 flash memory .
chapter 4 port functions user?s manual u19201ej3v0ud 284 4.6 cautions 4.6.1 cautions on setting port pins (1) in the v850e/sj3-h and v850e/sk3 -h, the general-purpose port function and several peripheral function i/o pin share a pin. to switch between the general-purpo se port (port mode) and the peripheral function i/o pin (alternate-function mode), set by the pmcn register. in regards to this register setting sequence, note with caution the following. (a) cautions on switching from por t mode to alternate-function mode to switch from the port mode to alternat e-function mode in the following order. <1> set the pfn register note : n-ch open-drain setting <2> set the pfcn and pfcen regist ers: alternate-function selection <3> set the corresponding bit of the pmcn regist er to 1: switch to alternate-function mode if the pmcn register is set first, not e with caution that, at that moment or depending on the change of the pin states in accordance with the setting of the pf n, pfcn, and pfcen register s, unexpected operations may occur. a concrete example is shown as example below. note n-ch open-drain output pin only caution regardless of the port mo de/alternate-function mode, the pn register is read and written as follows. ? pn register read: read the port output latc h value (when pmn.pmnm bit = 0), or read the pin states (pmn.pmnm bit = 1). ? pn register write: write to the port output latch [example] scl01 pin setting example the scl01 pin is used alternately with the p41/ sob0 pin. select the valid pin functions with the pmc4, pfc4, and pf4 registers. pmc41 bit pfc41 bit pf41 bit valid pin functions 0 don?t care 1 p41 (in output port mode, n-ch open-drain output) 0 1 sob0 output (n-ch open-drain output) 1 1 1 scl01 i/o (n-ch open-drain output)
chapter 4 port functions user?s manual u19201ej3v0ud 285 the order of setting in which malfunction ma y occur on switching from the p41 pin to the scl01 pin are shown below. setting order setting contents pin states pin level <1> initial value (pmc41 bit = 0, pfc41 bit = 0, pf41 bit = 0) port mode (input) hi-z <2> pmc41 bit 1 sob0 output low level (high level depending on the csib0 setting) <3> pfc41 bit 1 scl01 i/o high level (cmos output) <4> pf41 bit 1 scl01 i/o hi-z (n-ch open-drain output) in <2>, i 2 c communication may be affected since the alternate-function so b0 output is output to the pin. in the cmos output period of <2 > or <3>, unnecessary current may be generated. (b) cautions on alternate-function mode (input) the input signal to the alternate-function block is low level when the pmcn.pmcnm bit is 0 due to the and output of the pmcn register set value and the pin le vel. thus, depending on the port setting and alternate- function operation enable timing, unexpected operations may occur. therefore, switch between the port mode and alternate-function m ode in the following sequence. ? to switch from port mode to alternate-function mode (input) set the pins to the alternate-function mode usi ng the pmcn register and then enable the alternate- function operation. ? to switch from alternate-function mode (input) to port mode stop the alternate-function operation and then switch the pins to the port mode. the concrete examples are show n as example 1 and example 2. [example 1] switch from general-purpose por t (p02) to external interrupt pin (nmi) when the p02/nmi pin is pulled up as shown in figure 4-68 and the rising edge is specified in the nmi pin edge detection setting, even though hi gh level is input continuously to the nmi pin during switching from the p02 pin to the an nmi pin (pmc02 bit = 0 1), this is detected as a rising edge as if the low level changed to high level, and an nmi interrupt occurs. to avoid it, set the nmi pin?s valid edge after switching from the p02 pin to the nmi pin.
chapter 4 port functions user?s manual u19201ej3v0ud 286 figure 4-68. example of switching from p02 to nmi (incorrect) pmc0 nmi interrupt occurrence 76543 2 p02/nmi 3 v 10 0 1 pmc0m bit = 0: port mode pmc0m bit = 1: alternate-function mode rising edge detector pmc02 bit = 0: low level pmc02 bit = 1: high level remark m = 0 to 7 [example 2] switch from external pin (nmi) to general-purpose port (p02) when the p02/nmi pin is pulled up as shown in figure 4-69 and the falling edge is specified in the nmi pin edge detection setting, even though hi gh level is input continuously to the nmi pin at switching from the nmi pin to the p02 pin (pmc02 bit = 1 0), this is detected as falling edge as if high level changed to low level, and nmi interrupt occurs. to avoid this, set the nmi pin edge detection as ?no edge detected? before switching to the p02 pin. figure 4-69. example of switching from nmi to p02 (incorrect) pmc0 76543 2 p02/nmi 3 v 10 nmi interrupt occurrence 1 0 pmc0m bit = 0: port mode pmc0m bit = 1: alternate-function mode falling edge detector pmc02 bit = 1: high level pmc02 bit = 0: low level remark m = 0 to 7 (2) in port mode, the pfn.pfnm bit is valid only in t he output mode (pmn.pmnm bit = 0). in the input mode (pmnm bit = 1), the value of the pfnm bit is not reflected in the buffer.
chapter 4 port functions user?s manual u19201ej3v0ud 287 4.6.2 cautions on bit manipulation instruction for port n register (pn) when a 1-bit manipulation instruction is executed on a port that provides both input and output functions, the value of the output latch of an input port that is not subject to manipulation may be written in addition to the targeted bit. therefore, it is recommended to rewr ite the output latch when switching a port from input mode to output mode. when p90 pin is an output port, p91 to p97 pins are input ports (all pin statuses are high level), and the value of the port latch is 00h, if the output of p90 pi n is changed from low level to high level via a bit manipulation instruction, t he value of the port latch is ffh. explanation: the targets of writ ing to and reading from the pn regi ster of a port whose pmnm bit is 1 are the output latch and pin status, respectively. a bit manipulation instructi on is executed in the followi ng order in the v850e/sj3-h and v850e/sk3-h. <1> the pn register is read in 8-bit units. <2> the targeted one bit is manipulated. <3> the pn register is written in 8-bit units. in step <1>, the value of the out put latch (0) of p90 pin, which is an output port, is read, while the pin statuses of p91 to p97 pins, which are input ports, are read. if the pin statuses of p91 to p97 pins are high level at this time, the read value is feh. the value is changed to ffh by the manipulation in <2>. ffh is written to the output la tch by the manipulation in <3>. figure 4-70. bit manipula tion instruction (p90 pin) low-level output bit manipulation instruction (set1 0, p9l[r0]) is executed for p90 bit. pin status: high level p90 p91 to p97 port 9l latch 00000000 high-level output pin status: high level p90 p91 to p97 port 9l latch 11111111 bit manipulation instruction for p90 bit <1> p9l register is read in 8-bit units. ? in the case of p90, an output port, the value of the port latch (0) is read. ? in the case of p91 to p97, input ports, the pin status (1) is read. <2> set (1) p90 bit. <3> write the results of <2> to the output latch of p9l register in 8-bit units.
chapter 4 port functions user?s manual u19201ej3v0ud 288 4.6.3 cautions on on-chip debug pins the drst, dck, dms, ddi, and ddo pins are on-chip debug pins. after reset by the reset pin, the p05/intp2/drst pin is in itialized to function as an on-chip debug pin (drst). if a high level is input to the drst pin at this time, the on-chip debug mode is set, and the dck, dms, ddi, and ddo pins can be used. the following action must be taken if on-chip debugging is not used. ? clear the ocdm0 bit of the ocdm register (special register) (0) at this time, fix the p05/intp2/drst pin to low level from when reset by the reset pin is released until the above action is taken. if a high level is input to the drst pin before the above action is taken, it may cause a malfunction (cpu deadlock). handle the p05 pin with the utmost care. caution the p05/intp2/drst pin is not initialized to function as an on-chip debug pin (drst) when a reset signal (wdt2res) is generated due to a watc hdog timer overflow, a reset signal (lvires) is generated by the low-voltage detector (lvi), or a reset signal (clmres) is generated by the clock monitor (clm). the ocdm register holds the current value. 4.6.4 cautions on p05/intp2/drst pin the p05/intp2/drst pin has an internal pull-down resistor (30 k typ.). after a reset by the reset pin, a pull- down resistor is connected. the pull-down resistor is disconnected when the ocdm0 bit is cleared (0). 4.6.5 cautions on p53 pin when power is turned on when the power is turned on, the following pins may momentarily output an undefined level. ? p53/sib2/kr3/tiq00/toq00/rtp03/ddo pin 4.6.6 hysteresis characteristics in port mode, the following port pins do not have hysteresis characteristics. p00 to p06 p20 note , p21 note p31 to p35, p37 to p39, p312 note p40 to p42, p45 note p50 to p55, p56 note p60, p62 to p615 p80, p82 to p84 note p90 to p97, p99, p910, p912 to p915 p150 note , p152 note , p153 note pcd0, pcd2 note v850e/sk3-h only
chapter 4 port functions user?s manual u19201ej3v0ud 289 4.6.7 cautions on separate bus mode port 9 pins cannot be used as port pins or other alternate-function pins if even one of the a0 to a15 pins is used in the separate bus mode. after setting the pfc9 and pfce9 registers to 0000h, ther efore, set all 16 bits of the pmc9 register to ffffh at once. if none of the a0 to a15 pins is used in the separate bus mode , port 9 pins can be used as port pins or other alternate-function pins. 4.6.8 cautions on reading port n register s (pn: n = 3 to 5, 8) (v850e/sj3-h only) in the v850e/sj3-h, the bit values of the follo wing port n registers become undefined when read. port 3 register: p310 to p312 port 4 register: p43 to p45 port 5 register: p56, p57 port 8 register: p82 to p85 4.6.9 cautions on setting port n mode c ontrol registers (pmcn: n = 3 to 5, 8) in the v850e/sj3-h, be sure to set the bits of the following port n mode control registers to 0. port 3 mode control register: pmc310 to pmc312 port 4 mode control register: pmc44, pmc45 port 5 mode control register: pmc56, pmc57 port 8 mode control register: pmc82 to pmc85
user?s manual u19201ej3v0ud 290 chapter 5 bus control function the v850e/sj3-h and v850e/sk3-h are provided with an ex ternal bus interface function by which external memories such as rom and ra m, and i/o can be connected. 5.1 features output is selectable from a multiplexed bus with a mi nimum of 3 bus cycles and a separate bus with a minimum of 2 bus cycles. 8-bit/16-bit data bus selectable wait function ? programmable wait function of up to 7 states ? external wait function using wait pin idle state function bus hold function up to about 30 mb of physical memory connectable the bus can be controlled at a different voltage from the operating voltage when bv dd ev dd = v dd . however, set bv dd = ev dd = v dd in the separate bus mode.
chapter 5 bus control function user?s manual u19201ej3v0ud 291 5.2 bus control pins the pins used to connect an external device are listed in the table below. table 5-1. bus control pins (a) when multiplexed bus is selected bus control pin alternate-function pin i/o function ad0 to ad15 pdl0 to pdl15 i/o address/data bus a16 to a23 pdh0 to pdh7 output address bus wait pcm0 input external wait control clkout pcm1 output internal system clock wr0, wr1 pct0, pct1 output write strobe signal rd pct4 output read strobe signal astb pct6 output address strobe signal hldrq pcm3 input hldak pcm2 output bus hold control cs1 to cs3 pcs1 to pcs3 output chip select (b) when separate bus is selected bus control pin alternate-function pin i/o function ad0 to ad15 pdl0 to pdl15 i/o data bus a0 to a15 p90 to p915 output address bus a16 to a23 pdh0 to pdh7 output address bus wait pcm0 input external wait control clkout pcm1 output internal system clock wr0, wr1 pct0, pct1 output write strobe signal rd pct4 output read strobe signal hldrq pcm3 input hldak pcm2 output bus hold control cs1 to cs3 pcs1 to pcs3 output chip select
chapter 5 bus control function user?s manual u19201ej3v0ud 292 5.2.1 pin status when internal ro m, internal ram, on-chip peripheral i/o, or expanded internal ram is accessed when the internal rom, internal ram, on-chip peripheral i/o, or expanded inter nal ram is accessed, the status of each pin is as follows. table 5-2. pin statuses when intern al rom, internal ram, on-chip peri pheral i/o, or expanded internal ram is accessed (a) when internal rom, internal ram , or on-chip peripheral i/o is accessed separate bus mode multiplexed bus mode address bus (a23 to a0) undefined a ddress bus (a23 to a16) undefined address/data bus (ad15 to ad0) high impedance address/data bus (ad15 to ad0) undefined cs1 to cs3 inactive level cs1 to cs3 inactive level control signal rd, wr0, wr1, astb inactive level control signal rd, wr0, wr1, astb inactive level caution when the internal rom is written, as well as when the external memo ry area is accessed, the address bus, address/data bus, and control sign als are activated, but write access is prohibited. (b) when expanded internal ram is accessed separate bus mode multiplexed bus mode address bus (a23 to a0) undefined a ddress bus (a23 to a16) undefined address/data bus (ad15 to ad0) undefined address/data bus (ad15 to ad0) undefined cs1 to cs3 inactive level cs1 to cs3 inactive level control signal rd, wr0, wr1, astb active level control signal rd, wr0, wr1, astb active level caution when the expanded internal ram is accessed, cont rol signals (rd, wr0, wr1, astb) are activated. therefore, accesses to the external memory or extern al i/o must be controlled by the csn signal (n = 1 to 3). 5.2.2 pin status in each operation mode for the pin status of the v850e/sj3-h and v850e/sk3-h in each operation mode, see 2.3 pin states .
chapter 5 bus control function user?s manual u19201ej3v0ud 293 5.3 memory block function the 28 mb external memory space is divided into memory blocks of 4 mb, 4mb, 4mb, and 16 mb, from the lower address, and they can be used as three cs spaces (cs1 , cs2, cs3). the correspondence between the cs1 and cs3 spaces and the memory block can be set by the csc0 and csc1 registers. in addition, the programmable wait function and bus size can be independently controlled for each cs space. if the expanded internal ram is not used, addresses 3e 00000h to 3febfffh can be used as external memory area by setting the csc0 and csc1 registers. therefore, an external memory space of up to about 30 mb can be used.
chapter 5 bus control function user?s manual u19201ej3v0ud 294 figure 5-1. data memory map: physical address (1/2) (a) when using expanded internal ram cs2 cs1, cs3 cs3 use prohibited use prohibited note 1 use prohibited use prohibited external memory area (16 mb) external memory area (28 mb) external memory area (4 mb) external memory area (4 mb) external memory area (4 mb) internal rom area note 4 (4 mb) internal ram area (60 kb) expanded internal ram area (16/32 kb) programmable peripheral i/o area note 2 or use prohibited note 3 on-chip peripheral i/o area (4 kb) internal rom area note 5 03ffffffh 03e00000h 03dfffffh 02000000h 01ffffffh 01000000h 00ffffffh 00c00000h 00bfffffh 00800000h 007fffffh 00400000h 003fffffh 00000000h 003fffffh 00000000h 03ffffffh 03fff000h 03ff0000h 03feffffh 03fef000h 03feefffh 03fec000h 03febfffh 03fe4000h 03fe3fffh 03e00000h 03ffefffh (2 mb) notes 1. use of addresses 03fef000h to 03feffffh is prohibited because these addresses are in the same area as the on-chip peripheral i/o area. 2. only the programmable peripheral i/o area is s een as images of 256 mb each in the 4 gb address space. 3. in the can controller version, addresses 03fec000h to 03fecbffh are assigned as a programmable peripheral i/o area in addre sses 03fec000h to 03feefffh. use of these addresses in a version without a can controller is prohibited. 4. the internal rom area and its mirror area cannot be us ed as the external memory area. in addition, a write access is prohibited. 5. 768/1024/1280/1536 kb (flash memory) (see table 1-1 .)
chapter 5 bus control function user?s manual u19201ej3v0ud 295 figure 5-1. data memory map: physical address (2/2) (b) when not using expanded internal ram cs2 cs1, cs3 cs3 use prohibited use prohibited note 1 use prohibited external memory area (16 mb) external memory area (28 mb) external memory area (4 mb) external memory area (4 mb) external memory area (4 mb) internal rom area note 4 (4 mb) internal ram area (60 kb) programmable peripheral i/o area note 2 or use prohibited note 3 on-chip peripheral i/o area (4 kb) internal rom area note 5 03ffffffh 03e00000h 03dfffffh 02000000h 01ffffffh 01000000h 00ffffffh 00c00000h 00bfffffh 00800000h 007fffffh 00400000h 003fffffh 00000000h 003fffffh 00000000h 03ffffffh 03fff000h 03ff0000h 03feffffh 03fef000h 03feefffh 03fec000h 03febfffh 03e00000h 03ffefffh (2 mb) external memory area (1968 mb) notes 1. use of addresses 03fef000h to 03feffffh is prohibited because these addresses are in the same area as the on-chip peripheral i/o area. 2. only the programmable peripheral i/o area is s een as images of 256 mb each in the 4 gb address space. 3. in the can controller version, addresse s 03fec000h to 03feefffh are assigned as a programmable peripheral i/o ar ea in addresses 03fec000h to 03fecbffh. use of these addresses in a version without a can controller is prohibited. 4. the internal rom area and its mirror area cannot be us ed as the external memory area. in addition, a write access is prohibited. 5. 512/768/1024/1280/1536 kb (flash memory) (see table 1-1 .)
chapter 5 bus control function user?s manual u19201ej3v0ud 296 5.3.1 chip select control function in the v850e/sj3-h and v850e/sk3-h , eight types of memory maps c an be selected by the csc0 and csc1 registers. (1) chip area select control registers 0, 1 (csc0 and csc1) set the csc0 and csc1 registers to the following set values. this register can be read/written in 16-bit units. the address and initial value of csc0 and csc1 registers are as follows. register name address initial value csc0 fffff060h 2c11h csc1 fffff062h 2c11h caution write to the csc0 and csc1 registers afte r reset, and then do not change the set values. also, do not access an external memory area unt il the initial settings of the csc0 and csc1 registers are complete. (a) when using expansion in ternal ram (other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3- h), 70f3933 (v850e/sj3-h)) the relation of the setting value of csc0 and cs c1 registers and the memory map is as follow. caution in the pd70f3931 (v850e/sj3-h), 70f3932 (v85 0e/sj3-h), and 70f3933 (v850e/sj3-h), expanded internal ram is not provided. the refore, the setting shown in ?5.3.1 (1) (a) when using expanded internal ram? cannot be used. be sure to use the setting shown in ?5.3.1 (1) (b) when not using expanded internal ram?. csc0 register set value csc1 register set value memory map 2c11h (initial value) 2c11h (initial value) memory map 1 (see <1> in figure 5-2) ecc3h 2c11h (initial value) memory map 2 (see <2> in figure 5-2) 2c83h 2c11h (initial value) memory map 3 (see <3> in figure 5-2) 2c43h 2c11h (initial value) memory map 4 (see <4> in figure 5-2) other than above other than above setting prohibited
chapter 5 bus control function user?s manual u19201ej3v0ud 297 figure 5-2. four types of memory maps that can be set by csc0 and csc1 registers: when using expanded internal ram (1/2) <1> memory map 1 <2> memory map 2 note 1 cs2 (4 mb) internal rom area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (16 mb) cs1 (8 mb) cs3 (16 mb) note 1 cs2 (4 mb) internal rom area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (16 mb) cs3 (8 mb) 03ffffffh 03fe4000h 03fe3fffh 02000000h 01ffffffh 01000000h 00ffffffh 00800000h 007fffffh 00400000h 003fffffh 00000000h 00c00000h 00bfffffh 03ffffffh 03fe4000h 03fe3fffh 02000000h 01ffffffh 01000000h 00ffffffh 00800000h 007fffffh 00400000h 003fffffh 00000000h 00c00000h 00bfffffh use prohibited use prohibited note 2 notes 1. addresses 03fe4000h to 03ffffffh include the inte rnal ram area, on-chip peripheral i/o area, programmable peripheral i/o area (only in the products with the can cont roller), and expanded internal ram area. 2. because the number of address pins (a0 to a23) is 24, addresses 01000000h to 01ffffffh physically indicate addresses 00000000h to 00ffffffh. remark : use-prohibited area
chapter 5 bus control function user?s manual u19201ej3v0ud 298 figure 5-2. four types of memory maps that can be set by csc0 and csc1 registers: when using expanded internal ram (2/2) <3> memory map 3 <4> memory map 4 note internal rom area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (16 mb) cs2 (4 mb) cs3 (4 mb) cs1 (4 mb) use prohibited note internal rom area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (16 mb) cs2 (4 mb) cs1 (4 mb) cs3 (4 mb) use prohibited 03ffffffh 03fe4000h 03fe3fffh 02000000h 01ffffffh 01000000h 00ffffffh 00800000h 007fffffh 00400000h 003fffffh 00000000h 00c00000h 00bfffffh 03ffffffh 03fe4000h 03fe3fffh 02000000h 01ffffffh 01000000h 00ffffffh 00800000h 007fffffh 00400000h 003fffffh 00000000h 00c00000h 00bfffffh note addresses 03fe4000h to 03ffffffh include the inte rnal ram area, on-chip peripheral i/o area, programmable peripheral i/o area (only in the products with the can c ontroller), and ex panded internal ram area. remark : use-prohibited area
chapter 5 bus control function user?s manual u19201ej3v0ud 299 (b) when not using expanded internal ram the relationship between the setting value of the csc0 and csc1 registers and the memory map is as follows. csc0 register set value csc1 register set value memory map 2c11h (initial value) 0100h memory map 1 (see <1> in figure 5-3) ecc3h 0100h memory map 2 (see <2> in figure 5-3) 2c83h 0100h memory map 3 (see <3> in figure 5-3) 2c43h 0100h memory map 4 (see <4> in figure 5-3) other than above other than above setting prohibited figure 5-3. four types of memory maps that can be set by csc0 and csc1 registers: when not using expanded internal ram (1/2) <3> memory map 3 <4> memory map 4 note 1 cs2 (4 mb) internal rom area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (16 mb) cs1 (8 mb) cs3 (16 mb) note 1 cs2 (4 mb) internal rom area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (16 mb) cs3 (8 mb) 03ffffffh 03fec000h 03febfffh 03febfffh 02000000h 01ffffffh 01000000h 00ffffffh 00800000h 007fffffh 00400000h 003fffffh 00000000h 00c00000h 00bfffffh 03ffffffh 03fec000h 02000000h 01ffffffh 01000000h 00ffffffh 00800000h 007fffffh 00400000h 003fffffh 00000000h 00c00000h 00bfffffh use prohibited use prohibited note 2 external memory area (1968 kb) 03e00000h 03dfffffh external memory area (1968 kb) 03e00000h 03dfffffh notes 1. addresses 03fec000h to 03ffffffh include the in ternal ram area, on-chip peripheral i/o area, and programmable peripheral i/o area (only in the products with the can controller). 2. because the number of address pins (a0 to a23) is 24, addre sses 01000000h to 01ffffffh physically indicate addresses 00000000h to 00ffffffh. remark : use-prohibited area
chapter 5 bus control function user?s manual u19201ej3v0ud 300 figure 5-3. four types of memory maps that can be set by csc0 and csc1 registers: when not using expanded internal ram (2/2) <3> memory map 3 <4> memory map 4 note cs2 (4 mb) internal rom area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (16 mb) cs1 (4 mb) cs3 (4 mb) note cs2 (4 mb) internal rom area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (4 mb) external memory area (16 mb) cs1 (4 mb) 03ffffffh 03fec000h 03febfffh 03febfffh 02000000h 01ffffffh 01000000h 00ffffffh 00800000h 007fffffh 00400000h 003fffffh 00000000h 00c00000h 00bfffffh 03ffffffh 03fec000h 02000000h 01ffffffh 01000000h 00ffffffh 00800000h 007fffffh 00400000h 003fffffh 00000000h 00c00000h 00bfffffh use prohibited use prohibited external memory area (1968 kb) 03e00000h 03dfffffh external memory area (1968 kb) 03e00000h 03dfffffh cs3 (4 mb) note addresses 03fec000h to 03ffffffh include the internal ram area, on-chip peripheral i/o area, and programmable peripheral i/o area (only in the products with the can controller). remark : use-prohibited area
chapter 5 bus control function user?s manual u19201ej3v0ud 301 5.4 external bus interface mode control function the v850e/sj3-h and v850e/sk3-h include the following two external bus interface modes. ? multiplexed bus mode ? separate bus mode these two modes can be selected by using the eximc register. (1) external bus interface mode control register (eximc) the eximc register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. caution write to the eximc register after reset, and then do not chan ge the set values. also, do not access an external memory area until the initial se ttings of the eximc register are complete. 0 multiplexed bus mode separate bus mode smsel 0 1 mode selection eximc 0 0 0 0 0 0 smsel after reset: 00h r/w address: ffffffbeh caution set the eximc register fr om the internal rom or internal ram area before making an external access. after setting the eximc register, be sure to insert a nop instruction.
chapter 5 bus control function user?s manual u19201ej3v0ud 302 5.5 bus access 5.5.1 number of clocks for access the following table shows the number of basic clocks required for accessing each resource. area (bus) bus cycle type internal rom (32 bits) internal ram (32 bits) external memory (multiplexed bus) (16 bits) external memory (separate bus) (16 bits) expanded internal ram (32 bits) note 3 instruction fetch (normal access) 1 1 note 1 3 + n note 2 2 + n note 2 3 + n instruction fetch (branch) 3 2 note 1 3 + n note 2 2 + n note 2 3 + n operand data access 4 1 3 + n note 2 2 + n note 2 3 + n notes 1. incremented by 1 if a conflict with a data access occurs. 2. data wait, address setup wait, address hold wait, and idle state are not included. 3. if the external bus is set in the multiplexed bus mode, the expanded internal ram is accessed in the multiplexed bus access mode, if the external bus is set in the separate bus mode, the expanded internal ram is accessed in the separate bus access mode. remarks 1. unit: clocks/access 2. n: number of waits inserted by the wait pin
chapter 5 bus control function user?s manual u19201ej3v0ud 303 5.5.2 bus size setting function each external memory area selected by csn can be set by using the bsc register. however, the bus size can be set to 8 bits and 16 bits only. the external memory area of the v850e/sj3-h and v850e/sk3-h is selected by cs1 to cs3. (1) bus size configuration register (bsc) the bsc register can be read or written in 16-bit units. reset sets this register to 5555h. caution write to the bsc register after reset, and then do not change the set values. also, do not access an external memory area until the initial settings of the bsc register are complete. after reset: 5555h r/w address: fffff066h 0/1 0 bits 15 to 8 01010001 01010101 10010101 note other than above expanded internal ram is not used. external memory area (3e00000h to 3febfffh, data bus width: 8 bits) is used. expanded internal ram is not used. external memory area (3e00000h to 3febfffh, data bus width: 16 bits) is used. expanded internal ram is used. external memory area (3e00000h to 3febfffh) is not used. setting prohibited bsc 0/1 bs30 0/1 0 0/1 bs20 0/1 0 0/1 bs10 0/1 0/1 0/1 0/1 8 9 10 11 12 13 expanded internal ram/external memory area setting 14 15 1 2 3 4 5 6 7 0 bsn0 0 1 8 bits 16 bits data bus width of csn space (n = 1 to 3) cs3 cs2 cs1 bits 1 and 0 10 other than above iecube is used. setting prohibited in-circuit emulator (iecube ? ) setting note this setting is prohibited in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). caution be sure to clear bits 7, 5, and 3 to ?0?.
chapter 5 bus control function user?s manual u19201ej3v0ud 304 5.5.3 access by bus size the v850e/sj3-h and v850e/sk3-h access the on-chip peripheral i/o and external memory in 8-bit, 16-bit, or 32- bit units. the bus size is as follows. ? the bus size of the on-chip peripheral i/o is fixed to 16 bits. ? the bus size of the external memory is selectable from 8 bits or 16 bits (by using the bsc register). the operation when each of the above is accessed is described below. all data is accessed starting from the lower side. the v850e/sj3-h and v850e/sk3-h support only the little-endian format. figure 5-4. little-endian address in word 000bh 000ah 0009h 0008h 0007h 0006h 0005h 0004h 0003h 0002h 0001h 0000h 31 24 23 16 15 8 7 0 (1) data space the v850e/sj3-h and v850e/sk3-h have an address misalign function. with this function, data can be placed at all addresse s, regardless of the format of the data (word data or halfword data). however, if the word data or halfwor d data is not aligned at the boundary, a bus cycle is generated at least twice, causing the bus efficiency to drop. (a) halfword-length data access a byte-length bus cycle is generated twice if t he least significant bit of the address is 1. (b) word-length data access (i) a byte-length bus cycle, halfword-length bus cycle, and byte-length bus cycle are generated in that order if the least significant bit of the address is 1. (ii) a halfword-length bus cycle is generated twic e if the lower 2 bits of the address are 10.
chapter 5 bus control function user?s manual u19201ej3v0ud 305 (2) byte access (8 bits) (a) 16-bit data bus width <1> access to even address (2n) <2> access to odd address (2n + 1) 7 0 7 0 byte data 15 8 external data bus 2n address 7 0 7 0 15 8 2n + 1 address byte data external data bus (b) 8-bit data bus width <1> access to even address (2n) <2> access to odd address (2n + 1) 7 0 7 0 2n address byte data external data bus 7 0 7 0 2n + 1 address byte data external data bus
chapter 5 bus control function user?s manual u19201ej3v0ud 306 (3) halfword access (16 bits) (a) with 16-bit data bus width <1> access to even address (2n) <2> access to odd address (2n + 1) 7 0 7 0 15 8 2n address 15 8 2n + 1 halfword data external data bus first access second access 7 0 7 0 15 8 15 8 7 0 7 0 15 8 15 8 2n + 2 halfword data external data bus 2n address halfword data external data bus address 2n + 1 (b) 8-bit data bus width <1> access to even address (2n) <2> access to odd address (2n + 1) first access second access 7 0 7 0 15 8 address 7 0 7 0 15 8 2n + 1 address 2n halfword data external data bus halfword data external data bus first access second access 7 0 7 0 15 8 7 0 7 0 15 8 2n + 2 2n + 1 address address halfword data external data bus halfword data external data bus
chapter 5 bus control function user?s manual u19201ej3v0ud 307 (4) word access (32 bits) (a) 16-bit data bus width (1/2) <1> access to address (4n) first access second access 7 0 7 0 15 8 4n 15 8 4n + 1 23 16 31 24 7 0 7 0 15 8 4n + 2 15 8 4n + 3 23 16 31 24 word data external data bus address word data external data bus address <2> access to address (4n + 1) first access second access third access 7 0 7 0 15 8 15 8 4n + 1 23 16 31 24 7 0 7 0 15 8 4n + 2 15 8 4n + 3 23 16 31 24 7 0 7 0 15 8 4n + 4 15 8 23 16 31 24 word data external data bus address word data external data bus address word data external data bus address
chapter 5 bus control function user?s manual u19201ej3v0ud 308 (a) 16-bit data bus width (2/2) <3> access to address (4n + 2) first access second access 7 0 7 0 15 8 4n + 2 15 8 4n + 3 23 16 31 24 7 0 7 0 15 8 4n + 4 15 8 4n + 5 23 16 31 24 word data external data bus address word data external data bus address <4> access to address (4n + 3) first access second access third access 7 0 7 0 15 8 15 8 4n + 3 23 16 31 24 7 0 7 0 15 8 4n + 4 15 8 4n + 5 23 16 31 24 7 0 7 0 15 8 4n + 6 15 8 23 16 31 24 word data external data bus address word data external data bus address word data external data bus address
chapter 5 bus control function user?s manual u19201ej3v0ud 309 (b) 8-bit data bus width (1/2) <1> access to address (4n) first access second access third access fourth access 7 0 7 0 15 8 4n 23 16 31 24 7 0 7 0 4n + 1 15 8 23 16 31 24 7 0 7 0 4n + 2 15 8 23 16 31 24 7 0 7 0 4n + 3 15 8 23 16 31 24 word data external data bus address word data external data bus address word data external data bus address word data external data bus address <2> access to address (4n + 1) first access second access third access fourth access 7 0 7 0 15 8 4n + 1 23 16 31 24 7 0 7 0 4n + 2 15 8 23 16 31 24 7 0 7 0 4n + 3 15 8 23 16 31 24 7 0 7 0 4n + 4 15 8 23 16 31 24 word data external data bus address word data external data bus address word data external data bus address word data external data bus address
chapter 5 bus control function user?s manual u19201ej3v0ud 310 (b) 8-bit data bus width (2/2) <3> access to address (4n + 2) first access second access third access fourth access word data external data bus address word data external data bus address word data external data bus address word data external data bus address 7 0 7 0 15 8 4n + 2 23 16 31 24 7 0 7 0 4n + 3 15 8 23 16 31 24 7 0 7 0 4n + 4 15 8 23 16 31 24 7 0 7 0 4n + 5 15 8 23 16 31 24 <4> access to address (4n + 3) first access second access third access fourth access 7 0 7 0 15 8 4n + 3 23 16 31 24 7 0 7 0 4n + 4 15 8 23 16 31 24 7 0 7 0 4n + 5 15 8 23 16 31 24 7 0 7 0 4n + 6 15 8 23 16 31 24 word data external data bus address word data external data bus address word data external data bus address word data external data bus address
chapter 5 bus control function user?s manual u19201ej3v0ud 311 5.6 wait function 5.6.1 programmable wait function (1) data wait control register 0 (dwc0) to realize interfacing with a low-speed memory or i/o, up to seven data wait states can be inserted in the bus cycle that is executed for each cs space. the number of wait states can be pr ogrammed by using the dwc0 register . immediately after system reset, 7 data wait states are inserted for all the blocks. the dwc0 register can be read or written in 16-bit units. reset sets this register to 7777h. cautions 1. the internal rom and internal ram areas are not subj ect to programmable wait, and are always accessed without a wait state. the on- chip peripheral i/o area is also not subject to programmable wait, and only wait control from each peripheral function is performed. 2. write to the dwc0 register after reset, and then do not change the set values. also, do not access an external memory area until the in itial settings of the dwc0 register are complete. 3. when the v850e/sj3-h and v850e/sk3-h are used in separate bus m ode and operated at f cpu > 20 mhz, be sure to in sert one or more wait. 4. when the v850e/sj3-h and v850e/sk3-h are used in multiplexed bus mode and operated at f cpu > 32 mhz, be sure to insert one or more wait.
chapter 5 bus control function user?s manual u19201ej3v0ud 312 after reset: 7777h r/w address: fffff484h 0 0 dwn2 0 0 0 0 1 1 1 1 dwn1 0 0 1 1 0 0 1 1 dwn0 0 1 0 1 0 1 0 1 none 1 2 3 4 5 6 7 dwc0 dw32 dw12 dw31 dw11 dw30 dw10 0 0 dw22 0/1 dw21 0/1 dw20 0/1 8 9 10 11 12 13 number of wait states inserted in csn space (n = 1 to 3) 14 15 1 2 3 4 5 6 7 0 cs3 cs2 cs1 f cpu 20 mhz f cpu 32 mhz f cpu > 20 mhz f cpu > 32 mhz multiplexed bus separate bus bits 2 to 0 001 000 other than above iecube is used when eximc register = 01h and f cpu > 32 mhz. iecube is used when other than above. setting prohibited in-circuit emulator (iecube) setting setting prohibited setting prohibited none caution be sure to clear bits 15, 11, 7, and 3 to ?0?. (2) data wait control register 1 (dwc1) the dwc1 register can be read or written in 16-bit units (address: fffff486h, initial value: 7777h). (a) when using the expanded intern al ram (does not apply to the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h)) be sure to set the dwc1 register to the following value by setting the eximc register. caution in the pd70f3931 (v850e/sj3-h), 70f3932 (v85 0e/sj3-h), and 70f3933 (v850e/sj3-h), expanded internal ram is not provided. the refore, the setting shown in ?5.6.1 (2) (a) when using expanded internal ram? cannot be used. be sure to use the setting shown in ?5.6.1 (2) (b) not usin g expansion internal ram?. eximc register set value dwc1 register set value 00h (multiplexed bus mode) 0777h 01h (separate bus mode) 1777h
chapter 5 bus control function user?s manual u19201ej3v0ud 313 (b) when not using the expanded internal ram to realize interfacing with a low-speed memory or i/o, up to seven data wait states can be inserted in the bus cycle that is executed for each extern al memory area (3e00000h to 3febfffh). the number of wait stat es can be programmed by using the dwc1 register. immediately after system reset, 7 data wait states are inserted. cautions 1. write to the dwc1 register after re set, and then do not change the set values. also, do not access an external memory area until th e initial settings of the dwc1 register are complete. 2. when the v850e/sj3-h and v850e/sk3-h ar e used in separate bus mode and operated at f cpu > 20 mhz, be sure to insert one or more wait. 3. when the v850e/sj3-h and v850e/sk3-h are used in multiplexed bus mode and operated at f cpu > 32 mhz, be sure to insert one or more wait. after reset: 7777h r/w address: fffff486h 0 0 00000111 00010111 00100111 00110111 01000111 01010111 01100111 01110111 bits 7 to 0 1 2 3 4 5 6 7 separate bus dwc1 1 0/1 1 0/1 1 0/1 0 0 1 1 1 1 1 1 8 9 10 11 12 13 number of wait states inserted in external memory area (3e00000h to 3febfffh) 14 15 1 2 3 4 5 6 7 0 none f cpu 20 mhz f cpu > 20 mhz setting prohibited none f cpu 32 mhz f cpu > 32 mhz setting prohibited multiplexed bus caution be sure to clear bits 15, 11, 7, and 3 to ?0?, and set bits 14 to 12, 10 to 8, and 2 to 0 to ?1?.
chapter 5 bus control function user?s manual u19201ej3v0ud 314 5.6.2 external wait function to synchronize an extremely slow external memory, i/o, or asynchronous system, any number of wait states can be inserted in the bus cycle by using the external wait pin (wait). when the pcm0 pin is set to alternate function, the external wait function is enabled. access to each area of the internal rom, internal ram, a nd on-chip peripheral i/o is not subject to control by the external wait function, in the same man ner as the programmable wait function. access to the expanded internal ram area is c ontrolled by the external wait function. the wait signal can be input asynchronously to clkout, and is sampled at the falling edge of the clock in the t2 and tw states of the bus cycle in the multiplexed bus mode. in the separate bus mode, it is sampled at the rising edge of the clock immediately after the t1 and tw states of the bus cycle. if the setup/hold time of the sampling timing is not satisfied, a wait state is inserted in the next state, or not inserted at all.
chapter 5 bus control function user?s manual u19201ej3v0ud 315 5.6.3 relationship between programm able wait and external wait wait cycles are inserted as the result of an or operation between the wait cycles specifi ed by the set value of the programmable wait and the wait cycles controlled by the wait pin. wait control programmable wait wait via wait pin for example, if the timing of the programmable wait and the wait pin signal is as illustrated below, three wait states will be inserted in the bus cycle. figure 5-5. inserting wait example (a) multiplexed bus clkout t1 t2 tw tw tw t3 wait pin wait via wait pin programmable wait wait control (b) separate bus t1 tw tw tw t2 clkout wait pin wait via wait pin programmable wait wait control remark the circles indicate the sampling timing.
chapter 5 bus control function user?s manual u19201ej3v0ud 316 5.6.4 programmable address wait function address-setup (asw) or address-hold wa its (ahw) to be inserted in each bus cycle can be set by using the awc register. address wait insertion is set for each chip select area (cs1 to cs3). if an address setup wait is inserted, it seem s that the high-clock period of the t1 state is extended by 1 clock. if an address hold wait is inserted, it seems that the low-cl ock period of the t1 state is extended by 1 clock. (1) address wait control register (awc) the awc register can be read or written in 16-bit units. reset sets this register to ffffh. cautions 1. address setup wait and address hold wait cycles are not inserted when the internal rom area, internal ram area, and on-ch ip peripheral i/o areas are accessed. 2. write to the awc register after reset, and then do not change the set values. also, do not access an external memory area until the initial settings of the awc register are complete. 3. when the v850e/sj3-h and v850e/sk3-h are operated at f cpu > 20 mhz, be sure to insert the address hold wait and the address setup wait.
chapter 5 bus control function user?s manual u19201ej3v0ud 317 after reset: ffffh r/w address: fffff488h 0/1 ahw3 awc 0/1 asw3 0/1 ahw2 0/1 asw2 0/1 ahw1 0/1 asw1 0/1 0/1 0/1 0/1 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 0 aswn 0 1 not inserted inserted setting prohibited inserted specifies insertion of address setup wait (n = 1 to 3) cs3 cs2 cs1 f cpu 20 mhz f cpu > 20 mhz ahwn 0 1 not inserted inserted setting prohibited inserted specifies insertion of address hold wait (n = 1 to 3) f cpu 20 mhz f cpu > 20 mhz bits 1 and 0 00 other than above iecube is used. setting prohibited in-circuit emulator (iecube) setting bits 15 to 8 00111111 note 11110011 11110111 11111011 11111111 other than above expanded internal ram is used. external memory area (3e00000h to 3febfffh) is not used. expanded internal ram is not used. external memory area (3e00000h to 3febfffh, ahw and asw are not inserted (setting prohibited when f cpu > 20 mhz)) is used. expanded internal ram is not used. external memory area (3e00000h to 3febfffh, ahw is not inserted (setting prohibited when f cpu > 20 mhz), asw is inserted) is used. expanded internal ram is not used. external memory area (3e00000h to 3febfffh, ahw is inserted, asw is not inserted (setting prohibited when f cpu > 20 mhz)) is used. expanded internal ram is not used. external memory area (3e00000h to 3febfffh, ahw and asw are inserted) is used. setting prohibited expanded internal ram/external memory area setting note this setting is prohibited in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h).
chapter 5 bus control function user?s manual u19201ej3v0ud 318 5.7 idle state insertion function to facilitate interfacing with low-speed memories, one idle state (ti) can be inserted afte r the t3 state in the bus cycle that is executed for each space selected by the chip select function in the multiplex address/data bus mode. in the separate bus mode, one idle state (ti) can be inserted a fter the t2 state. by inse rting an idle state, the data output float delay time of the memory can be secured du ring read access (an idle state cannot be inserted during write access). whether the idle state is to be inserted c an be programmed by using the bcc register. an idle state is inserted for all t he areas immediately after system reset. (1) bus cycle control register (bcc) the bcc register can be read or written in 16-bit units. reset sets this register to aaaah. cautions 1. the internal rom, internal ram, a nd on-chip peripheral i/o areas are not subject to idle state insertion. 2. write to the bcc register after reset, and then do not change the set values. also, do not access an external memory area until the initial settings of the bcc register are complete. after reset: aaaah r/w address: fffff48ah 0/1 bc31 bcc 0/1 0 0/1 bc21 0/1 0 0/1 bc11 0/1 0 0/1 0/1 0/1 0 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 0 bcn1 0 1 not inserted inserted specifies insertion of idle state (n = 1 to 3) bit 1 0 1 iecube is used. setting prohibited in-circuit emulator (iecube) setting cs3 cs2 cs1 bits 15 to 8 00101010 note 10100010 10101010 other than above expanded internal ram is used. external memory area (3e00000h to 3febfffh) is not used. expanded internal ram is not used. external memory area (3e00000h to 3febfffh, ti is not inserted) is used. expanded internal ram is not used. external memory area (3e00000h to 3febfffh, ti is inserted) is used. setting prohibited expanded internal ram/external memory area setting note this setting is prohibited in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). caution be sure to clear bits 6, 4, 2, and 0 to ?0?.
chapter 5 bus control function user?s manual u19201ej3v0ud 319 5.8 bus hold function 5.8.1 functional outline the hldrq and hldak functions are valid if the pc m2 and pcm3 pins are set to alternate function. when the hldrq pin is asserted (low level), indicating th at another bus master has requested bus mastership, the external address/data bus goes into a high-impedance state and is released (bus hold status ). if the request for the bus mastership is cleared and the hldrq pin is deasserted (high level), driving these pins is started again. during the bus hold period, execution of the program in the internal rom and internal ram is continued until an on-chip peripheral i/o register or t he external memory is accessed. the bus hold status is indicated by a ssertion of the hldak pin (low level). the bus hold function enables the configuration of mult i-processor type systems in which two or more bus masters exist. note that the bus hold request is not acknowledged during a multiple-acce ss cycle initiated by the bus sizing function or a bit manipulation instruction. status data bus width access type timing at which bus hold request is not acknowledged word access to even address between first and second access between first and second access word access to odd address between second and third access 16 bits halfword access to odd address between first and second access between first and second access between second and third access word access between third and fourth access cpu bus lock 8 bits halfword access between first and second access read-modify-write access of bit manipulation instruction ? ? between read access and write access
chapter 5 bus control function user?s manual u19201ej3v0ud 320 5.8.2 bus hold procedure the bus hold status transition procedure is shown below. <1> hldrq = 0 acknowledged <2> all bus cycle start requests inhibited <3> end of current bus cycle <4> shift to bus idle status <5> hldak = 0 <6> hldrq = 1 acknowledged <7> hldak = 1 <8> bus cycle start request inhibition released <9> bus cycle starts normal status bus hold status normal status hldak (output) hldrq (input) <1> <2> <5> <3><4> <7><8><9> <6> 5.8.3 operation in power save mode because the internal system clock is stopped in the stop, idle1, idle2, and sub-idle modes, the bus hold status is not entered even if the hldrq pin is asserted. in the halt mode, the hldak pin is asserted as soon as the hldrq pin has been asserted, and the bus hold status is entered. when the hldrq pin is later deasserted, the hldak pin is also deasserted, and the bus hold status is cleared.
chapter 5 bus control function user?s manual u19201ej3v0ud 321 5.9 bus priority bus hold, dma transfer, operand data accesses, instruction fetch (branch), and instruction fetch (successive) are executed in the external bus cycle. bus hold has the highest priority, followed by dma transfer, operand data access, instruction fetch (branch), and instruction fetch (successive). an instruction fetch may be inserted between the read access and write access in a read-modify-write access. if an instruction is executed for two or more accesses, an instruction fetch and bus hold are not inserted between accesses due to bus size limitations. table 5-3. bus priority priority external bus cycle bus master bus hold external device dma transfer dmac operand data access cpu instruction fetch (branch) cpu high low instruction fetch (successive) cpu
chapter 5 bus control function user?s manual u19201ej3v0ud 322 5.10 bus timing figure 5-6. multiplexed bus read timing (bus size: 16 bits, 16-bit access) a1 a2 a3 d1 d2 a3 a2 a1 t1 t2 t3 t1 t2 tw tw t3 ti t1 programmable wait external wait idle state clkout a23 to a16 astb cs3 to cs1 wait ad15 to ad0 rd 8-bit access ad15 to ad8 ad7 to ad0 odd address active hi-z even address hi-z active 111 remark the broken lines indicate high impedance. figure 5-7. multiplexed bus r ead timing (bus size: 8 bits) a1 a2 a3 d1 d2 a3 a2 a1 t1 t2 t3 t1 t2 tw tw t3 ti t1 programmable wait external wait idle state clkout a23 to a16, ad15 to ad8 astb cs3 to cs1 wait ad7 to ad0 rd 111 remark the broken lines indicate high impedance.
chapter 5 bus control function user?s manual u19201ej3v0ud 323 figure 5-8. multiplexed bus write timi ng (bus size: 16 bits, 16-bit access) a1 11 00 11 11 00 11 a2 a3 d1 d2 a3 a2 a1 t2 t3 t1 t1 t2 tw tw t3 t1 programmable wait external wait clkout a23 to a16 astb cs3 to cs1 wait ad15 to ad0 wr1, wr0 wr1, wr0 01 10 8-bit access ad15 to ad8 ad7 to ad0 odd address active undefined even address undefined active figure 5-9. multiplexed bus wr ite timing (bus size: 8 bits) a1 11 10 11 11 10 11 a2 a3 d1 d2 a3 a2 a1 t2 t3 t1 t1 t2 tw tw t3 t1 programmable wait external wait clkout a23 to a16, ad15 to ad8 astb cs3 to cs1 wait ad7 to ad0 wr1, wr0
chapter 5 bus control function user?s manual u19201ej3v0ud 324 figure 5-10. multiplexed bu s hold timing (bus size : 16 bits, 16-bit access) t1 a1 undefined a1 a2 t2 t3 ti note th th th th ti note t1 t2 t3 d1 clkout hldrq hldak a23 to a16 astb cs3 to cs1 ad15 to ad0 rd undefined undefined undefined a2 d2 111 111 note this idle state (ti) does not de pend on the bcc register settings. remarks 1. see table 2-3 for the pin statuses in the bus hold mode. 2. the broken lines indicate high impedance.
chapter 5 bus control function user?s manual u19201ej3v0ud 325 figure 5-11. separate bus read timi ng (bus size: 16 bits, 16-bit access) t1 a1 a2 a3 t2 t1 tw tw t2 t2 ti t1 d3 d2 programmable wait external wait idle state d1 clkout a23 to a0 cs3 to cs1 wait ad15 to ad0 rd 8-bit access ad15 to ad8 ad7 to ad0 odd address active hi-z even address hi-z active 111 remark the broken lines indicate high impedance. figure 5-12. separate bus r ead timing (bus size: 8 bits) t1 a1 a2 a3 t2 t1 tw tw t2 t2 ti t1 d3 d2 programmable wait external wait idle state d1 clkout a23 to a0 cs3 to cs1 wait ad7 to ad0 rd 111 remark the broken lines indicate high impedance.
chapter 5 bus control function user?s manual u19201ej3v0ud 326 figure 5-13. separate bus write timi ng (bus size: 16 bits, 16-bit access) t1 a1 11 00 00 00 11 11 11 11 a2 a3 t2 t1 tw tw t2 t1 t2 d3 d2 programmable wait external wait d1 clkout a23 to a0 cs3 to cs1 wait ad15 to ad0 wr1, wr0 wr1, wr0 01 10 8-bit access ad15 to ad8 ad7 to ad0 odd address active undefined even address undefined active remark the broken lines indicate high impedance. figure 5-14. separate bus writ e timing (bus size: 8 bits) t1 a1 a2 a3 t2 t1 tw tw t2 t1 t2 d3 d2 programmable wait external wait d1 clkout a23 to a0 cs3 to cs1 wait ad7 to ad0 wr1, wr0 11 10 10 10 11 11 11 11 remark the broken lines indicate high impedance.
chapter 5 bus control function user?s manual u19201ej3v0ud 327 figure 5-15. separate bus hold ti ming (bus size: 8 bits, write) clkout t1 t2 a1 d1 d2 undefined a2 undefined 11 11 10 d3 a3 t1 t2 th ti note ti note th th th t1 t2 hldrq hldak a23 to a0 ad7 to ad0 wr1, wr0 cs3 to cs1 11 10 11 10 111 111 11 note this idle state (ti) does not de pend on the bcc register settings. remark the broken lines indicate high impedance. figure 5-16. address wait timing (separate bus read, bus size: 16 bits, 16-bit access) tasw t1 tahw t2 clkout astb a23 to a0 cs3 to cs1 wait ad15 to ad0 rd d1 a1 t1 t2 clkout astb a23 to a0 cs3 to cs1 wait ad15 to ad0 rd d1 a1 remarks 1. tasw (address setup wait): image of hi gh-level width of t1 state expanded. 2. tahw (address hold wait): image of lo w-level width of t1 state expanded. 3. the broken lines indicate high impedance.
user?s manual u19201ej3v0ud 328 chapter 6 clock generation function 6.1 overview an outline of the clock generation function is shown below. { main clock oscillator ? oscillation (f x ) via externally connected 3 to 10 mhz resonator note { subclock oscillator ? oscillation (f xt ) via externally connected 32.768 khz resonator { on-chip oscillator ? f r = 100 to 400 khz, 220 khz (typ.) ? used as default clock source for watchdog timer 2 ? used as source clock for tmm0 to tmm2 ? used as sampling clock for monitoring abnormal stoppage of main clock oscillator (clock monitor) ? whether on-chip oscillator can be stopped or not by software can be selected using option byte function { multiply function using pll (phase locked loop) ? x8 multiplication (division by 2/no divi sion after x8 multiplication selectable) { division function of pll input clock (f plli ) ? division by 2/no division selectable by using option byte { multiply function, frequency modulation functi on using sscg (spread spectrum clock generator) ? x8 multiplication/x12 multiplication ? no modulation/modulation selectable ? modulation ratio (typ.): selectable from ? 1%, ? 2% and ? 4% (using down spread method) ? modulation cycle (typ.): selectable from 40 khz, 50 khz and 60 khz { internal system clock generation ? selectable from clock-through or pll/ssc g output clock used as internal system clock ? prescaler for internal system clock: 7 stages (f xx , f xx /2, f xx /4, f xx /8, f xx /16, f xx /32, f xt ) { peripheral clock (f xp ) generation ? when sscg is used to generate internal system clock: pll output clock supplied to on-chip peripheral functions { clock output function (clkout pin) note the selectable frequency range of the externally connected resonator differs depending on the clock mode. remark f x : main oscillation clock frequency f xx : main clock frequency f xt : subclock frequency f r : on-chip oscillation clock frequency f plli : pll input clock frequency f xp : peripheral clock frequency
chapter 6 clock generation function user?s manual u19201ej3v0ud 329 6.2 clock mode the v850e/sj3-h and v850e/sk3-h have four clock modes. the features of these cl ock modes are described below. caution the clock mode is set using the option byte , and therefore cannot be switched during operation. consequently, it is impor tant to determine which clock mode is to be used, before starting operation. ? clock mode 1: in this mode, pll output (x8 multiplication/divided by 2 afte r x8 multiplication) can be selected as the main clock (f xx ), which can operate at up to 32 mhz. in this mode, the main clock is used as the source of the peripheral clock. ? clock mode 2: in this mode, sscg output (x12 multiplication) can be selected as the main clock (f xx ), which can operate at up to 48 mhz. in this mode, either the main clock or the pll output divided by 2 (divided by 2 after x8 multiplication: 16 mhz max.) can be selected as the peripheral clock. an undivided pll output (x8 multiplication: 32 mhz max.) can also be selected for the clock supplied to the iebus controller and can controller. ? clock mode 3: in this mode, sscg output (x8/x12 mu ltiplication) can be selected as the main clock (f xx ), which can operate at up to 48 mhz. in this mode, either the main clock or the pll output (x8 multiplication: 32 mhz max.) can be selected as the peripheral clock. ? clock mode 4: in this mode, sscg output (x8 mult iplication) can be selected as the main clock (f xx ), which can operate at up to 48 mhz. in this mode, either the main clock or the pll output divided by 2 (divided by 2 after x8 multiplication: 24 mhz max.) can be selected as the peripheral clock. the iebus controller cannot be used in this mode. the frequency range of the operating clo cks in each clock mode and the corresponding source clocks are shown in the table below.
chapter 6 clock generation function user?s manual u19201ej3v0ud 330 table 6-1. frequency range of operating clocks in each clock mode and corresponding source cocks (1/2) option byte 0000007bh note clock mode setting value of plli0 bit range of main oscillation clock frequency (f x ) settable operating mode and main clock frequency (f xx ) source clock of peripheral clock (f xp ), iebus clock (f ie ), can clock (f can ) 3 to 10 mhz clock-through mode: 3 to 10 mhz main clock: 3 to 10 mhz (f xp = f ie = f can = f xx ) clock-through mode: 3 to 5 mhz main clock: 3 to 5 mhz (f xp = f ie = f can = f xx ) 3 to 5 mhz pll mode (divided by 2 after x8 multiplication) 12 to 20 mhz main clock: 12 to 20 mhz (f xp = f ie = f can = f xx ) clock-through mode: 3 to 4 mhz main clock: 3 to 4 mhz (f xp = f ie = f can = f xx ) 0 3 to 4 mhz pll mode (x8 multiplication) 24 to 32 mhz main clock: 24 to 32 mhz (f xp = f ie = f can = f xx ) 6 to 10 mhz clock-through mode: 6 to 10 mhz clock-through mode: 6 to 10 mhz main clock: 6 to 10 mhz (f xp = f ie = f can = f xx ) 6 to 10 mhz pll mode (divided by 2 after x8 multiplication) 12 to 20 mhz main clock: 12 to 20 mhz (f xp = f ie = f can = f xx ) clock-through mode: 6 to 8 mhz main clock: 6 to 8 mhz (f xp = f ie = f can = f xx ) clock mode 1 1 6 to 8 mhz pll mode (x8 multiplication) 24 to 32 mhz main clock: 24 to 32 mhz (f xp = f ie = f can = f xx ) clock-through mode: 3.66 to 4 mhz 0 3.66 to 4 mhz sscg mode (x12 multiplication) 43.92 to 48 mhz clock-through mode: 7.32 to 8 mhz clock mode 2 1 7.32 to 8 mhz sscg mode (x12 multiplication) 43.92 to 48 mhz ? f xp pll clock (divided by 2 after x8 multiplication) 14.64 to 16 mhz ? f ie , f can pll clock (x8 multiplication) 29.28 to 32 mhz note for details, see chapter 33 option byte function . cautions 1. in clock mo de 1, the main clock (f xx ) is supplied as the source of the peripheral clock (f xp , f ie , f can ). in this mode, the sscg output cl ock cannot be used as the main clock. 2. in clock mode 2, the sscg out put clock is used as th e main clock and the pl l output is used as the peripheral clock. in these modes, the pll output clock cannot be used as the main clock. also, when clock-through mode is selected for the main clock, the s ource of the peripheral clock is the pll output clock.
chapter 6 clock generation function user?s manual u19201ej3v0ud 331 table 6-1. frequency range of operating clocks in each clock mode and corresponding source cocks (2/2) option byte 0000007bh note clock mode setting value of plli0 bit range of main oscillation clock frequency (f x ) settable operating mode and main clock frequency (f xx ) source clock of peripheral clock (f xp ), iebus clock (f ie ), can clock (f can ) clock-through mode: 3.66 to 4 mhz sscg mode (x8 multiplication) 29.28 to 32 mhz 0 3.66 to 4 mhz sscg mode (x12 multiplication) 43.92 to 48 mhz clock-through mode: 7.32 to 8 mhz sscg mode (x8 multiplication) 29.28 to 32 mhz clock mode 3 1 7.32 to 8 mhz sscg mode (x12 multiplication) 43.92 to 48 mhz pll clock (x8 multiplication) 29.28 to 32 mhz (f xp = f ie = f can ) clock-through mode: 5.22 to 6 mhz 0 5.22 to 6 mhz sscg mode (x8 multiplication) 41.76 to 48 mhz pll clock (divided by 2 after x8 multiplication) 20.88 to 24 mhz (f xp = f ie = f can ) clock mode 4 1 setting prohibited note for details, see chapter 33 option byte function . cautions 1. in clock modes 3 and 4, the sscg output clock is used as the main clock and the pll output is used as the peripheral cl ock. in these modes, the pll output clock cannot be used as the main clock. also, when cl ock-through mode is selected for th e main clock, the source of the peripheral clock is the pll output clock. 2. the iebus controller cannot be used in clock mode 4.
chapter 6 clock generation function user?s manual u19201ej3v0ud 332 6.2.1 clock mode 1 figure 6-1. clock generati on circuit for clock mode 1 sscg (setting prohibited) note 1 plli0 bit of option byte 0000007bh note 6 xt1 xt2 clkout x1 x2 f brg f xt f xt f x f sscgo f plli f pll f pllo f xx /32 f xx /16 f xx /8 f xx /4 f xx /2 f xx f xx f xp f r f r /8 cpu f cpu f clk selector selector selector selector selector selector selector subclock oscillator port cm prescaler 3 main clock oscillator pll 8 main clock oscillator stop control idle control prescaler 1 prescaler 2 idle control 1/2 circuit on-chip oscillator 1/8 circuit halt control 1/2 circuit tmm0, watch timer, watchdog timer 2, real-time counter tmm1, tmm2, watch timer, real-time counter pcc.ck2 to ck0 bits pcc.cls, ck3 bit on-chip peripheral functions note 3 iebus controller can controller 0 note 4 , can controller 1 note 5 idle mode f xp to f xp /1024 f can = f xp = f xx tmm0 to tmm2, watchdog timer 2 rstop bit halt mode internal system clock note 2 pllctl.selpll bit f ie = f xp = f xx pcc.frc bit pcc.mfrc bit pcc.mck bit sscgctl. sscgon bit sfc1 register sscgctl. selsscg bit sfc0 register stop mode pllctl.pllon bit ckc.ckdiv0 bit ckc.ckdiv0 bit notes 1. sscg cannot be used in clock mode 1. 2. the internal oscillation clock (f r ) is selected when watchdog timer 2 overflows during the oscillation stabilization time. 3. internal peripheral functions: tmp0 to tmp8, tmq0, tmm0 to tmm2, csib0 to csib5, csie0 note 7 , csie1 note 7 , uarta0 to uarta5, uartb0, uartb1, i 2 c00 to i 2 c03, i 2 c04 note 7 , i 2 c05 note 7 , adc, wdt2 4. can controller versions only 5. can controller (2-channel) versions only 6. for details, see chapter 33 option byte function . 7. not available in the pd70f3931 (v850e/sj3-h), 70f39 32 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) remark f x : main oscillation clock frequency f xt : subclock frequency f r : on-chip oscillation clock frequency f plli : pll input clock frequency f pllo : pll output clock frequency f sscgo : sscg output clock frequency f pll : multiplication clock frequency f xx : main clock frequency f clk : internal system clock frequency f cpu : cpu clock frequency f xp : peripheral clock frequency (prescaler 1 input clock frequency) f ie : iebus clock frequency f can : can clock frequency f brg : prescaler 3 output clock frequency
chapter 6 clock generation function user?s manual u19201ej3v0ud 333 (1) main clock oscillator the main resonator oscillates the following frequencies (f x ). (a) plli0 bit of the option byte 0000007bh = 0 (no division) (see chapter 33 option byte function .) ? in clock-through mode f x = 3 to 10 mhz ? in pll mode f x = 3 to 5 mhz (pll: divided by 2 after x8 multiplication) f x = 3 to 4 mhz (pll: x8 multiplication) (b) plli0 bit = 1 (divided by 2) ? in clock-through mode f x = 6 to 10 mhz ? in pll mode f x = 6 to 10 mhz (pll: divided by 2 after x8 multiplication) f x = 6 to 8 mhz (pll: x8 multiplication) the main clock oscillator starts operating after reset release. (2) subclock oscillator the sub-resonator oscillates a frequency of 32.768 khz (f xt ). (3) main clock oscillator stop control this circuit generates a control signal that stops oscillation of the main clock oscillator. oscillation of the main clock oscill ator is stopped in the st op mode or when the pcc.mck bit = 1 (valid only when the pcc.cls bit = 1). (4) internal oscillator oscillates a frequency (f r ) of 220 khz (typ.). oscillation can be stopped by setting t he rcm.rstop bit. however, oscill ation cannot be stopped if stopping the on-chip oscillator has been disabled by setti ng the rmopin bit of the option byte 0000007ah (see chapter 33 option byte function for details) to 1. (5) pll the pll multiplies the pll input clock (f plli ) by 8 (32 mhz max.). the pll output clock (f pllo ) can be selected as the main clock (f xx ). clock-through mode, in which f x is output as is, or pll mode, in which the multiplied clock is output, can be sele cted by setting the pllctl.selpll bit. the pll output clock (f pllo ) can be divided by 2 by setting the ck c.ckdiv0 bit. operation of the pll can also be enabled/stopped by setting the pllctl.pllon bit. the pll either starts operating or enters the locked state after reset release (pllctl.pllon bit = 1, lockr.lock bit = 0). (6) sscg the sscg cannot be used in clock mode 1.
chapter 6 clock generation function user?s manual u19201ej3v0ud 334 (7) prescaler 1 prescaler 1 generates the clock to be supplied to the on-chip peripheral functions (f xp to f xp /1024), using the peripheral clock (f xp ) (= main clock (f xx )) as the source clock. the following blocks are su pplied by this clock. tmp0 to tmp8, tmq0, tmm0 to tmm2, csib0 to csib5, csie0 note 1 , csie1 note 1 , uarta0 to uarta5, uartb0, uartb1, i 2 c00 to i 2 c03, i 2 c04 note 1 , i 2 c05 note 1 , adc, wdt2, can0 note 2 , can1 note 3 , iebus notes 1. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) 2. can controller versions only 3. can controller (2-channel) versions only (8) prescaler 2 this circuit divides the main clock (f xx ). the clock generated by prescaler 2 (f xx to f xx /32) is supplied to the selector that generates the cpu clock (f cpu ) and internal system clock (f clk ). f clk is the clock supplied to the dmac, intc, rom corre ction, rom, ram, and expan ded internal ram block, and can be output from the clkout pin. (9) prescaler 3 this circuit divides the clock generated by the main clock oscillator (f x ) to a specific frequency and supplies that clock to the watch timer, tmm1 , tmm2, and real-time counter block. for details, see chapter 10 watch functions .
chapter 6 clock generation function user?s manual u19201ej3v0ud 335 6.2.2 clock mode 2 figure 6-2. clock generation circuit for clock mode 2 (1/2) sscg 12 idle mode xt1 xt2 clkout x1 x2 f brg f xt f xt f x f sscgo f pll f pllo f xx /32 f xx /16 f xx /8 f xx /4 f xx /2 f xx f xmpll f xp f xx f r f r /8 cpu f cpu f clk f plli selector selector selector selector selector selector selector subclock oscillator port cm prescaler 3 main clock oscillator pll 8 note 1 main clock oscillator stop control idle control prescaler 1 prescaler 2 idle control 1/2 circuit on-chip oscillator 1/8 circuit halt control 1/2 circuit idle control tmm0, watch timer, watchdog timer 2, real-time counter tmm1, tmm2, watch timer, real-time counter pcc.ck2 to ck0 bits pcc.cls, ck3 bit on-chip peripheral functions note 5 iebus controller can controller 0 note 6 , can controller 1 note 7 idle mode f xp to f xp /1024 f ie = f xmpll tmm0 to tmm2, watchdog timer 2 rstop bit halt mode internal system clock note 4 pllctl.selpll bit f can = f xmpll plli0 bit of option byte 0000007bh note 8 pcc.frc bit pcc.mfrc bit pcc.mck bit sscgctl. sscgon bit sfc1 register sscgctl. selsscg bit note 2 sfc0 register stop mode pllctl.pllon bit ckc.ckdiv0 bit note 3 1/2 circuit notes 1. the pll starts operating and ent ers the locked state after reset release (pllctl.pllon bit = 1, lockr.lock bit = 0). do not subsequently st op the pll by software (i.e., do not set the pllctl.pllon bit to 0). under any of the following conditions, however, the pll will stop automatically. ? when a system reset is applied ? when the system enters idle2 or stop mode ? when the cpu is operating on t he subclock and the main clock is stopped (pcc.ck3 bit = 1, pcc.mck bit = 1) the pll starts operation again when the condition is released. be sure to set the oscillation stabilization time and setup time to be inserted after conditions are released to over the lockup time of pll. 2. in clock mode 2, the pll output clock (f pllo ) cannot be selected as the main clock (f xx ). however, when the sscg is stopped by setting the sscg ctl.sscgon bit to 0, the sscgctl.selsscg bit automatically becomes 0, causing f pllo to be selected as the main clock. consequently, when switching from sscg mode to clock-through mode, be sure to first set the pllctl.selpll bit to 0, and then stop the sscg by setting the sscgon bit to 0 after switching modes. similarly, when switching from clock-through mode to sscg mode, first set the sscgon bit to 1 to start up the sscg, wait for the lockup time to elapse, then set the selsscg bit to 1 to select f sscgo before finally setting the selpll bit to 1.
chapter 6 clock generation function user?s manual u19201ej3v0ud 336 figure 6-2. clock generation ci rcuit for clock mode 2 (2/2) notes 3. in clock mode 2, be sure to set the ckc.ckdiv0 bit to 1 (no division). 4. the internal oscillation clock (f r ) is selected when watchdog timer 2 overflows during the oscillation stabilization time. 5. internal peripheral functions: tm p0 to tmp8, tmq0, tmm0 to tmm2, csib0 to csib5, csie0 note 9 , csie1 note 9 , uarta0 to uarta5, uartb0, uartb1, i 2 c00 to i 2 c03, i 2 c04 note 9 , i 2 c05 note 9 , adc, wdt2 6. can controller versions only 7. can controller (2-channel) versions only. 8. for details, see chapter 33 option byte function . 9. not available in the pd70f3931 (v850e/sj3-h), 70f39 32 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) remark f x : main oscillation clock frequency f xt : subclock frequency f r : on-chip oscillation clock frequency f plli : pll input clock frequency f pllo : pll output clock frequency f sscgo : sscg output clock frequency f pll : multiplication clock frequency f xx : main clock frequency f clk : internal system clock frequency f cpu : cpu clock frequency f xmpll : peripheral clock for pll output clock frequency f xp : peripheral clock frequency (prescaler 1 input clock frequency) f ie : iebus clock frequency f can : can clock frequency f brg : prescaler 3 output clock frequency (1) main clock oscillator oscillates a next frequency (f x ). (a) plli0 bit of the option byte 0000007bh (see chapter 33 option byte function for details) = 0 (no division) ? f x = 3.66 to 4 mhz (b) plli0 bit = 1 (divided by 2) ? f x = 7.32 to 8 mhz the main clock oscillator starts operating after reset release. (2) subclock oscillator the subclock oscillator oscillat es a frequency of 32.768 khz (f xt ). (3) main clock oscillator stop control this circuit generates a control signal that stops oscillation of the main clock oscillator. oscillation of the main clock oscill ator is stopped in the st op mode or when the pcc.mck bit = 1 (valid only when the pcc.cls bit = 1).
chapter 6 clock generation function user?s manual u19201ej3v0ud 337 (4) internal oscillator oscillates a frequency (f r ) of 220 khz (typ.). oscillation can be stopped by setting t he rcm.rstop bit. however, oscill ation cannot be stopped if stopping the on-chip oscillator has been disabled by setti ng the rmopin bit of the option byte 0000007ah (see chapter 33 option byte function for details) to 1. (5) pll the pll divides the pll input clock (f plli ) by 2 after multiplies by 8 (16 mhz max.) to generate a peripheral clock (f xp ). (6) sscg the sscg multiplies the pll input clock (f plli ) by 12 (48 mhz max.). the sscg output clock (f sscgo ) can be selected as the main clock (f xx ). clock-through mode, in which f x is output as is, or sscg mode, in which f sscgo is output, can be selected by setting the pllctl.selpll bit. in sscg mode, the frequency modulation function can be used to effectively reduce the peak emi noise value. frequency modulation/no frequency m odulation, the frequency modulation ratio (down spread method), and the frequency cycle can be set only once after reset. whether to operate or stop the sscg can also be cont rolled using the sscgctl.sscgon bit. note that the setting of this bit is only valid when the pllctl.pllon bit is set to 1. the sscg stops operating after reset. (7) prescaler 1 prescaler 1 generates the clock to be supplied to the on-chip peripheral functions (f xp to f xp /1024), using the peripheral clock (f xp ) (= pll output clock for peripheral clock (f xmpll ) divided by 2) as the source clock. the following blocks are su pplied by this clock. tmp0 to tmp8, tmq0, tmm0 to tmm2, csib0 to csib5, csie0 note 1 , csie1 note 1 , uarta0 to uarta5, uartb0, uartb1, i 2 c00 to i 2 c03, i 2 c04 note 1 , i 2 c05 note 1 , adc, wdt2 note that the pll output clock for the peripheral clock (f xmpll ) is supplied directly to the can0 note 2 , can1 note 3 , and iebus blocks. notes 1. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) 2. can controller versions only 3. can controller (2-channel) versions only (8) prescaler 2 this circuit divides the main clock (f xx ). the clock generated by prescaler 2 (f xx to f xx /32) is supplied to the selector that generates the cpu clock (f cpu ) and internal system clock (f clk ). f clk is the clock supplied to the dmac, intc, rom correction, rom, ram, and expanded internal ram blocks, and can be output from the clkout pin. (9) prescaler 3 this circuit divides the clock generated by the main clock oscillator (f x ) to a specific frequency and supplies that clock to the watch timer, tmm1, tmm2, and real-time counter (rtc) blocks. for details, see chapter 10 watch functions .
chapter 6 clock generation function user?s manual u19201ej3v0ud 338 6.2.3 clock mode 3 figure 6-3. clock generation circuit for clock mode 3 (1/2) sscg 8, 12 xt1 xt2 clkout x1 x2 f brg f xt f xt f x f sscgo f pll f pllo f xx /32 f xx /16 f xx /8 f xx /4 f xx /2 f xx f xmpll f xp f xx f ie = f xp f can = f xp f r f r /8 cpu f cpu f clk f plli selector selector selector selector selector selector selector subclock oscillator port cm prescaler 3 main clock oscillator pll 8 note 1 main clock oscillator stop control idle control prescaler 1 prescaler 2 idle control 1/2 circuit on-chip oscillator 1/8 circuit halt control 1/2 circuit idle control tmm0, watch timer, watchdog timer 2, real-time counter tmm1, tmm2, watch timer, real-time counter pcc.ck2 to ck0 bits pcc.cls, ck3 bit on-chip peripheral functions note 5 iebus controller can controller 0 note 6 , can controller 1 note 7 idle mode f xp to f xp /1024 tmm0 to tmm2, watchdog timer 2 rstop bit halt mode internal system clock note 4 pllctl.selpll bit idle mode plli0 bit of option byte 0000007bh note 8 pcc.frc bit pcc.mfrc bit pcc.mck bit sscgctl. sscgon bit sfc1 register sscgctl. selsscg bit note 2 sfc0 register stop mode pllctl.pllon bit ckc.ckdiv0 bit note 3 notes 1. the pll starts operating and ent ers the locked state after reset release (pllctl.pllon bit = 1, lockr.lock bit = 0). do not subsequently st op the pll by software (i.e., do not set the pllctl.pllon bit to 0). under any of the following conditions, however, the pll will stop automatically. ? when a system reset is applied ? when the system enters idle2 or stop mode ? when the cpu is operating on t he subclock and the main clock is stopped (pcc.ck3 bit = 1, pcc.mck bit = 1) the pll starts operation again when the condition is released. be sure to set the oscillation stabilization time and setup time to be inserted after conditions are released to over the lockup time of pll. 2. in clock mode 3, the pll output clock (f pllo ) cannot be selected as the main clock (f xx ). however, when the sscg is stopped by setting the sscg ctl.sscgon bit to 0, the sscgctl.selsscg bit automatically becomes 0, causing f pllo to be selected as the main clock. consequently, when switching from sscg mode to clock-through mode, be sure to first set the pllctl.selpll bit to 0, and then stop the sscg by setting the sscgon bit to 0 after switching modes. similarly, when switching from clock-through mode to sscg mode, first set the sscgon bit to 1 to start up the sscg, wait for the lockup time to elapse, then set the selsscg bit to 1 to select f sscgo before finally setting the selpll bit to 1.
chapter 6 clock generation function user?s manual u19201ej3v0ud 339 figure 6-3. clock generation circuit for clock mode 3 (2/2) notes 3. in clock mode 3, be sure to set the ckc.ckdiv0 bit to 1 (no division). 4. the internal oscillation clock (f r ) is selected when watchdog timer 2 overflows during the oscillation stabilization time. 5. internal peripheral functions: tmp0 to tmp8 , tmq0, tmm0 to tmm2, csib0 to csib5, csie0 note 9 , csie1 note 9 , uarta0 to uarta5, uartb0, uartb1, i 2 c00 to i 2 c03, i 2 c04 note 9 , i 2 c05 note 9 , adc, wdt2 6. can controller versions only 7. can controller (2-channel) versions only 8. for details, see chapter 33 option byte function . 9. not available in the pd70f3931 (v850e/sj3 -h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) remark f x : main oscillation clock frequency f xt : subclock frequency f r : on-chip oscillation clock frequency f plli : pll input clock frequency f pllo : pll output clock frequency f sscgo : sscg output clock frequency f pll : multiplication clock frequency f xx : main clock frequency f clk : internal system clock frequency f cpu : cpu clock frequency f xmpll : peripheral clock for pll output clock frequency f xp : peripheral clock frequency (prescaler 1 input clock frequency) f ie : iebus clock frequency f can : can clock frequency f brg : prescaler 3 output clock frequency (1) main clock oscillator oscillates a next frequency (f x ). (a) plli0 bit of the option byte 0000007bh = 0 (no division) (see chapter 33 option byte function .) ? f x = 3.66 to 4 mhz (b) plli0 bit = 1 (divided by 2) ? f x = 7.32 to 8 mhz the main clock oscillator starts operating after reset release. (2) subclock oscillator the subclock oscillator oscillat es a frequency of 32.768 khz (f xt ).
chapter 6 clock generation function user?s manual u19201ej3v0ud 340 (3) main clock oscillator stop control this circuit generates a control signal that stops oscillation of the main clock oscillator. oscillation of the main clock oscill ator is stopped in the st op mode or when the pcc.mck bit = 1 (valid only when the pcc.cls bit = 1). (4) internal oscillator oscillates a frequency (f r ) of 220 khz (typ.). oscillation can be stopped by setting t he rcm.rstop bit. however, oscill ation cannot be stopped if stopping the on-chip oscillator has been disabled by setti ng the rmopin bit of the option byte 0000007ah (see chapter 33 option byte function for details) to 1. (5) pll the pll multiplies the pll input clock (f plli ) by 8 (32 mhz max.) to generate a peripheral clock (f plli ). (6) sscg the sscg multiplies the pll input clock (f plli ) by 8 (32 mhz max.). the sscg output clock (f sscgo ) can be selected as the main clock (f xx ). clock-through mode, in which f x is output as is, or sscg mode, in which f sscgo is output, can be selected by setting the pllctl.selpll bit. in sscg mode, the frequency modulation function can be used to effectively reduce the peak emi noise value. frequency modulation/no frequency m odulation, the frequency modulation ratio (down spread method), and the frequency cycle can be set only once after reset. whether to operate or stop the sscg can also be c ontrolled using the sscgctl. sscgon bit. note that the setting of this bit is only valid when the pllctl.pllon bit is set to 1. the sscg stops operating after reset. (7) prescaler 1 prescaler 1 generates the clock to be supplied to the on-chip peripheral functions (f xp to f xp /1024), using the peripheral clock (f xp ) (= pll output clock for peripheral clock (f xmpll )) as the source clock. the following blocks are su pplied by this clock. tmp0 to tmp8, tmq0, tmm0 to tmm2, csib0 to csib5, csie0 note 1 , csie1 note 1 , uarta0 to uarta5, uartb0, uartb1, i 2 c00 to i 2 c03, i 2 c04 note 1 , i 2 c05 note 1 , adc, wdt2, can0 note 2 , can1 note 3 , iebus notes 1. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) 2. can controller versions only 3. can controller (2-channels) versions only (8) prescaler 2 this circuit divides the main clock (f xx ). the clock generated by prescaler 2 (f xx to f xx /32) is supplied to the selector that generates the cpu clock (f cpu ) and internal system clock (f clk ). f clk is the clock supplied to the dmac, intc, rom correction, rom, ram, and expanded internal ram blocks, and can be output from the clkout pin. (9) prescaler 3 this circuit divides the clock generated by the main clock oscillator (f x ) to a specific frequency and supplies that clock to the watch timer, tmm1, tmm2, and real-time counter (rtc) blocks. for details, see chapter 10 watch functions .
chapter 6 clock generation function user?s manual u19201ej3v0ud 341 6.2.4 clock mode 4 figure 6-4. clock generation circuit for clock mode 4 (1/2) sscg 8 xt1 xt2 clkout x1 x2 f brg f xt f xt f x f sscgo f pll f pllo f xx /32 f xx /16 f xx /8 f xx /4 f xx /2 f xx f xmpll f xp f xx f r f r /8 cpu f cpu f clk f ie = f xp f can = f xp f plli selector selector selector selector selector selector selector subclock oscillator port cm prescaler 3 main clock oscillator pll 8 note 1 main clock oscillator stop control idle control prescaler 1 prescaler 2 idle control 1/2 circuit on-chip oscillator 1/8 circuit halt control 1/2 circuit 1/2 circuit idle control tmm0, watch timer, watchdog timer 2, real-time counter tmm1, tmm2, watch timer, real-time counter pcc.ck2 to ck0 bits pcc.cls, ck3 bit on-chip peripheral functions note 5 iebus controller note 6 can controller 0 note 7 can controller 1 note 8 idle mode f xp to f xp /1024 tmm0 to tmm2, watchdog timer 2 rstop bit halt mode internal system clock note 4 pllctl.selpll bit idle mode plli0 bit of option byte 0000007bh note 9 pcc.frc bit pcc.mfrc bit pcc.mck bit sscgctl. sscgon bit sfc1 register sscgctl. selsscg bit note 2 sfc0 register stop mode pllctl.pllon bit ckc.ckdiv0 bit note 3 notes 1. the pll starts operating and enters the locked st ate after reset release (pllctl.pllon bit = 1, lockr.lock bit = 0). do not subsequently stop the pll by software (i.e., do not set the pllctl.pllon bit to 0). under any of the following conditions, however, the pll will stop automatically. ? when a system reset is applied ? when the system enters idle2 or stop mode ? when the cpu is operating on the subclock and t he main clock is stopped (pcc.ck3 bit = 1, pcc.mck bit = 1) the pll starts operation again when the condition is released. be sure to set the oscillation stabilization time and setup time to be inserted after conditions are released to over the lockup time of pll. 2. in clock mode 4, the pll output clock (f pllo ) cannot be selected as the main clock (f xx ). however, when the sscg is stopped by setting the sscgctl.sscgon bit to 0, the sscgctl.selsscg bit automatically becomes 0, causing f pllo to be selected as the multiplication clock. consequently, when swit ching from sscg mode to clock-through mode, be sure to first set the pllctl.selpll bit to 0, and then stop the sscg by setting the sscgon bit to 0 after switching modes. similarly, when switch ing from clock-through mode to sscg mode, first set the sscgon bit to 1 to start up the sscg, wa it for the lockup time to elapse, then set the selsscg bit to 1 to select f sscgo before finally setting the selpll bit to 1.
chapter 6 clock generation function user?s manual u19201ej3v0ud 342 figure 6-4. clock generation circuit for clock mode 4 (2/2) notes 3. in clock mode 4, be sure to set the ckc.ckdiv0 bit to 1 (no division). 4. the internal oscillation clock (f r ) is selected when watchdog timer 2 overflows during the oscillation stabilization time. 5. internal peripheral functions: tmp0 to tmp8 , tmq0, tmm0 to tmm2, csib0 to csib5, csie0 note 10 , csie1 note 10 , uarta0 to uarta5, uartb0, uartb1, i 2 c00 to i 2 c03, i 2 c04 note 10 , i 2 c05 note 10 , adc, wdt2 6. the iebus controller cannot be used in clock mode 4. 7. can controller versions only 8. can controller (2-channel) versions only 9. in clock mode 4, be sure to set the plli0 bit of the option byte 0000007bh to 0 (no division). 10. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) remark f x : main oscillation clock frequency f xt : subclock frequency f r : on-chip oscillation clock frequency f plli : pll input clock frequency f pllo : pll output clock frequency f sscgo : sscg output clock frequency f pll : multiplication clock frequency f xx : main clock frequency f clk : internal system clock frequency f cpu : cpu clock frequency f xmpll : peripheral clock for pll output clock frequency f xp : peripheral clock frequency (prescaler 1 input clock frequency) f ie : iebus clock frequency f can : can clock frequency f brg : prescaler 3 output clock frequency (1) main clock oscillator oscillates a frequency (f x ) of 5.22 to 6 mhz. the main clock oscillator starts operating after reset release. (2) subclock oscillator the subclock oscillator oscillat es a frequency of 32.768 khz (f xt ). (3) main clock oscillator stop control this circuit generates a control signal that stops oscillation of the main clock oscillator. oscillation of the main clock oscill ator is stopped in the st op mode or when the pcc.mck bit = 1 (valid only when the pcc.cls bit = 1).
chapter 6 clock generation function user?s manual u19201ej3v0ud 343 (4) internal oscillator oscillates a frequency (f r ) of 220 khz (typ.). oscillation can be stopped by setting t he rcm.rstop bit. however, oscill ation cannot be stopped if stopping the on-chip oscillator has been disabled by setti ng the rmopin bit of the option byte 0000007ah (see chapter 33 option byte function for details) to 1. (5) pll the pll divides the pll input clock (f plli ) by 2 after multiplies by 8 (24 mhz max.) to generate a peripheral clock (f xp ). (6) sscg the sscg multiplies the pll input clock (f plli ) by 8 (32 mhz max.). the sscg output clock (f sscgo ) can be selected as the main clock (f xx ). clock-through mode, in which f x is output as is, or sscg mode, in which f sscgo is output, can be selected by setting the pllctl.selpll bit. in sscg mode, the frequency modulation function can be used to effectively reduce the peak emi noise value. frequency modulation/no frequency m odulation, the frequency modulation ratio (down spread method), and the frequency cycle can be set only once after reset. whether to operate or stop the sscg can also be c ontrolled using the sscgctl. sscgon bit. note that the setting of this bit is only valid when the pllctl.pllon bit is set to 1. the sscg stops operating after reset. (7) prescaler 1 prescaler 1 generates the clock to be supplied to the on-chip peripheral functions (f xp to f xp /1024), using the peripheral clock (f xp ) (= pll output clock for peripheral clock (f xmpll ) divided by 2) as the source clock. the following blocks are su pplied by this clock. tmp0 to tmp8, tmq0, tmm0 to tmm2, csib0 to csib5, csie0 note 1 , csie1 note 1 , uarta0 to uarta5, uartb0, uartb1, i 2 c00 to i 2 c03, i 2 c04 note 1 , i 2 c05 note 1 , adc, wdt2, can0 note 2 , can1 note 3 , iebus note 4 notes 1. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) 2. can controller versions only 3. can controller (2-channel) versions only 4. the iebus controller cannot be used because the frequency of the peripheral clock supplied to the iebus controller cannot be divided to equal a frequency of 6.29 mhz. (8) prescaler 2 this circuit divides the main clock (f xx ). the clock generated by prescaler 2 (f xx to f xx /32) is supplied to the selector that generates the cpu clock (f cpu ) and internal system clock (f clk ). f clk is the clock supplied to the dmac, intc, rom correction, rom, ram, and expanded internal ram blocks, and can be output from the clkout pin. (9) prescaler 3 this circuit divides the clock generated by the main clock oscillator (f x ) to a specific frequency and supplies that clock to the watch timer, tmm1, tmm2, and real-time counter (rtc) blocks. for details, see chapter 10 watch functions .
chapter 6 clock generation function user?s manual u19201ej3v0ud 344 6.2.5 clock mode setting the clock mode can be set by using the selcm2 to selcm0 bits of the option byte 0000007bh. for details, see chapter 33 option byte function . caution the clock mode cannot be changed during operation. table 6-2. clock mode setting setting of selcm2 to selcm0 bits of option byte 0000007bh clock mode selcm2 selcm1 selcm0 clock mode 1 0 0 0 clock mode 2 1 1 1 clock mode 3 1 0 0 clock mode 4 1 1 0 when using clock modes 2, 3, or 4, set appropriate values to the ckc and sfc0 registers while the clock modes are in their initial status following re set release; that is, in clock-throu gh mode and with sscg operation stopped. at this time, also be sure to make the sscg frequency modul ation/no modulation, frequency modulation ratio (down spread method) and frequency cycle settings using the sfc1 register. in addition, be sure to set the ckc, sfc0, and sfc1 regi sters only once after reset is released. these settings cannot be changed during operation. for details of the initial settings when using clock modes 2, 3, and 4, see 6.4.4 (1) initial settings for using clock modes 2, 3, and 4 .
chapter 6 clock generation function user?s manual u19201ej3v0ud 345 6.3 registers (1) processor clock control register (pcc) the pcc register is a special register. data can be wr itten to this register only in combination of specific sequences (see 3.4.8 special registers ). this register can be read or written in 8-bit or 1-bit units. reset sets this register to 03h. (1/2) frc used not used frc 0 1 use of subclock on-chip feedback resistor pcc mck mfrc cls note ck3 ck2 ck1 ck0 oscillation enabled oscillation stopped mck 0 1 main clock oscillator control used not used mfrc 0 1 use of main clock on-chip feedback resistor after reset: 03h r/w address: fffff828h main clock operation subclock operation cls note 0 1 status of cpu clock (f cpu ) even if the mck bit is set (1) while the system is operating with the main clock as the cpu clock, the operation of the main clock does not stop. it stops after the cpu clock has been changed to the subclock. before setting the mck bit from 0 to 1, stop the on-chip peripheral functions operating with the main clock. when the main clock is stopped and the device is operating with the subclock, clear (0) the mck bit and secure the oscillation stabilization time by software before switching the cpu clock to the main clock or operating the on-chip peripheral functions. ? ? ? < > < > < > note the cls bit is a read-only bit.
chapter 6 clock generation function user?s manual u19201ej3v0ud 346 (2/2) f xx f xx /2 f xx /4 f xx /8 f xx /16 f xx /32 setting prohibited f xt ck2 0 0 0 0 1 1 1 clock selection (f clk /f cpu ) ck1 0 0 1 1 0 0 1 ck0 0 1 0 1 0 1 ck3 0 0 0 0 0 0 0 1 cautions 1. do not change the cpu clo ck (by using the ck3 to ck0 bits) while clkout is being output. 2. when manipulating the ck3 bit, do not change the set values of the ck2 to ck0 bits. 3. when the main clock oscillator is stopped, be su re to stop operation of the on-chip peripheral functions th at are operating on the peripheral clock (f xp , f ie , f can ). 4. when setting subclock operation mode (ck3 bit = 1), if the following condition is not satisfied, make sure to satisfy it by changing the ck2 to ck0 bit settings before shifti ng to subclock operation mode. internal system clock (f clk ) > subclock (f xt : 32.768 khz) 4 remark : don?t care
chapter 6 clock generation function user?s manual u19201ej3v0ud 347 (2) internal oscillati on mode register (rcm) the rcm register is an 8-bit register that sets the operation mode of the internal oscillator. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 rcm 0 0 0 00 0 rstop internal oscillator oscillation internal oscillator stopped rstop 0 1 oscillation/stop of internal oscillator after reset: 00h r/w address: fffff80ch < > cautions 1. the internal oscillator cannot be stopped while the cpu is operating on the internal oscillation clock (ccl s.cclsf bit = 1). do not set the rstop bit to 1. 2. the internal oscillator oscillat es if the ccls.cclsf bit is set to 1 (when wdt overflow occurs duri ng oscillation stabilization) even when the rstop bit is set to 1. at this time, the rstop bit remains being set to 1. 3. the setting of the rstop bit is only valid when stopping the on-chip oscillator has been enabled by se tting the rmopin bit of the option byte 0000007ah (see chapter 33 option byte function for details) to 0. if stopping the on-chip oscillator has been disabled by setting the rmopin bit of the optio n byte 0000007ah to 1, the rstop bit setting is invalid. 4. be sure to set bits 1 to 7 to ?0?. (3) cpu operation clock status register (ccls) the ccls register indicates the stat us of the cpu operation clock. this register is read-only, in 8-bit or 1-bit units. reset sets this register to 00h. 0 ccls 0 0 0 0 0 0 cclsf after reset: 00h note r address: fffff82eh operating on main clock (f x ) or subclock (f xt ). operating on internal oscillation clock (f r ). cclsf 0 1 cpu operation clock status note if wdt overflow occurs during oscillation st abilization time after a reset is released, the cpu operates on the internal oscillation clock (f r ). at this time, the cclsf bit is set to 1 and the reset value is 01h.
chapter 6 clock generation function user?s manual u19201ej3v0ud 348 (4) pll control register (pllctl) the pllctl register is an 8-bit regi ster that controls the pll function. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 01h. 0 pllctl 0 0 0 00 selpll pllon pll stopped pll operating (after pll operation starts, a lockup time is required for frequency stabilization) pllon 0 1 pll operation stop register clock-through mode pll mode or sscg mode selpll 0 1 cpu operation clock selection register after reset: 01h r/w address: fffff82ch < > < > cautions 1. in clock modes 2, 3, and 4, do not stop the pll by software (i.e., do not set the pllctl.pllon bit to 0). 2. when stopping pll operation in clo ck mode 1, first set the clock through mode (selpll bit = 0), wait for at l east 8 clocks, and th en stop the pll (pllon bit = 0). when the pllon bit is cleared to 0, the selpll bit is automatically cleared to 0 (clock-through mode), but be sure to stop the pll in the above procedure. 3. when stopping sscg operation in clock modes 2, 3, and 4, first set the clock- through mode (selpll bit = 0), then stop the sscg (by setting the sscgctl.sscgon bit to 0) after waiting for at l east 8 clocks to elapse. 4. set the selpll bit to 1 after the p ll clock frequency or sscg clock frequency has stabilized (locked state). if the pll frequency is not stable (lockr.lock bit = 1 (unlocked state)), even if 1 is written to the selpll bit, 0 will end up being written. also, be sure to properly secure the sscg lockup time by software.
chapter 6 clock generation function user?s manual u19201ej3v0ud 349 (5) clock control register (ckc) the ckc register is a special register . data can be written to this regist er only in a combination of specific sequence (see 3.4.8 special registers ). the ckc register sets the multiplication clock (f pll ). this register can be read or written in 8-bit or 1-bit units. reset sets this register to 0ah. 0 ckc 0 0 0 1 0 1 ckdiv0 after reset: 0ah r/w address: fffff822h f pll = f pllo /2 (divided by 2 after multiplication) f pll = f pllo or f sscgo (no division after multiplication) ckdiv0 0 1 selection of multiplication clock cautions 1. the ckc.ckdiv0 bit can be s witched in clock m ode 1. however, when setting the ckdiv0 bit, be sure to set the clo ck-through mode and stop the pll. 2. in clock modes 2, 3, and 4, be sure to set the ckdiv0 bit to 1 (no division) immediately after reset is released, while the clock modes are still in clock-through mode (pllctl.selpll bit = 0). set the ckc register only once after reset is released. these settings cannot be changed during opera tion. for details of the initial settings, see 6.4.4 (1) initial settings for using clock modes 2, 3, and 4. 3. be sure to set bits 1 and 3 to ?1? and set bits 2 and 4 to 7 to ?0?. remark when using pll mode in clock mode 1, the peripheral clock will be identical to the main clock. therefore, both the peripheral clock and the main clock will be subject to the division setting made by the ckdiv0 bit.
chapter 6 clock generation function user?s manual u19201ej3v0ud 350 (6) lock register (lockr) phase lock occurs at a given frequency following powe r application or immediately after the stop mode is released, and the time required for stabilization is the lockup time (frequency stabilization time). this state until stabilization is called the lock up status, and the stabilized state is called the locked status. the lockr register includes a lock bit that re flects the pll frequency stabilization status. this register is read-only, in 8-bit or 1-bit units. reset sets this register to 00h. 0 lockr 0 0 0 00 0 lock locked status unlocked status lock 0 1 pll lock status check after reset: 00h r address: fffff824h < > caution the lock register does not reflect th e lock status of the pll in real time. the set/clear conditions are as follows. [set conditions] ? upon system reset note ? in idle2 or stop mode ? upon setting of pll stop (clearing of pllctl.pllon bit to 0) ? upon stopping main clock and using cpu with subclock (setting of pcc.ck3 bit to 1 and setting of pcc.mck bit to 1) ? the main clock oscillator is not oscillati ng (when operating on the internal oscillation clock (f r ) (ccls.cclsf bit is set to 1)) note this register is set to 01h by reset and cleared to 00h after the reset has been released and the oscillation st abilization time has elapsed. [clear conditions] ? upon overflow of oscillation stabilization time following reset release (osts register default time (see 26.2 (3) oscillation stabilizati on time select register (osts) )) ? upon oscillation stabilization timer overfl ow (time set by osts register) following stop mode release, when the stop mode wa s set in the pll operating status ? upon pll lockup time timer overflow (time set by plls register) when the pllctl.pllon bit is changed from 0 to 1 ? after the setup time inserted upon release of the idle2 mode is released (time set by the osts register) when the idle2 mode is set during pll operation.
chapter 6 clock generation function user?s manual u19201ej3v0ud 351 (7) pll lockup time specification register (plls) the plls register is an 8-bit regist er used to select the pll lockup time when the pllctl.pllon bit is changed from 0 to 1. this register can be read or written in 8-bit units. reset sets this register to 03h. 0 2 10 /f x 2 11 /f x 2 12 /f x 2 13 /f x (initial value) plls1 0 0 1 1 plls0 0 1 0 1 selection of pll lockup time plls 0 0 0 0 0 plls1 plls0 after reset: 03h r/w address: fffff6c1h cautions 1. set so that the lockup time is 800 s or longer. 2. do not change the plls regi ster setting during the lockup period. 3. be sure to set bits 2 to 7 to ?0?.
chapter 6 clock generation function user?s manual u19201ej3v0ud 352 (8) sscg control register (sscgctl) the sscgctl register is an 8-bit register used to control the sscg. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 pll output clock (f pllo ) sscg output clock (f sscgo ) selsscg 0 1 selection of multiplication clock (f pll ) to set main clock (f xx ) sscgctl 0 0 0 0 0 selsscg sscgon sscg stopped sscg operating (lockup time required before operation starts) sscgon 0 1 sscg operation control after reset: 00h r/w address: fffff3f0h < > < > cautions 1. the sscg cannot be used in cl ock mode 1. do not change the initial settings of the sscgctl re gister in this mode. 2. in clock mod es 2, 3, and 4, the pll output clock (f pllo ) cannot be selected for the mult iplication clock (f pll ). however, when the sscg is stopped by setting the sscgctl.sscgon bit to 0, the sscgctl.selsscg bit automatically becomes 0, causing f pllo to be selected as the multiplication clock. consequently, when switching from sscg mode to clock-through mode, be sure to first set the pllctl.selpll bit to 0, and then stop the sscg by setting the sscgon bit to 0 after switching mod es. similarly, when switching from clock-through mode to sscg mode, first set the sscgon bit to 1 to start up the sscg, wait for th e lockup time to elapse, then set the selsscg bit to 1 to select f sscgo before finally setting the selpll bit to 1. 3. when the pll is stopped (pllctl.pllon bit = 0), the sscg will not operate even if the sscgctl.sscgon bit is set to 1. note, however, that the pll cannot be stoppe d in clock modes 2, 3, and 4. 4. be sure to set bits 2 to 7 to ?0?.
chapter 6 clock generation function user?s manual u19201ej3v0ud 353 (9) sscg frequency control register 0 (sfc0) the sfc0 register is a special register. data can be wr itten to this register only in a combination of specific sequences (see 3.4.8 special registers ). the sfc0 register is an 8-bit register used to control the main oscillation clock frequency (f x ) of the sscg. set the following values to this register in accordance with the clock mode used. this register can be read or written in 8-bit units. (address: fffff3f1h, initial value: 00h) cautions 1. the sscg cannot be used in clock mode 1. do not change the initial settings of the sfc0 register in this mode. 2. in clock modes 2, 3, and 4, be sure to make the sfc0 re gister settings immediately after reset is released, while the clock modes are still in clock-through mode (pllctl.selpll bit = 0) and the sscg is stopped (sscgctl.sscgon bit = 0). in addition, be sure to set the sfc0 register only once after reset is released. these settings cannot be changed during operation. for details, see 6.4.4 (1) initial settings fo r using clock modes 2, 3, and 4. clock mode sfc0 register setting plli0 bit setting value of option byte 0000007bh set sscg multiplication factor/sscg main oscillation clock frequency (f x ) 0 clock mode 1 (pll output clock (x8 multiplication, 32 mhz max.) can be selected as main clock (f xx )) setting prohibited 1 sscg mode cannot be used. 0 x12 multiplication/3.66 to 4 mhz clock mode 2 (sscg output clock (x12 multiplication, 48 mhz max.) can be selected as main clock (f xx )) 34h 1 x12 multiplication/7.32 to 8 mhz 0 x8 multiplication/3.66 to 4 mhz (sscg output clock (x8 multiplication, 32 mhz max.) can be selected as main clock (f xx )) 2ah 1 x8 multiplication/7.32 to 8 mhz 0 x12 multiplication/3.66 to 4 mhz clock mode 3 (sscg output clock (x12 multiplication, 48 mhz max.) can be selected as main clock (f xx )) 34h 1 x12 multiplication/7.32 to 8 mhz 0 x8 multiplication/5.22 to 6 mhz clock mode 4 (sscg output clock (x8 multiplication, 48 mhz max.) can be selected as main clock (f xx )) 54h 1 setting prohibited
chapter 6 clock generation function user?s manual u19201ej3v0ud 354 (10) sscg frequency control register 1 (sfc1) the sfc1 register is a special register. data can be wri tten to this register only in a combination of specific sequences (see 3.4.8 special registers ). the sfc1 register is an 8-bit register used to c ontrol the frequency modulation specification, frequency modulation ratio, and modulation cycle of the sscg. this register can be read or written in 8-bit units. reset sets this register to 00h. sfc17 no modulation modulation sfc17 0 1 sscg frequency modulation specification sfc1 0 sfc15 sfc14 0 0 sfc11 sfc10 after reset: 00h r/w address: fffff3f2h ? 1% (typ. value) ? 2% (typ. value) ? 4% (typ. value) setting prohibited sfc14 0 1 0 1 selection of sscg output frequency modulation ratio sfc15 0 0 1 1 40 khz (typ. value) 50 khz (typ. value) 60 khz (typ. value) setting prohibited sfc10 0 1 0 1 selection of sscg output modulation cycle sfc11 0 0 1 1 ? 1%, ? 2%, ? 4% frequency without modulation cautions 1. the sscg cannot be used in cl ock mode 1. do not change the initial settings of the sfc1 re gister in this mode. 2. in clock modes 2, 3, and 4, be sure to make the sfc1 register settings immediately after reset is released, while the clock modes are still in clock-through mode (pllctl.sel pll bit = 0) and the sscg is stopped (sscgctl.sscgon bit = 0). in addition, be sure to set the sfc1 register only once after r eset is released. these settings cannot be changed during operation. for details, see 6.4.4 (1) initial settings for using clock modes 2, 3, and 4. 3. be sure to set bits 2, 3, and 6 to ?0?.
chapter 6 clock generation function user?s manual u19201ej3v0ud 355 6.4 operation 6.4.1 operation of each clock the operating status of each clock is shown in the table below. table 6-3. clock operating statuses cls bit = 0, mck bit = 0, selpll bit = 0 cls bit = 0, mck bit = 0, selpll bit = 1 cls bit = 1, mck bit = 0, selpll bit = 0/1 cls bit = 1, mck bit = 1, selpll bit = 0/1 register setting and operating status target clock <1> <2> <3> <4> <5> <6> <7> <8> <9> <3> <4> <5> <6> <7> <8> <9> <2> <10> <11> <10> <11> main clock oscillator (f x ) subclock oscillator (f xt ) cpu clock (f cpu ) note 1 note 2 note 1 note 2 note 1 main clock (f xx ) note 1 note 1 note 2 note 1 note 1 internal system clock (f clk ) note 1 note 2 note 1 note 2 note 1 peripheral clock (f xp to f xp /1024) wt clock (main) note 1 note 1 note 1 note 1 wt clock (sub) wdt2 clock (on- chip oscillation) wdt2 clock (main) wdt2 clock (sub) <1> reset pin input <2> during counting of oscillation stabilization time <3> main clock operation mode <4> halt mode <5> idle1 mode <6> idle2 mode <7> during counting of setup time after idle2 mode release <8> stop mode <9> during counting of oscillation st abilization time after stop mode release <10> subclock operation mode <11> sub-idle mode notes 1. changes to after the oscillation stabilization time has elapsed. 2. changes to after the setup time has elapsed. remark : operable : stopped
chapter 6 clock generation function user?s manual u19201ej3v0ud 356 6.4.2 clock output function the clock output function is used to output the internal system clock (f clk ) from the clkout pin. the internal system clock (f clk ) is selected by using the pcc.ck3 to pcc.ck0 bits. the clkout pin shares pin wit h the pcm1 pin and functions as a clock out put pin if so specif ied by the control register of port cm. the status of the clko ut pin is the same as the in ternal system clock in table 6-3 and the pin can output the clock when it is in the operable status. it outputs a low level in the stopped stat us. however, the clkout pin is in the port mode (pcm1 pin: input mode) after reset and until it is set in the output mode. ther efore, the stat us of the pin is high impedance.
chapter 6 clock generation function user?s manual u19201ej3v0ud 357 6.4.3 procedure for setting clock genera tion function for using clock mode 1 figure 6-5. procedure for setting clock ge neration function for using clock mode 1 pcc.ck3 bit = 1 watchdog timer 2 overflow occurred during oscillation stabilization time osts register overflow wait for pcc.cls bit to change from 0 to 1 pllctl.selpll bit = 0 nop 8 pllctl.selpll bit = 1 pcc.ck3 bit = 0 wait for pcc.cls bit to change from 1 to 0 pcc.mck bit = 1 pcc.mfrc bit = 1 pcc.mfrc bit = 0 pcc.mck bit = 0 software-based wait for main clock oscillator oscillation stabilization time to elapse main clock operation subclock operation standby mode reset halt mode idle1 mode idle2 mode stop mode pll mode pll: operating clock-through mode pll: operating note 1 subclock operation mode main clock oscillator: operating pll: operating note 1 subclock operation mode main clock oscillator: stopped pll: stopped note 2 sub-idle mode wait for main clock oscillator oscillation stabilization time to elapse on-chip oscillator operation (emergency operation mode) notes 1. when the pllctl.pllon bit is set to 0, the pll st ops operating. after setting the pllon bit to 1 again (pll operable), it is necessary to wait for the pll lockup time to elapse before starting pll operation. 2. when the main clock oscillator is stopped, the p ll automatically stops wit h the pllctl.pllon bit still being set to 1 (pll operable). cautions 1. when stopping operation of the main cl ock oscillator, be sure to also stop operation of the on-chip peripheral functions operating on the main clock (= peripheral clock). 2. the ckc.ckdiv0 bit can be switched in clock mode 1. when setting the ckdiv0 bit, however, be sure to set clock-th rough mode and stop the pll. 3. the sscg cannot be used in clock mode 1. do not change the initial settings of sscg related registers (sscgctl, sfc0, sfc1) in this mode. remark see chapter 26 standby function for details of the areas marked .
chapter 6 clock generation function user?s manual u19201ej3v0ud 358 (1) switching from clock -through mode to pll mode <1> plls register setting: lockup time selection set so that the lockup time is 800 s or longer. <2> pllctl.pllon bit 1: pll operation enabled <3> wait until lockr.lock bit = 0: wait for pll lockup time to elapse <4> pllctl.selpll bit 1: multiplication clock (f pll = f pllo ) selected as main clock (f xx ) (pll mode) caution when the pll is stopped (pllctl.pllon bit = 0), settings <1> to <3> are necessary. if the pll is already operating and the lockup time has elapsed, only setting <4> is needed to switch to pll mode. th e pll is in the locked state after reset release. (2) switching from pll mode to clock-through mode <1> pllctl.selpll bit 0: main oscillation clock (f x ) selected as main clock (clock-through mode) <2> execute 8 nop instructions <3> pllctl.pllon bit 0: setting the pllon bit to 0 stops the pll (3) switching from main clo ck operation to subclock operation <1> pcc.ck3 bit 1: setting via a bit manipulation instruction recommended. do not change the setting of the pcc.ck2 to pcc.ck0 bits. <2> subclock operation: check whether the system has switched to subclock operation by reading the pcc.cls bit. the time required until the system switches to subclock operation after setting the ck3 bit is shown below. maximum: 1/f xt (1/subclock frequency) <3> pcc.mck bit 1: set the mck bit to 1 only when the main clock oscillator is stopped. cautions 1. when stopping operation of the main cl ock oscillator, be sure to also stop operation of the on-chip peripheral functions operating on the main clock (= peripheral clock). 2. if the following condition is not satisfi ed, make sure to satisfy it by changing the pcc.ck2 to pcc.ck0 bit settings before shifting to subclock operation mode. internal system clock (f clk ) > subclock (f xt : 32.768 khz) 4 remark internal system clock (f clk ): clock generated from the main clock (f xx ) by setting the pcc.ck2 to pcc.ck0 bits.
chapter 6 clock generation function user?s manual u19201ej3v0ud 359 (4) switching from subclock ope ration to main clock operation <1> pcc.mck bit 0: start of main clock oscillation <2> insert a wait by a program and wait for the ma in clock oscillation stabilization time to elapse. <3> pcc.ck3 bit 0: setting via a bit manipulation instruction recommended. do not change the setting of the pcc.ck2 to pcc.ck0 bits. <4> main clock operation: the time required unt il the system switches to main clock operation after setting the ck3 bit is shown below. maximum: 1/f xt (1/subclock frequency) it is therefore necessary to either insert one nop instruction immediately after setting the ck3 bit to 0, or check whether the system has switched to main clock operation by reading the pcc.cls bit. caution enable operation of the on-chip peripheral functions that operate on the main clock (= peripheral clock) after ensuring th at main clock oscillation is stable. if operation of these functions is enabled before the main clock? s oscillation stabilization time has elapsed, a malfunction may occur.
chapter 6 clock generation function user?s manual u19201ej3v0ud 360 6.4.4 procedure for setting clock generation fu nction for using clock modes 2, 3, and 4 figure 6-6. procedure for setting clock generati on function for using clock modes 2, 3, and 4 pcc.mfrc bit = 0 pcc.mck bit = 0 pllctl. selpll bit = 0 nop 8 pllctl. selpll bit = 1 pcc.ck3 bit = 1 watchdog timer 2 overflow occurred during oscillation stabilization time osts register overflow wait for pcc.cls bit to change from 0 to 1 sscgctl.sscgon bit = 0 note 1 sscgctl.sscgon bit = 1 sscgctl.selsscg bit = 1 pcc.ck3 bit = 0 wait for pcc.cls bit to change from 1 to 0 software-based wait of 1 ms or longer pcc.mck bit = 1 pcc.mfrc bit = 1 software-based wait for main clock oscillator oscillation stabilization time to elapse initial settings for using clock modes 2, 3, and 4 main clock operation subclock operation standby mode reset halt mode idle1 mode idle2 mode stop mode sscg mode pll: operating sscg: operating clock-through mode pll: operating sscg: operating clock-through mode pll: operating sscg: operating wait for main clock oscillator oscillation stabilization time to elapse on-chip oscillator operation (emergency operation mode) subclock operation mode main clock oscillator: operating pll: operating sscg: stopped subclock operation mode main clock oscillator: stopped pll: stopped note 2 sscg: stopped sub-idle mode notes 1. when the sscgctl.sscgon bit is set to 0, t he sscgctl.selsscg bit is also cleared to 0, automatically. 2. when the main clock oscillator is stopped, the p ll automatically stops wit h the pllctl.pllon bit still set to 1. do not clear (0) the pllctl.pllon bit after stopping the pll. cautions 1. in clock modes 2, 3, and 4, do not stop the pll by softwar e (i.e., do not clear the pllctl.pllon bit to 0). 2. when stopping operation of the main clock oscillator, be sure to also stop operation of the on-chip peripheral functions oper ating on the peripheral clock (f xp , f ie or f can ). remark see chapter 26 standby function for details of the areas marked .
chapter 6 clock generation function user?s manual u19201ej3v0ud 361 (1) initial settings for usin g clock modes 2, 3, and 4 when using clock modes 2, 3, or 4, set appropriate va lues to the ckc and sfc0 registers while the clock modes are in their initial status following reset release; that is, in clock-through mode and with sscg operation stopped. at this time, also be sure to make the sscg frequency modulation/ no modulation, frequency modulation ratio (down spread method) and freque ncy cycle settings using the sfc1 register. note that in clock modes 2, 3, and 4, the settings of the ckc, sfc0 an d sfc1 registers can only be made once after reset is released. these settings cannot be changed during operation. cautions 1. in clock modes 2, 3, and 4, always set the ckc, sfc0 a nd sfc1 registers in the status immediately after reset release; that is, in clock-through mode (pllctl.selpll bit = 0) and with sscg operation stopped. 2. set the ckc, sfc0, and sfc1 registers only once after reset is released. these settings cannot be changed during operation. 3. be sure to insert a 1 s wait time after setting the ckc, sfc0, and sfc1 registers. figure 6-7. flow of init ialization processing for usi ng clock modes 2, 3, and 4 ckc.ckdiv bit = 1 start end sfc0 register setting sfc1 register setting 1 s wait caution the ckc, sfc0, and sfc1 re gisters are special registers.
chapter 6 clock generation function user?s manual u19201ej3v0ud 362 (2) switching from clock-th rough mode to sscg mode <1> sscgctl.sscgon bit 1: sscg operation enabled <2> software-based wait of 1 ms or longer: wait for sscg lockup time to elapse <3> sscgctl.selsscg bit 1: multiplication clock (f pll ) selected as sscg output clock (f sscgo ) <4> pllctl.selpll bit 1: multiplication clock (f pll = f sscgo ) selected as main clock (f xx ) (sscg mode) cautions 1. the sscg is stopped foll owing reset release, so settings <1> to <3> are necessary. if the sscg is already operating and the lockup time has elapsed, only setting <4> is needed to switch to sscg mode. 2. do not stop operation of the pll (i.e., do not clear the pllctl.pllon bit to 0). (3) switching from sscg mode to clock-through mode <1> pllctl.selpll bit 0: main oscillation clock (f x ) selected as main clock (f xx ) (clock- through mode) <2> execute 8 nop instructions. <3> sscgctl.sscgon bit 0: setting the sscgon bit to 0 stops the sscg. cautions 1. when the sscgctl.sscgon bit is set to 0, the sscgctl.selsscg bit is also cleared to 0, automatically. 2. do not stop operation of the pll (i.e., do not clear the pllctl.pllon bit to 0). (4) switching from main clo ck operation to subclock operation <1> pcc.ck3 bit 1: setting via a bit manipulation instruction recommended. do not change the setting of the pcc.ck2 to pcc.ck0 bits. <2> subclock operation: check whether the system has switched to subclock operation by reading the pcc.cls bit. the time required until the system switches to subclock operation after setting the ck3 bit is shown below. maximum: 1/f xt (1/subclock frequency) <3> pcc.mck bit 1: set the mck bit to 1 only when the main clock oscillator is stopped. cautions 1. when switching the system to subclock operation, firs t switch to clock-through mode and stop operation of the sscg. 2. when stopping operation of the main clock oscillator, be sure to also stop operation of the on-chip peripheral functions oper ating on the peripheral clock (f xp , f ie , and f can ). 3. do not stop operation of the pll by softwa re. when the main clock oscillator is stopped, the pll automatically stops with the pllctl.pllon bit still set to 1 (pll operable). do not clear (0) the pllctl.pllon bit after stopping the pll. 4. if the following condition is not satisfi ed, make sure to satisfy it by changing the pcc.ck2 to pcc.ck0 bit settings before shifting to subclock operation mode. internal system clock (f clk ) > subclock (f xt : 32.768 khz) 4
chapter 6 clock generation function user?s manual u19201ej3v0ud 363 remark internal system clock (f clk ): clock generated from the main clock (f xx ) by setting the pcc.ck2 to pcc.ck0 bits. (5) switching from subclock ope ration to main clock operation <1> pcc.mck bit 0: start of main clock oscillation <2> insert a wait by a program and wait for the ma in clock oscillation stabilization time to elapse. <3> pcc.ck3 bit 0: setting via a bit manipulation instruction recommended. do not change the setting of the pcc.ck2 to pcc.ck0 bits. <4> main clock operation: the time required until the system switches to main clock operation after setting the ck3 bit is shown below. maximum: 1/f xt (1/subclock frequency) it is therefore necessary to ei ther insert one nop instruction immediately after setting the ck3 bit to 0, or check whether the system has switched to main clock operation by reading the pcc.cls bit. cautions 1. enable operation of the on-chip periphe ral functions that operate on the peripheral clock (f xp , f ie , and f can ) after ensuring that main clock oscilla tion is stable. if operation of these functions is enabled before the main clock? s oscillation stabilizati on time has elapsed, a malfunction may occur. 2. enable operation of the sscg afte r switching to main clock operation.
user?s manual u19201ej3v0ud 364 chapter 7 16-bit timer/event counter p (tmp) timer p (tmp) is a 16-bit timer/event counter. the v850e/sj3-h and v850e/sk3-h have nine ti mer/event counter channels, tmp0 to tmp8. 7.1 overview 7.1.1 tmp0 to tmp6 an outline of tmp0 to tmp6 are shown below. ? clock selection: 8 ways ? capture/trigger input pins: 2 ? external event count input pin: 1 ? external trigger input pin: 1 ? timer/counter: 1 ? capture/compare registers: 2 ? capture/compare match interrupt request signals: 2 ? overflow interrupt request signal: 1 ? timer output pins: 2 7.1.2 tmp7 and tmp8 an outline of tmp7 and tmp8 are shown below. ? clock selection: 8 ways ? capture/trigger input pins: 2 ? external event count input pin: 1 ? external trigger input pin: 1 ? encoder input pins: 2 ? encoder clear input pin: 1 ? timer/counter: 1 ? capture/compare registers: 2 ? capture/compare match interrupt request signals: 2 ? overflow interrupt request signal: 1 ? encoder clear interrupt request signal: 1 ? timer output pins: 2
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 365 7.2 functions 7.2.1 tmp0 to tmp6 tmp0 to tmp6 have the following functions. ? interval timer ? external event counter ? external trigger pulse output ? one-shot pulse output ? pwm output ? free-running timer ? pulse width measurement 7.2.2 tmp7 and tmp8 tmp7 and tmp8 have the following functions. ? interval timer ? external event counter ? external trigger pulse output ? one-shot pulse output ? pwm output ? free-running timer ? pulse width measurement ? encoder count function
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 366 7.3 configuration 7.3.1 tmp0 to tmp6 tmp0 to tmp6 include the following hardware. table 7-1. configuration of tmp0 to tmp6 item configuration timer register 16-bit counter registers tmpk capture/compare register s 0, 1 (tpkccr0, tpkccr1) tmpk counter read buffer register (tpkcnt) ccr0, ccr1 buffer registers timer inputs 2 (tipk0 note 1 , tipk1 pins) timer outputs 2 (topk0, topk1 pins) control registers note 2 tmpk control registers 0, 1 (tpkctl0, tpkctl1) tmpk i/o control registers 0 to 2 (tpkioc0 to tpkioc2) tmpk option register 0 (tpkopt0) notes 1. the tipk0 pin functions alternately as a capt ure trigger input signal, external event count input signal, and external trigger input signal. 2. when using the functions of the tipk0, tipk1, topk0, and topk1 pins, refer to table 4-25 using port pin as alternate-function pin . remark k = 0 to 6
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 367 figure 7-1. block diagram of tmpk f xp f xp /2 f xp /4 f xp /8 f xp /16 f xp /32 f xp /64 note 1 , f xp /256 note 2 f xp /128 note 1 , f xp /512 note 2 selector internal bus internal bus topk0 topk1 tipk0 tipk1 selector edge detector ccr0 buffer register ccr1 buffer register tpkccr0 tpkccr1 16-bit counter tpkcnt inttpkov inttpkcc0 inttpkcc1 output controller clear notes 1. tmp0, tmp2, tmp4, tmp6 2. tmp1, tmp3, tmp5 remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 368 (1) 16-bit counter this 16-bit counter can count inte rnal clocks or external events. the count value of this counter can be read by using the tpkcnt register. when the tpkctl0.tpkce bit = 0, the va lue of the 16-bit counter is ffffh. if the tpkcnt register is read at this time, 0000h is read. reset sets the tpkce bit to 0. (2) ccr0 buffer register this is a 16-bit compare register that com pares the count value of the 16-bit counter. when the tpkccr0 register is used as a compare regist er, the value written to the tpkccr0 register is transferred to the ccr0 buffer register. when the count value of the 16-bit counter matches the value of the ccr0 buffer register, a compare match interrupt request signal (inttpkcc0) is generated. the ccr0 buffer register cannot be read or written directly. the ccr0 buffer register is cleared to 0000h after reset, as the tpkccr0 register is cleared to 0000h. (3) ccr1 buffer register this is a 16-bit compare register that com pares the count value of the 16-bit counter. when the tpkccr1 register is used as a compare regist er, the value written to the tpkccr1 register is transferred to the ccr1 buffer register. when the count value of the 16-bit counter matches the value of the ccr1 buffer register, a compare match interrupt request signal (inttpkcc1) is generated. the ccr1 buffer register cannot be read or written directly. the ccr1 buffer register is cleared to 0000h after reset, as the tpkccr1 register is cleared to 0000h. (4) edge detector this circuit detects the valid edges input to the tipk 0 and tipk1 pins. no edge, rising edge, falling edge, or both the rising and falling edges can be selected as the valid edge by using the tpkioc1 and tpkioc2 registers. (5) output controller this circuit controls the output of the topk0 and topk 1 pins. the output contro ller is controlled by the tpkioc0 register. (6) selector this selector selects the count clock for the 16-bit counter . eight types of internal clocks or an external event can be selected as the count clock.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 369 7.3.2 tmp7 and tmp8 tmp7 and tmp8 include the following hardware. table 7-2. configuration of tmp7 and tmp8 item configuration timer register 16-bit counter registers tmpm capture/compare registers 0, 1 (tpmccr0, tpmccr1) tmpm counter read buffer register (tpmcnt) tmpm counter write register (tpmtcw) ccr0, ccr1 buffer registers timer inputs 5 (tipm0 note 1 , tipm1, tecrm, tencm0, tencm1 pins) timer outputs 2 (topm0, topm1 pins) control registers note 2 tmpm control registers 0, 1 (tpmctl0, tpmctl1) tmpm control register 2 (tpmctl2) tmpm i/o control registers 0 to 3 (tpmioc0 to tpmioc3) tmpm option register 0 (tpmopt0) tmpm option register 1 (tpmopt1) tmpa noise elimination c ontrol register (enanfc) notes 1. the tipm0 pin functions alternately as a capt ure trigger input signal, external event count input signal, and external trigger input signal. 2. when using the functions of the tipm0, tipm1, topm0, topm1, tecrm, tencm0, and tencm1 pins, refer to table 4-25 using port pin as alternate-function pin . remark m = 7, 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 370 figure 7-2. block diagram of tmp7 and tmp8 selector selector f xp f xp /2 f xp /4 f xp /8 f xp /16 f xp /32 f xp /64 note 1 , f xp /256 note 2 f xp /128 note 1 , f xp /512 note 2 internal bus internal bus tpmcnt tpmtcw note 3 tpmccr0 ccr1 buffer register tpmccr1 16-bit counter ccr0 buffer register counter control clear inttpmov output controller inttpmcc0 topm0 topm1 inttpmcc1 inttpmec tecrm tencm1/tipm1 tencm0/tipm0 sampling clock f xp f xp /4 f xp /8 f xp /16 edge detection/ noise eliminator edge detection/ noise eliminator edge detection/ noise eliminator f xp /32 f xp /64 notes 1. tmp8 2. tmp7 3. the initial value set from the tpmtcw register to the 16-bit counter is valid only in the encoder compare mode. rewrite the tpmtcw register when the tpmctl0.tpmce bit = 0. when the tpmctl2.tpmecc bit = 0, the value of th e tpmtcw register is transferred to the 16-bit counter when the tpmce bit = 1. remarks 1. f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock 2. m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 371 (1) 16-bit counter this 16-bit counter can count inte rnal clocks or external events. the count value of this counter can be read by using the tpmcnt register. when the tpmctl0.tpmce bit = 0, the value of the 16-bit counter is ffffh. if the tpmcnt register is read at this time, 0000h is read. reset sets the tpmce bit to 0. (2) ccr0 buffer register this is a 16-bit compare register that com pares the count value of the 16-bit counter. when the tpmccr0 register is used as a compare regist er, the value written to the tpmccr0 register is transferred to the ccr0 buffer register. when the count value of the 16-bit counter matches the value of the ccr0 buffer register, a compare match interrupt request signal (inttpmcc0) is generated. the ccr0 buffer register cannot be read or written directly. the ccr0 buffer register is cleared to 0000h after reset, as the tpmccr0 register is cleared to 0000h. (3) ccr1 buffer register this is a 16-bit compare register that com pares the count value of the 16-bit counter. when the tpmccr1 register is used as a compare regist er, the value written to the tpmccr1 register is transferred to the ccr1 buffer register. when the count value of the 16-bit counter matches the value of the ccr1 buffer register, a compare match interrupt request signal (inttpmcc1) is generated. the ccr1 buffer register cannot be read or written directly. the ccr1 buffer register is cleared to 0000h after reset, as the tpmccr1 register is cleared to 0000h. (4) edge detector this circuit detects the valid edges input to the tipm 0, tipm1, tecrm, tencm0, and tencm1 pins. no edge, rising edge, falling edge, or both the rising and falling edges can be selected as the valid edge by using the tpmioc1, tpmioc2, and tpmioc3 registers. (5) output controller the output of the topm0 and topm1 pins is controlled by the tpmioc0 register. (6) selector this selector selects the count clock for the 16-bit counter . eight types of internal clocks or an external event can be selected as the count clock. (7) counter controller this controls the count operation according to the timer mode selected in the tpmctl1 register.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 372 7.4 registers the registers that control tmpn are as follows. ? tmpn control register 0 (tpnctl0) ? tmpn control register 1 (tpnctl1) ? tmpm control register 2 (tpmctl2) ? tmpn i/o control register 0 (tpnioc0) ? tmpn i/o control register 1 (tpnioc1) ? tmpn i/o control register 2 (tpnioc2) ? tmpm i/o control register 3 (tpmioc3) ? tmpn option register 0 (tpnopt0) ? tmpm option register 1 (tpmopt1) ? tmpn capture/compare register 0 (tpnccr0) ? tmpn capture/compare register 1 (tpnccr1) ? tmpm counter write register (tpmtcw) ? tmpn counter read buffer register (tpncnt) ? tmpa noise elimination control register (enanfc) remarks 1. when using the functions of the tipn0, tipn1, topn0, to pn1, tecrm, tencm0, and tencm1 pins, refer to table 4-25 using port pin as alternate-function pin . 2. n = 0 to 8 m = 7, 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 373 (1) tmpn control register 0 (tpnctl0) the tpnctl0 register is an 8-bit register that controls the operation of tmpn. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. the same value can always be written to the tpnctl0 register by software. tpnce tmpn operation disabled (tmpn reset asynchronously note ). tmpn operation enabled. tmpn operation started. tpnce 0 1 tmpn operation control tpnctl0 (n = 0 to 8) 0 0 0 0 tpncks2 tpncks1 tpncks0 654321 after reset: 00h r/w address: tp0ctl0 fffff590h, tp1ctl0 fffff5a0h, tp2ctl0 fffff5b0h, tp3ctl0 fffff5c0h, tp4ctl0 fffff5d0h, tp5ctl0 fffff5e0h, tp6ctl0 fffff5f0h, tp7ctl0 fffff640h, tp8ctl0 fffff660h <7> 0 f xp f xp /2 f xp /4 f xp /8 f xp /16 f xp /32 f xp /64 f xp /128 f xp /256 f xp /512 tpncks2 0 0 0 0 1 1 1 1 internal count clock selection n = 0, 2, 4, 6, 8 n = 1, 3, 5, 7 tpncks1 0 0 1 1 0 0 1 1 tpncks0 0 1 0 1 0 1 0 1 note the tpnopt0.tpnovf bit and 16-bit count er are reset at the same time. in addition, the timer output pins (topn0 and topn1 pins) are reset to the status set by the tpnioc0 register when the 16-bit counter is reset. cautions 1. set the tpncks2 to tpncks0 bits when the tpnce bit = 0. when the value of the tpnce bi t is changed from 0 to 1, the tpncks2 to tpncks0 bits can be set simultaneously. 2. be sure to clear bits 3 to 6 to ?0?. remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 374 (2) tmpn control register 1 (tpnctl1) the tpnctl1 register is an 8-bit register that controls the operation of tmpn. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. (1/2) 0 tpnest 0 1 software trigger control tpnctl1 tpnest tpneee 0 tpmmd3 tpnmd2 tpnmd1 tpnmd0 <6> <5> 4 3 2 1 after reset: 00h r/w address: tp0ctl1 fffff591h, tp1ctl1 fffff5a1h, tp2ctl1 fffff5b1h, tp3ctl1 fffff5c1h, tp4ctl1 fffff5d1h, tp5ctl1 fffff5e1h, tp6ctl1 fffff5f1h, tp7ctl1 fffff641h, tp8ctl1 fffff661h generate a valid signal for external trigger input. ? in one-shot pulse output mode: a one-shot pulse is output with writing 1 to the tpnest bit as the trigger. ? in external trigger pulse output mode: a pwm waveform is output with writing 1 to the tpnest bit as the trigger. disable operation with external event count input (tipn0 pin). (perform counting with the count clock selected by the tpnctl0.tpncks0 to tpncks2 bits.) tpneee 0 1 count clock selection the tpneee bit selects whether counting is performed with the internal count clock or the valid edge of the external event count input. 7 0 enable operation with external event count input (tipn0 pin). (perform counting at the valid edge of the external event count input signal (tipn0 pin).) ? the read value of the tpnest bit is always 0. interval timer mode external event count mode external trigger pulse output mode one-shot pulse output mode pwm output mode free-running timer mode pulse width measurement mode encoder compare mode setting prohibited timer mode selection tpmmd3 0 0 0 0 0 0 0 1 other than above tpmmd2 0 0 0 0 1 1 1 0 tpmmd1 0 0 1 1 0 0 1 0 tpmmd0 0 1 0 1 0 1 0 0 n = 0 to 8 m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 375 (2/2) cautions 1. the tpnest bit is valid only in the external trigger pulse output mode or one-shot pulse output mode. in any other mode, wr iting 1 to this bit is ignored. 2. the tpneee bit is valid only in the interval timer mode, external trigger pulse output mode, one-shot pulse output mode, pwm output mode , free-running timer mode, or pulse width measurement mode. in any other mode , writing 1 to this bit is ignored. 3. external event count input (tipn0) or enc oder inputs (tencm0, tencm1) is selected in the external event count mode or encoder comp are mode regardless of the value of the tpneee bit. 4. set the tpneee and tpnmd3 to tpnmd0 bits when the tpnctl0.tpnce bit = 0. (the same value can be written when the tpnce bit = 1.) the operation is not guaranteed when rewriting is performed with the tpnce bit = 1. if rewriting was mistakenly performed, clear the tpnce bit to 0 and then set the bits again. 5. be sure to clear bits 3, 4, and 7 to ?0? for tmp0 to tmp6 and bits 4 and 7 to ?0? for tmp7 and tmp8.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 376 (3) tmpm control register 2 (tpmctl2) the ttmctl2 register is an 8-bit register that controls the encoder count function operation. the ttmctl2 register is valid onl y in the encoder compare mode. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. caution for details of each bit of the tpmctl2 re gister, see 7.6.8 (5) controlling bits of tpmctl2 register. (1/2) tpmecc tpmctl2 0 0 tpmlde tpmecm1 tpmecm0 tpmuds1 tpmuds0 654321 disables transfer of set value of tpmccr0 to 16-bit counter in case of underflow. enables transfer of set value of tpmccr0 to 16-bit counter in case of underflow. tpmlde 0 1 transfer setting to 16-bit counter after reset: 00h r/w address: tp7ctl2 fffff642h, tp8ctl2 fffff662h 0 <7> the 16-bit counter is not cleared to 0000h when its count value matches value of ccr1 register. the 16-bit counter is cleared to 0000h when its count value matches value of ccr1 register. tpmecm1 0 1 control of encoder clear operation 1 the 16-bit counter is not cleared to 0000h when its count value matches value of ccr0 register. the 16-bit counter is cleared to 0000h when its count value matches value of ccr0 register. tpmecm0 0 1 control of encoder clear operation 0 (m = 7, 8) normal operation holds count value of 16-bit counter when tpmctl0.tpmce bit = 0. tpmecc 0 1 encoder counter control
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 377 (2/2) when valid edge of tencm0 input is detected counts down when tencm1 = high level. counts up when tencm1 = low level. counts up when valid edge of tencm0 input is detected. counts down when valid edge of tencm1 input is detected. counts down when rising edge of tencm0 input is detected. counts up when falling edge of tencm0 input is detected. however, count operation is performed only when tencm1 = low level. both rising and falling edges of tencm0 and tencm1 are detected. count operation is automatically identified by combination of edge detection and level detection. tpmuds1 0 0 1 1 up/down count selection tpmuds0 0 1 0 1 cautions 1. the tpmecc bit is valid on ly in the encoder compare mode. in any other mode, writing ?1? to this bit is ignored. if the tpmctl0.tpmce bit is cleared to 0 while the tpmecc bit = 1, the values of the timer/counter and capture registers (tpmccr0 and tpmccr1), and the tpmopt1, tpmeuf, tpmeof, and tpmesf flags are retained. if the tpmce bit is set from 0 to 1 when the tpmecc bit = 1, the value of the tpmtcw register is not transferred to the 16-bit counter. 2. the tpmlde bit is valid only when the tpmecm1 and tpmecm0 bits = 00, 01. writing ?1 ? to this bit is ignored when the tpmecm1 and tpmecm0 bits = 10, 11. 3. the edge detection of the tencm0 and tencm1 inputs specified by the tpmioc3.tpmeis1 and tpmioc3.tpmeis0 bits is invalid and fixed to both the rising and falling edges when the tpmuds1 and tpmuds0 bits = 10, 11. 4. set the tpmlde, tpmecm1, tpmecm0, tpmuds1, and tpmuds0 bits when the tpmctl0.tpmce bit = 0 (the same value can be written to these bits when the tpmce bit = 1). if the value of these bits is change d when the tpmce bit = 1, the operation cannot be guaranteed. if it is changed by mistake, clear the tpmce bit and then set the correct value. 5. be sure to clear bits 5 and 6 to ?0?.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 378 (4) tmpn i/o control register 0 (tpnioc0) the tpnioc0 register is an 8-bit register that controls the timer output (topn0, topn1 pins). this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 379 0 tpnol1 0 1 topn1 pin output level setting note topn1 pin output starts at high level topn1 pin output starts at low level tpnioc0 (n = 0 to 8) 0 0 0 tpnol1 tpnoe1 tpnol0 tpnoe0 6543<2>1 after reset: 00h r/w address: tp0ioc0 fffff592h, tp1ioc0 fffff5a2h, tp2ioc0 fffff5b2h, tp3ioc0 fffff5c2h, tp4ioc0 fffff5d2h, tp5ioc0 fffff5e2h, tp6ioc0 fffff5f2h, tp7ioc0 fffff643h, tp8ioc0 fffff663h tpnoe1 0 1 topn1 pin output setting timer output disabled ? when tpnol1 bit = 0: low level is output from the topn1 pin ? when tpnol1 bit = 1: high level is output from the topn1 pin tpnol0 0 1 topn0 pin output level setting note topn0 pin output starts at high level topn0 pin output starts at low level tpnoe0 0 1 topn0 pin output setting timer output disabled ? when tpnol0 bit = 0: low level is output from the topn0 pin ? when tpnol0 bit = 1: high level is output from the topn0 pin 7 <0> timer output enabled (a pulse is output from the topn1 pin). timer output enabled (a pulse is output from the topn0 pin). note the output level of the ti mer output pin (topna) specified by the tpnola bit is shown below (a = 0, 1). tpnce bit topna pin output 16-bit counter ? when tpnola bit = 0 tpnce bit topna pin output 16-bit counter ? when tpnola bit = 1 cautions 1. the pin output changes if the setting of the tpnioc0 register is rewritten when the port is set to topn0 and topn1 outputs. therefore, note changes in the pin status by setting the port to the input mode and making the output status of the pins a high- impedance state. 2. rewrite the tpnol1, tpnoe1, tpnol0, and tpnoe0 bits when the tpnctl0.tpnce bit = 0. ( the same value can be written when the tpnce bit = 1.) if rewr iting was mistakenly performed, clear the tpnce bit to 0 and then set the bits again. 3. even if the tpnola bit is manipulated when the tpnce and tpnoea bits are 0, the topna pin output level varies (a = 0, 1).
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 380 (5) tmpn i/o control register 1 (tpnioc1) the tpnioc1 register is an 8-bit regist er that controls the valid edge of the capture trig ger input signals (tipn0, tipn1 pins). this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 tpnis3 0 0 1 1 tpnis2 0 1 0 1 capture trigger input signal (tipn1 pin) valid edge setting no edge detection (capture operation invalid) detection of rising edge detection of falling edge detection of both edges tpnioc1 (n = 0 to 8) 0 0 0 tpnis3 tpnis2 tpnis1 tpnis0 654321 after reset: 00h r/w address: tp0ioc1 fffff593h, tp1ioc1 fffff5a3h, tp2ioc1 fffff5b3h, tp3ioc1 fffff5c3h, tp4ioc1 fffff5d3h, tp5ioc1 fffff5e3h, tp6ioc1 fffff5f3h, tp7ioc1 fffff644h, tp8ioc1 fffff664h tpnis1 0 0 1 1 tpnis0 0 1 0 1 capture trigger input signal (tipn0 pin) valid edge setting no edge detection (capture operation invalid) detection of rising edge detection of falling edge detection of both edges 7 0 cautions 1. rewrite the tpnis3 to tpnis0 bits when the tpnctl0.tpnce bit = 0. (the same value can be written when the tpnce bit = 1.) if rewriting was mistakenly performed, clear the tpnce bit to 0 and then set the bits again. 2. the tpnis3 and tpnis2 bits are valid only in the free- running timer mode (only when tpnopt0.tpnccs1 bit = 1) and the pulse width measure ment mode. in all other modes, a capture operation is not possible. the tpnis1 and tpnis2 bits are valid only in the free- running timer mode (only when tpnopt.tpnccs0 bit = 1) and the pulse width measureme nt mode. in all other modes, a capture operation is not possible. 3. be sure to clear bits 4 to 7 to ?0?.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 381 (6) tmpn i/o control register 2 (tpnioc2) the tpnioc2 register is an 8-bit register that controls the valid edge of the external event count input signal (tipn0 pin) and external trigger input signal (tipn0 pin). this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 tpnees1 0 0 1 1 tpnees0 0 1 0 1 external event count input signal (tipn0 pin) valid edge setting no edge detection (external event count invalid) detection of rising edge detection of falling edge detection of both edges tpnioc2 (n = 0 to 8) 0 0 0 tpnees1 tpnees0 tpnets1 tpnets0 654321 after reset: 00h r/w address: tp0ioc2 fffff594h, tp1ioc2 fffff5a4h, tp2ioc2 fffff5b4h, tp3ioc2 fffff5c4h, tp4ioc2 fffff5d4h, tp5ioc2 fffff5e4h, tp6ioc2 fffff5f4h, tp7ioc2 fffff645h, tp8ioc2 fffff665h tpnets1 0 0 1 1 tpnets0 0 1 0 1 external trigger input signal (tipn0 pin) valid edge setting no edge detection (external trigger invalid) detection of rising edge detection of falling edge detection of both edges 7 0 cautions 1. rewrite the tpnees1, tpnees0, tpnets1, and tpnets0 bits when the tpnctl0.tpnce bit = 0. (the same value can be written when the tpnce bit = 1.) if rewriting was mistakenly performed, clear the tpnce bit to 0 and then set the bits again. 2. the tpnees1 and tpnees0 bits are valid only when the tpnctl1.tpneee bit = 1 or when the external event count mode (tpnctl1.tpnmd 2 to tpnctl1.tpnmd0 bits = 001) has been set. 3. the tpnets1 and tpnets0 bits are valid only when the external trigger pulse output mode (tpnctl1.tpnmd2 to tpnctl1.tpnmd0 bits = 010) or the one-shot pulse output mode (tpnctl1.tpn md2 to tpnctl1.tpnmd0 = 011) is set. 4. be sure to clear bits 4 to 7 to ?0?.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 382 (7) tmpm i/o control register 3 (tpmioc3) the tpmioc3 register is an 8-bit register that controls the encoder clear function operation. the tpmioc3 register is valid only in the encoder compare mode. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. (1/2) tpmsce tpmioc3 tpmzcl tpmbcl tpmacl tpmecs1tpmecs0 tpmeis1 tpmeis0 654321 after reset: 00h r/w address: tp7ioc3 fffff646h, tp8ioc3 fffff666h 7 0 tpmsce 0 1 encoder clear selection ? clears 16-bit counter to 0000h when valid edge of tecrm pin specified by the tpmecs1 and tpmecs0 bits is detected when the tpmsce bit = 0. ? clears 16-bit counter to 0000h when clear level conditions of the tpmzcl, tpmbcl, and tpmacl bits match input levels of the tecrm, tencm1, and tencm0 pins when tpmsce bit = 1. ? setting of the tpmzcl, tpmbcl, and tpmacl bits is valid and that of the tpmecs1 and tpmecs0 bits is invalid when the tpmsce bit = 1. encoder clear interrupt request signal (inttpmec) is not generated. ? setting of the tpmzcl, tpmbcl, and tpmacl bits is invalid and setting of the tpmecs1 and tpmecs0 bits is valid when the tpmsce bit = 0. the inttpmec signal is generated when valid edge specified by the tpmecs1 and tpmecs0 bits is detected. ? be sure to set the tpmctl2.tpmuds1 and tpmctl2.tpmuds0 bits to 10 or 11 when the tpmsce bit = 1. operation is not guaranteed if the tpmuds1 and tpmuds0 bits = 00 or 01 and the tpmsce bit = 1. clears 16-bit counter on detection of edge of encoder clear signal (tecrm pin). clears 16-bit counter on detection of clear level condition of the tencm0, tencm1, and tecrm pins. tpmzcl 0 1 clear level selection of encoder clear signal (tecrm pin) setting of the tp mzcl bit is valid only when the tp msce bit = 1. clears low level of the tecrm pin. clears high level of the tecrm pin. tpmbcl 0 1 clear level selection of encoder input signal (tencm1 pin) setting of the tp mbcl bit is valid only when the tp msce bit = 1. clears low level of the tencm1 pin. clears high level of the tencm1 pin. tpmacl 0 1 clear level selection of encoder input signal (tencm0 pin) setting of the tp macl bit is valid only when the tp msce bit = 1. clears low level of the tencm0 pin. clears high level of the tencm0 pin. (m = 7, 8)
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 383 (2/2) tpmecs1 0 0 1 1 tpmecs0 0 1 0 1 valid edge setting of encoder clear signal (tecrm pin) detects no edge (clearing encoder is invalid). detects rising edge. detects falling edge. detects both edges. tpmeis1 0 0 1 1 tpmeis0 0 1 0 1 valid edge setting of encoder input signals (tencm0, tencm1 pins) detects no edge (inputting encoder is invalid). detects rising edge. detects falling edge. detects both edges. cautions 1. rewrite the tpmsce, tpmzcl, tpmbcl, tpmacl, tpmecs1, tpmecs0, tpmeis1, and tpmeis0 bits when the tpmctl0.tpmce bit = 0. (the same value can be written to these bits when the tpmce bit = 1. ) if rewriting was mistakenly performed, clear the tpmce bit to 0 and then set these bits again. 2. the tpmecs1 and tpmecs0 bits are valid only when the tpmsce bit = 0 and the encoder compare mode is set. 3. the tpmeis1 and tpmeis0 bits are valid only when the tpmctl2.tpmuds1 and tpmctl2.tpmuds0 bits = 00 or 01.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 384 (8) tmpn option register 0 (tpnopt0) the tpnopt0 register is an 8-bit register used to set the capture/compare operation and detect an overflow. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 tpnccs1 0 1 tpnccr1 register capture/compare selection the tpnccs1 bit setting is valid only in the free-running timer mode. compare register selected capture register selected (cleared by setting tpnctl0.tpnce bit = 0) tpnopt0 (n = 0 to 8) 0 tpnccs1 tpnccs0 0 0 0 tpnovf 654321 after reset: 00h r/w address: tp0opt0 fffff595h, tp1opt0 fffff5a5h, tp2opt0 fffff5b5h, tp3opt0 fffff5c5h, tp4opt0 fffff5d5h, tp5opt0 fffff5e5h, tp6opt0 fffff5f5h, tp7opt0 fffff647h, tp8opt0 fffff667h tpnccs0 0 1 tpnccr0 register capture/compare selection the tpnccs0 bit setting is valid only in the free-running timer mode. compare register selected capture register selected (cleared by setting tpnctl0.tpnce bit = 0) tpnovf set (1) reset (0) tmpn overflow detection flag ? the tpnovf bit is set when the 16-bit counter count value overflows from ffffh to 0000h in the free-running timer mode or the pulse width measurement mode. ? an overflow interrupt request signal (inttpnov) is generated at the same time that the tpnovf bit is set to 1. the inttpnov signal is not generated in modes other than the free-running timer mode and the pulse width measurement mode. ? the tpnovf bit is not cleared to 0 even when the tpnovf bit or the tpnopt0 register are read when the tpnovf bit = 1. ? before clearing the tpnovf bit to 0 after the inttpnov signal has been generated, be sure to confirm (read) that the tpnovf bit is set to 1. ? the tpnovf bit can be both read and written, but the tpnovf bit cannot be set to 1 by software. writing 1 has no influence on the operation of tmpn. overflow occurred tpnovf bit 0 written or tpnctl0.tpnce bit = 0 7 <0> cautions 1. rewrite the tpnccs1 and tpnccs0 bits when the tpnce bit = 0. (the same value can be written when the tpnce bit = 1.) if rewriting was mi stakenly performed, clear the tpnce bit to 0 and then set the bits again. 2. be sure to clear bits 1 to 3, 6, and 7 to ?0?.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 385 (9) tmpm option register 1 (tpmopt1) the tpmopt1 register is an 8-bit regi ster that detects the overflow, und erflow, and count-up/down operation of the encoder count function. the tpmopt1 register is valid onl y in the encoder compare mode. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. this register can be rewritten even when the tpmctl0.tpmce bit = 1. (1/2) 0 tpmopt1 0 0 0 0 tpmeuf tpmeof tpmesf 6 5 4 3 <2> <1> after reset: 00h r/w address: tp7opt1 fffff648h, tp8opt1 fffff668h tpmeuf set (1) reset (0) tmpm underflow detection flag ? the tpmeuf bit is set to 1 when 16-bit counter underflows from 0000h to ffffh in encoder compare mode. ? when the tpmctl2.tpmlde bit = 1, tpmeuf bit is set to 1 when value of 16-bit counter is changed from 0000h to set value of the tpmccr0 register. ? overflow interrupt request signal (inttpmov) is generated as soon as the tpmeuf bit is set to 1. ? the tpmeuf bit is not cleared to 0 even if the tpmeuf bit or tpmopt1 register is read when the tpmeuf bit = 1. ? status of the tpmeuf bit is retained even if the tpmctl0.tpmce bit is cleared to 0 when the tpmctl2.tpmecc bit = 1. ? before clearing the tpmeuf bit to 0 after the inttpmov signal is generated, be sure to confirm (read) that the tpmeuf bit is set to 1. ? the tpmeuf bit can be read or written, but it cannot be set to 1 by software. setting this bit to 1 does not affect operation of tmpm. underflow occurs. cleared by writing to tpmeuf bit or when tpmctl0.tpmce bit = 0 7 <0> (m = 7, 8)
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 386 (2/2) tpmesf 0 1 tmpm count-up/-down operation status detection flag ? this bit is cleared to 0 if the tpmctl0.tpmce bit = 0 when the tpmctl2.tpmecc bit = 0. ? status of the tpmesf bit is retained even if the tpmce bit = 0 when the tpmecc bit = 1. tmpm is counting up. tmpm is counting down. tpmeof set (1) reset (0) overflow detection flag for tmpm encoder function ? the tpmeof bit is set to 1 when 16-bit counter overflows from ffffh to 0000h in encoder compare mode. ? as soon as the tpmeof bit has been set to 1, an overflow interrupt request signal (inttpmov) is generated. at this time, the tpmopt0.tpmovf bit is not set to 1. ? the tpmeof bit is not cleared to 0 even if the tpmeof bit or tpmopt1 register is read when the tpmeof bit = 1. ? status of the tpmeof bit is retained even if the tpmctl0.tpmce bit is cleared to 0 when the tpmctl2.tpmecc bit = 1. ? before clearing the tpmeof bit to 0 after the inttpmov signal is generated, be sure to confirm (read) that the tpmeof bit is set to 1. ? the tpmeof bit can be read or written, but it cannot be set to 1 by software. writing 1 to this bit does not affect operation of tmpm. overflow occurs. cleared by writing 0 to the tpmeof bit or when the tpmctl0.tpmce bit = 0 caution be sure to clear bits 3 to 7 to ?0?.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 387 (10) tmpn capture/compare register 0 (tpnccr0) the tpnccr0 register is a 16-bit regi ster that can be used as a captur e register or a compare register depending on the mode. this register can be used as a captur e register or a compare register only in the free-running timer mode, depending on the setting of the tpnopt0.tpnccs0 bi t. in the pulse width measurement mode, the tpnccr0 register can be used only as a capture register. in any other m ode, this register can be used only as a compare register. the tpnccr0 register can be r ead or written during operation. this register can be read or written in 16-bit units. reset sets this register to 0000h. caution accessing the tpnccr0 register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock tpnccr0 (n = 0 to 8) 12 10 8 6 4 2 after reset: 0000h r/w address: tp0ccr0 fffff596h, tp1ccr0 fffff5a6h, tp2ccr0 fffff5b6h, tp3ccr0 fffff5c6h, tp4ccr0 fffff5d6h, tp5ccr0 fffff5e6h, tp6ccr0 fffff5f6h, tp7ccr0 fffff64ah, tp8ccr0 fffff66ah 14 0 13 11 9 7 5 3 15 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 388 (a) function as compare register the tpnccr0 register can be rewritten even when the tpnctl0.tpnce bit = 1. the set value of the tpnccr0 register is transferred to the ccr0 buffer register. when the value of the 16-bit counter matches the value of the ccr0 buffer register, a compare match interrupt request signal (inttpncc0) is generated. if topn0 pin output is ena bled at this time, the output of the topn0 pin is inverted. when the tpnccr0 register is used as a cycle register in the interval timer mode, external event count mode, external trigger pulse output mode, one-shot pulse output mode, pwm output mode, or encoder compare mode, the value of the 16-bit counter is clear ed (0000h) if its count va lue matches the value of the ccr0 buffer register. the compare register is not cleared when the tpnctl0.tpnce bit = 0. (b) function as capture register in the free-running timer mode (when the tpnccr0 regist er is used as a capture re gister), the count value of the 16-bit counter is stored in the tpnccr0 register if the valid ed ge of the capture trigger input pin (tipn0 pin) is detected. in the pulse-width measurement mode, the co unt value of the 16-bit counter is stored in the tpnccr0 register and the 16-bit counter is cleared (0000h) if the valid edge of the capture trigger input pin (tipn0) is detected. even if the capture operation and reading the tpn ccr0 register conflict, the correct value of the tpnccr0 register can be read. the capture register is cleared when the tpnctl0.tpnce bit = 0. remark n = 0 to 8 the following table shows the functions of the capture/compare re gister in each mode, and how to write data to the compare register. table 7-3. function of capture/co mpare register in each mode a nd how to write compare register operation mode capture/compare register how to write compare register interval timer compare register anytime write external event counter compare register anytime write external trigger pulse output compare register batch write note one-shot pulse output compare register anytime write pwm output compare register batch write note free-running timer capture/compare register anytime write pulse width measurement capture register none encoder compare compare register anytime write note triggered by writing to the tpnccr1 register remark for details of anytime write and batch write, see 7.6 (3) anytime write and batch write .
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 389 (11) tmpn capture/compare register 1 (tpnccr1) the tpnccr1 register is a 16-bit regi ster that can be used as a captur e register or a compare register depending on the mode. this register can be used as a captur e register or a compare register only in the free-running timer mode, depending on the setting of the tpnopt0.tpnccs1 bi t. in the pulse width measurement mode, the tpnccr1 register can be used only as a capture register. in any other m ode, this register can be used only as a compare register. the tpnccr1 register can be r ead or written during operation. this register can be read or written in 16-bit units. reset sets this register to 0000h. caution accessing the tpnccr1 register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock tpnccr1 (n = 0 to 8) 12 10 8 6 4 2 after reset: 0000h r/w address: tp0ccr1 fffff598h, tp1ccr1 fffff5a8h, tp2ccr1 fffff5b8h, tp3ccr1 fffff5c8h, tp4ccr1 fffff5d8h, tp5ccr1 fffff5e8h, tp6ccr1 fffff5f8h, tp7ccr1 fffff64ch, tp8ccr1 fffff66ch 14 0 13 11 9 7 5 3 15 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 390 (a) function as compare register the tpnccr1 register can be rewritten even when the tpnctl0.tpnce bit = 1. the set value of the tpnccr1 register is transferred to the ccr1 buffer register. when the value of the 16-bit counter matches the value of the ccr1 buffer register, a compare match interrupt request signal (inttpncc1) is generated. if topn1 pin output is ena bled at this time, the output of the topn1 pin is inverted. the compare register is not cleared when the tpnctl0.tpnce bit = 0. (b) function as capture register in the free-running timer mode (when the tpnccr1 regist er is used as a capture re gister), the count value of the 16-bit counter is stored in the tpnccr1 register if the valid ed ge of the capture trigger input pin (tipn1 pin) is detected. in the pulse-width measurement mode, the co unt value of the 16-bit counter is stored in the tpnccr1 register and the 16-bit counter is cleared (0000h) if the valid edge of the capture trigger input pin (tipn1) is detected. even if the capture operation and reading the tpn ccr1 register conflict, the correct value of the tpnccr1 register can be read. the capture register is cleared when the tpnctl0.tpnce bit = 0. remark n = 0 to 8 the following table shows the functions of the capture/compare re gister in each mode, and how to write data to the compare register. table 7-4. function of capture/co mpare register in each mode a nd how to write compare register operation mode capture/compare register how to write compare register interval timer compare register anytime write external event counter compare register anytime write external trigger pulse output compare register batch write note one-shot pulse output compare register anytime write pwm output compare register batch write note free-running timer capture/compare register anytime write pulse width measurement capture register none encoder compare compare register anytime write note triggered by writing to the tpnccr1 register remark for anytime write and batch write, see 7.6 (3) anytime write and batch write .
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 391 (12) tmpm counter write register (tpmtcw) the tpmtcw register is used to set t he initial value of the 16-bit counter. the tpmtcw register is valid onl y in the encoder compare mode. this register can be read or written in 16-bit units. rewrite the tpmtcw register when the tpmctl0.tpmce bit = 0. the value of the tpmtcw register is transferred to the 16-bit counter when the tpmce bit is set (1). reset sets this register to 0000h. tpmtcw 12 10 8 6 4 2 after reset: 0000h r/w address: tp7tcw fffff650h, tp8tcw fffff670h 14 0 13 11 9 7 5 3 15 1 (m = 7, 8) (13) tmpn counter read buffer register (tpncnt) the tpncnt register is a read buffer register that can read the count va lue of the 16-bit counter. if this register is read when the tpnctl0.tpnce bit = 1, the count value of the 16-bit timer can be read. this register is read-only, in 16-bit units. for tmp0 to tmp6, the value of the tpkcnt register is cleared to 0000h when the tpkce bit = 0. if the tpkcnt register is read at this time, the value of t he 16-bit counter (ffffh) is not read, but 0000h is read. the value of the tpkcnt register is cleared to 0000h after reset, because the tpkce bit is cleared to 0. for tmp7 and tmp8, the value of the tpmcnt regi ster is set to 0000h when the tpmctl2.tpmecc and tpmce bits = 0. if the tpmcnt register is read at th is time, the value of the 16-bit counter (ffffh) is not read, but 0000h is read. the tpmcnt register is not set to 0000h but the previous value is read when the tpmecc bit = 1 and tpmce bit = 0. the tpmecc and tpmce bits are set to 0 after reset, and the value of the tpmcnt register is set to 0000h. caution accessing the tpncnt register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock remark n = 0 to 8 k = 0 to 6 m = 7, 8 tpncnt (n = 0 to 8) 12 10 8 6 4 2 after reset: 0000h r address: tp0cnt fffff59ah, tp1cnt fffff5aah, tp2cnt fffff5bah, tp3cnt fffff5cah, tp4cnt fffff5dah, tp5cnt fffff5eah, tp6cnt fffff5fah, tp7cnt fffff64eh, tp8cnt fffff66eh 14 0 13 11 9 7 5 3 15 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 392 (14) tmpm noise elimination control register (enanfc) digital noise elimination can be selected for the te crm, tencm0, and tencm1 pins. the noise elimination settings are performed using the enanfc register. when digital noise elimination is selected, the sampling clock for digital sampling can be selected from among f xp , f xp /4, f xp /8, f xp /16, f xp /32, and f xp /64. the number of times sampling is performed can be selected from either two or three times. this register can be read or written in 8-bit units. reset sets this register to 00h. caution after the sampling clock h as been changed, it takes 3 samplin g clocks to initialize the digital noise eliminator when the number of times sa mpling is performed is three, and 2 sampling clocks when it is two. therefore, if a tecrm, tencm0, or tencm1 valid edge is input within these 2 or 3 sampling clocks after the sampling clock has been changed, an encoder input may occur. therefore, when using the tmpm encoder count function, enable tmpm after 2 or 3 sampling clocks have elapsed. enanfen enanfc enanfsts 0 0 0 enanfc2 enanfc1 enanfc0 f xp f xp /4 f xp /8 f xp /16 f xp /32 f xp /64 enanfc2 0 0 0 0 1 1 digital sampling clock setting prohibited enanfc1 0 0 1 1 0 0 enanfc0 0 1 0 1 0 1 after reset: 00h r/w address: en0nfc fffff31ch, en1nfc fffff31eh digital noise elimination is not executed. digital noise elimination is executed. enanfen 0 1 settings of tecrm, tencm0, tencm1 pins digital noise elimination other than above a = 0 when m = 7 a = 1 when m = 8 three times two times enanfsts 0 1 selection of number of times of sampling remarks 1. when sampling is performed three times, the reliably eliminated noise width is 2 sampling clocks. when sampling is performed two times, the width is 1 sampling clock. 2. in the case of noise with a width smaller than 1 or 2 sampling clocks, encoder count operation is executed if noise synchronized with the sampling clock is input.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 393 figure 7-3 shows a timing example of noise elimination by di gital filtering by the encoder count function input pins (tecrm, tencm0, and tencm1). figure 7-3. digital noise elimination timing e xample (sampling: 3 times (enanfsts bit = 0)) noise elimination clock input signal internal signal sampling 3 times sampling 3 times 1 clock 3 clocks 2 clocks 3 clocks 1 clock 2 clocks remarks 1. when the tecrm, tencm0, and tencm1 input sign als are high level (or low level) and the noise elimination clock is two or less, the input signal is eliminated as noise. when sampling is executed three or more times, the edge is detected as a valid input. 2. m = 7, 8 a = 0 when m = 7 a = 1 when m = 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 394 7.5 timer output operations the following table shows the operations and out put levels of the topn0 and topn1 pins. table 7-5. timer output control in each mode operation mode topn1 pin topn0 pin interval timer mode square wave output external event count mode none external trigger pulse output mode external trigger pulse output one-shot pulse output mode one-shot pulse output pwm output mode pwm output square wave output free-running timer mode square wave output (only when compare function is used) pulse width measurement mode encoder compare mode none remark n = 0 to 8 table 7-6. truth table of topn0 and topn1 pins under control of timer output control bits tpnioc0.tpnola bit tpnioc0.tpnoea bit tpnctl0.tpnce bit level of topna pin 0 low-level output 0 low-level output 0 1 1 low level immediately before counting, high level after counting is started 0 high-level output 0 high-level output 1 1 1 high level immediately before counting, low level after counting is started remark n = 0 to 8 m = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 395 7.6 operation tmp0 to tmp6 can perform the following operations. operation tpkctl1.tpkest bit (software trigger bit) tipk0 pin (external trigger input) capture/compare register setting compare register write interval timer mode invalid invalid compare only anytime write external event count mode note 1 invalid invalid compare only anytime write external trigger pulse output mode note 2 valid valid compare only batch write one-shot pulse output mode note 2 valid valid compare only anytime write pwm output mode invalid invalid compare only batch write free-running timer mode invalid invalid switching enabled anytime write pulse width measurement mode note 2 invalid invalid capture only not applicable notes 1. to use the external event count mode, specify that t he valid edge of the tipk0 pin capture trigger input is not detected (by clearing the tpkioc1.tpki s1 and tpkioc1.tpkis0 bits to ?00?). 2. when using the external trigger pulse output m ode, one-shot pulse output mode, and pulse width measurement mode, select the internal clock as t he count clock (by clearing the tpkctl1.tpkeee bit to 0). remark k = 0 to 6 tmp7 and tmp8 can perform the following operations. operation tpmctl1.tpmest bit (software trigger bit) tipm0 pin (external trigger input) capture/compare register setting compare register write interval timer mode invalid invalid compare only anytime write external event count mode note 1 invalid invalid compare only anytime write external trigger pulse output mode note 2 valid valid compare only batch write one-shot pulse output mode note 2 valid valid compare only anytime write pwm output mode invalid invalid compare only batch write free-running timer mode invalid invalid switching enabled anytime write pulse width measurement mode note 2 invalid invalid capture only not applicable encoder compare mode invalid invalid compare only anytime write notes 1. to use the external event count mode, specify that the valid edge of the tipm0 pin capture trigger input is not detected (by clearing the tpmioc1.tpmis1 and tpmioc1.tpmis0 bits to ?00?). 2. when using the external trigger pulse output m ode, one-shot pulse output mode, and pulse width measurement mode, select the internal clock as the count clock (by clearing the tpmctl1.tpmeee bit to 0). remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 396 (1) counter basic operation for tmp0 to tmp6 this section explains the basic oper ation of the 16-bit counter. for details, refer to the description of the operation in each mode. remark k = 0 to 6 (a) count start operation ? in external event count mode the 16-bit counter is set to 0000h at the timing when the tpkce bit changes from 0 to 1. after that, the counter counts up from 0001h to 0002h , 0003h, and so on, each time a valid edge of an external event count input (tipk0) is detected. ? in other modes the 16-bit counter of tmpn starts counting from the default value ffffh. it counts up from ffffh to 0000h, 0001h, 0002h, 0003h, and so on. (b) clear operation the 16-bit counter is cleared to 0000h when its value matches the value of the compare register and is cleared, and when its value is captured and cleared. the counting operation fr om ffffh to 0000h that takes place immediately after the counter has start ed counting or when the counter overflows is not a clearing operation. therefore, the inttpkcc0 and inttpkcc1 interrupt signals are not generated. (c) overflow operation the 16-bit counter overflows when the counter counts up from ffffh to 0000h in the free-running timer mode or pulse width measurement mode . if the counter overflows, the tpkopt0.tpkovf bit is set to 1 and an interrupt request signal (inttpkov) is generated. note that the inttpkov signal is not generated under the following conditions. ? immediately after a counti ng operation has been started ? if the counter value matches the compare value ffffh and is cleared ? when ffffh is captured and cleared in the pulse width measurement mode and the counter counts up from ffffh to 0000h caution after the overflow interrupt request signal (inttpkov) has been generated, be sure to check that the overflow flag (tpkovf bit) is set to 1. (d) counter read operation during counting operation the value of the 16-bit counter of tmpk can be read by using the tpkcnt register during the count operation. when the tpkctl0.tpkce bit = 1, the valu e of the 16-bit counter can be read by reading the tpkcnt register. when the tpkctl0.tpkce bit = 0, the 16-bit counter is ffffh and the tpkcnt register is 0000h. (e) interrupt operation tmpk generates the following three types of interrupt request signals. ? inttpkcc0 interrupt: this signal functions as a match interrupt request signal of the ccr0 buffer register and as a capture interrupt request signal to the tpkccr0 register. ? inttpkcc1 interrupt: this signal functions as a match interrupt request signal of the ccr1 buffer register and as a capture interrupt request signal to the tpkccr1 register. ? inttpkov interrupt: this signal functions as an overflow interrupt request signal.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 397 (2) counter basic operati on for tmp7 and tmp8 this section explains the basic oper ation of the 16-bit counter. for details, refer to the description of the operation in each mode. remark m = 7, 8 (a) counter start operation ? encoder compare mode the count operation is controlled by tencm0 and tencm1 phases. when the 16-bit counter initial setting is performed by transferring the set value of the tpmtcw register to the 16-bit counter and the c ount operation is started. (when t he tpmctl2.tpmecc bit = 0, the tpmtcw register set value is transferred to the 16-bit counter at the timing when the tpmctl0.tpmce bit changes from 0 to 1.) ? external event counter mode the 16-bit counter is set to 0000h at the timing when the tpkce bit changes from 0 to 1. after that, the counter counts up from 0001h to 0002h , 0003h, and so on, each time a valid edge of an external event counter input (tipk0) is detected. ? mode other than above the 16-bit counter starts counting from the initial value ffffh. it counts up from ffffh to 0000h, 0001h, 0002h, 0003h, and so on. (b) clear operation the 16-bit counter is cleared to 0000h when its val ue matches the value of t he compare register and cleared, when the value of the 16-bit counter is capt ured and cleared, when the edge of the encoder clear signal is detected and cleared, and when the clear le vel condition of the tencm0, tencm1, and tecrm pins is detected and cleared. t he count operation from ffffh to 0000h that takes place immediately after the counter has start ed counting or when the counter overflows is not a clearing operation. therefore, the inttpkcc0 and inttpkcc1 interrupt signals are not generated. (c) overflow operation the 16-bit counter overflows when the counter counts up from ffffh to 0000h in the free-running mode, pulse width measurement mode, and encoder co mpare mode. if the counter overflows, the tpmopt0.tpmovf bit is set to 1 and an interrupt r equest signal (inttpmov) is generated in the free- running mode and pulse width measurement mode. if the counter overflows, the tpmopt1.tpmeof bit is set to 1 and an interrupt request signal (inttpmov) is generated in the encoder compare mode. note that the inttpmov signal is not generated under the following conditions. ? immediately after a count operation has been started ? if the counter value matches the compare value ffffh and is cleared ? when ffffh is captured and cleared to 0000h in the pulse width measurement mode caution after the overflow interr upt request signal (inttpmov) has been generated, be sure to check that the overflow flag (tpm ovf, tpmeof bits) is set to 1.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 398 (d) count value holding operation the value of the 16-bit counter is held by the tpmc tl2.tpmecc bit in the encoder compare mode. the value of the 16-bit counter is reset to ffffh when the tpmecc bit = 0 and tpmctl0.tpmce bit = 0. when the tpmce bit is set to 1 next time, the set value of the tpmtcw register is transferred to the 16-bit counter and the counter continues its count operation. if the tpmecc bit = 1 and tpmce bit = 0, the value of the 16-bit counter is held. when the tpmce bit is set to 1 next time, the counter resumes the count operation from the held value. (e) counter read operation during count operation the value of the 16-bit counter of tmpm can be read by using the tpmcnt register during the count operation. when the tpmctl0.tpmce bit = 1, the val ue of the 16-bit counter can be read by reading the tpmcnt register. if the tpmcnt register is read when the tpmctl2.tpmecc bit = 0 and tpmce bit = 0, however, it is 0000h. the held value of the tpmcnt register is read if the register is read when the tpmecc bit = 1 and tpmce bit = 0. (f) underflow operation the 16-bit counter underflow occurs at the timing wh en the 16-bit counter value changes from 0000h to ffffh in the encoder compare mode. when underflow occurs, the tpmopt1.tpmeuf bit is set to 1 and an interrupt request signal (inttpmov) is generated. (g) interrupt operation tmpm generates the following four types of interrupt request signals. ? inttpmcc0 interrupt: this signal functions as a match interrupt request signal of the ccr0 buffer register and as a capture interrupt request signal to the tpmccr0 register. ? inttpmcc1 interrupt: this signal functions as a match interrupt request signal of the ccr1 buffer register and as a capture interrupt request signal to the tpmccr1 register. ? inttpmov interrupt: this signal functions as an overflow interrupt request signal. ? inttpmec interrupt: this signal functions as a valid edge detection interrupt request signal of the encoder clear input (tecrm pin).
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 399 (3) anytime write and batch write the tpnccr0 and tpnccr1 registers in tmpn can be re written during timer operation (tpnctl0.tpnce bit = 1), but the write method (anytime write, batch wr ite) of the ccr0 and ccr1 buffer registers differs depending on the mode. (a) anytime write in this mode, data is transferred at any time from the tpnccr0 and tpnccr1 registers to the ccr0 and ccr1 buffer registers during timer operation. (n = 0 to 8). figure 7-4. flowchart of basic operation for anytime write start initial settings ? set values to tpnccra register ? timer operation enable (tpnce bit = 1) transfer values of tpnccra register to ccra buffer register timer operation ? match between 16-bit counter and ccr1 buffer register note ? match between 16-bit counter and ccr0 buffer register ? 16-bit counter clear & start inttpncc1 signal output tpnccra register rewrite transfer to ccra buffer register inttpncc0 signal output note the 16-bit counter is not cleared upon a match between the 16-bit counter value and the ccr1 buffer register value. it is cleared upon a match between t he 16-bit counter value and the ccr0 buffer register value. remarks 1. the above flowchart illustrates an example of the operation in the interval timer mode. 2. n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 400 figure 7-5. timing of anytime write d 01 d 01 d 01 d 01 0000h tpnce bit = 1 d 02 d 02 d 11 d 11 d 11 d 12 d 12 d 12 d 02 d 11 0000h d 12 16-bit counter tpnccr0 register tpnccr1 register inttpncc0 signal inttpncc1 signal ccr0 buffer register ccr1 buffer register 0000h ffffh remarks 1. d 01 , d 02 : setting values of tpnccr0 register d 11 , d 12 : setting values of tpnccr1 register 2. the above timing chart illustrates an example of the operation in the interval timer mode. 3. n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 401 (b) batch write in this mode, data is transferred all at once from the tpnccr0 and tpnccr1 registers to the ccr0 and ccr1 buffer registers during timer operation. this data is transferred upon a match between the value of the ccr0 buffer register and the value of the 16-bit counter. transfer is enabled by writing to the tpnccr1 register. whether to enable or disable the next transfer timing is controlled by writing or not writing to the tpnccr1 register. in order for the setting value when the tpnccr0 and tpnccr1 registers are rewritten to become the 16- bit counter comparison value (in other words, in or der for this value to be transferred to the ccr0 and ccr1 buffer registers), it is necessary to rewrite the tpnccr0 register and then write to the tpnccr1 register before the 16-bit counter value and the ccr0 buff er register value match. therefore, the values of the tpnccr0 and tpnccr1 registers are transferr ed to the ccr0 and ccr1 buffer registers upon a match between the count value of the 16-bit counter and the value of the ccr0 buffer register. thus even when wishing only to rewrite the value of the tpnccr0 register, also write the same value (same as value of the tpnccr1 register already set) to the tpnccr1 register.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 402 figure 7-6. flowchart of basic operation for batch write start initial settings ? set values to tpnccra register ? timer operation enable (tpnce bit = 1) transfer values of tpnccra register to ccra buffer register timer operation ? match between 16-bit counter and ccr1 buffer register note ? match between 16-bit counter and ccr0 buffer register ? 16-bit counter clear & start ? transfer of values of tpnccra register to ccra buffer register inttpncc1 signal output tpnccr0 register rewrite tpnccr1 register rewrite inttpncc0 signal output batch write enable note the 16-bit counter is not cleared upon a match between the 16-bit counter value and the ccr1 buffer register value. it is cleared upon a match between t he 16-bit counter value and the ccr0 buffer register value. caution writing to the tpnccr1 regi ster includes enabling of batch wr ite. thus, rewrite the tpnccr1 register after rewriting the tpnccr0 register. remarks 1. the above flowchart illustrates an example of the operation in the pwm output mode. 2. n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 403 figure 7-7. timing of batch write d 01 d 01 d 02 d 03 0000h d 01 d 11 d 12 d 12 0000h d 11 tpnce bit = 1 note 1 d 02 d 02 d 03 d 11 d 12 d 12 d 12 d 12 16-bit counter tpnccr0 register tpnccr1 register inttpncc0 signal inttpncc1 signal topn1 pin output topn0 pin output ccr0 buffer register ccr1 buffer register note 1 note 1 note 1 same value write d 02 d 12 0000h d 03 d 12 note 2 note 3 ffffh notes 1. because the tpnccr1 register was not rewritten, d 03 is not transferred. 2. because the tpnccr1 register has been written (d 12 ), data is transferred to the ccr1 buffer register upon a match between the value of t he 16-bit counter and the value of the tpnccr0 register (d 01 ). 3. because the tpnccr1 register has been written (d 12 ), data is transferred to the ccr1 buffer register upon a match between the value of t he 16-bit counter and the value of the tpnccr0 register (d 02 ). remarks 1. d 01 , d 02 , d 03 : setting values of tpnccr0 register d 11 , d 12 : setting values of tpnccr1 register 2. the above timing chart illustrates the opera tion in the pwm output mode as an example. 3. n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 404 7.6.1 interval timer mode (t pnmd2 to tpnmd0 bits = 000) in the interval timer mode, an interrupt request signal (inttpncc0) is generated at the interval set by the tpnccr0 register if the tpnctl0.tpnce bit is set to 1. a square wave with a duty factor of 50% whose half cycle is equal to the interval can be output from the topn0 pin. the tpnccr1 register is not used in the interval timer m ode. however, the set value of the tpnccr1 register is transferred to the ccr1 buffer register, and when the count va lue of the 16-bit counter ma tches the value of the ccr1 buffer register, a compare match interrupt request signal (i nttpncc1) is generated. in addition, a square wave with a duty factor of 50%, which is inverted when the inttpncc1 signal is generated, can be ou tput from the topn1 pin. the value of the tpnccr0 and tpnccr1 registers c an be rewritten even while the timer is operating. figure 7-8. configuration of interval timer 16-bit counter output controller ccr0 buffer register tpnce bit tpnccr0 register count clock selection clear match signal topn0 pin inttpncc0 signal remark n = 0 to 8 figure 7-9. basic timing of operation in interval timer mode ffffh 16-bit counter 0000h tpnce bit tpnccr0 register topn0 pin output inttpncc0 signal d 0 d 0 d 0 d 0 d 0 interval (d 0 + 1) interval (d 0 + 1) interval (d 0 + 1) interval (d 0 + 1) remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 405 when the tpnce bit is set to 1, the va lue of the 16-bit counter is cleared fr om ffffh to 0000h in synchronization with the count clock, and t he counter starts counting. at this time, the out put of the topn0 pin is inverted. additionally, the set value of the tpnccr0 register is transferred to the ccr0 buffer register. when the count value of the 16-bit counter matches the valu e of the ccr0 buffer register, the 16-bit counter is cleared to 0000h, the output of the topn0 pin is in verted, and a compare match interrupt request signal (inttpncc0) is generated. the interval can be calculated by the following expression. interval = (set value of tpnccr0 register + 1) count clock cycle remark n = 0 to 8 figure 7-10. register setting for in terval timer mode operation (1/3) (a) tmpn control register 0 (tpnctl0) 0/1 0 0 0 0 tpnctl0 select count clock 0: stop counting 1: enable counting 0/1 0/1 0/1 tpncks2 tpncks1 tpncks0 tpnce (b) tmpn control register 1 (tpnctl1) 0 0 0/1 note 00 tpnctl1 0, 0, 0: interval timer mode 0: operate on count clock selected by tpncks0 to tpncks2 bits 1: count with external event count input signal 000 tpnmd2 tpnmd1 tpnmd0 tpneee tpnest note the tpneee bit can be set to 1 only when the timer output (topn1) is used. however, set the tpnccr0 and tpnccr1 registers to the same value.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 406 figure 7-10. register setting for in terval timer mode operation (2/3) (c) tmpn i/o control register 0 (tpnioc0) 0 0 0 0 0/1 tpnioc0 0: disable topn0 pin output 1: enable topn0 pin output setting topn0 pin output level before count operation 0: low level 1: high level 0: disable topn1 pin output 1: enable topn1 pin output setting topn1 pin output level before count operation 0: low level 1: high level 0/1 0/1 0/1 tpnoe1 tpnol0 tpnoe0 tpnol1 (d) tmpn i/o control register 2 (tpnioc2) 0 0 0 0 0/1 note tpnioc2 select valid edge of external event count input (tipn0 pin). 0/1 note 00 tpnees0 tpnets1 tpnets0 tpnees1 note the tpnees1 and tpnees0 bits can be set only when the timer output (topn1) is used. however, set the tpnccr0 and tpnccr1 registers to the same value. (e) tmpn counter read bu ffer register (tpncnt) by reading the tpncnt register, the count va lue of the 16-bit counter can be read. (f) tmpn capture/compare register 0 (tpnccr0) if the tpnccr0 register is set to d 0 , the interval is as follows. interval = (d 0 + 1) count clock cycle remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 407 figure 7-10. register setting for in terval timer mode operation (3/3) (g) tmpn capture/compare register 1 (tpnccr1) the tpnccr1 register is not used in the interval timer mode. however, the set value of the tpnccr1 register is transferred to the ccr1 buffer register. when the count value of the 16-bit counter matches the value of the ccr1 buffer register, the topn1 pin output is inverted and a compare match interrupt request signal (inttpncc1) is generated. by setting this register to the same value as the va lue set in the tpnccr0 register, a square wave with a duty factor of 50% can be output from the topn1 pin. when the tpnccr1 register is not used, it is recommended to set its value to ffffh. also mask the register by the interrupt mask flag (tpnccic1.tpnccmk1). remarks 1. tmpn i/o control register 1 (tpnioc1) and tmpn option register 0 (tpnopt0) are not used in the interval timer mode. 2. n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 408 (1) interval timer mode operation flow figure 7-11. software processing flow in interval timer mode tpnce bit = 1 tpnce bit = 0 register initial setting tpnctl0 register (tpncks0 to tpncks2 bits) tpnctl1 register, tpnioc0 register, tpnioc2 register note , tpnccr0 register initial setting of these registers is performed before setting the tpnce bit to 1. the tpncks0 to tpncks2 bits can be set at the same time when counting has been started (tpnce bit = 1). the counter is initialized and counting is stopped by clearing the tpnce bit to 0. the output level of the topn0 pin is as specified by the tpnioc0 register. start stop <1> count operation start flow <2> count operation stop flow d 0 <1> <2> d 0 d 0 d 0 ffffh 16-bit counter 0000h tpnce bit tpnccr0 register topn0 pin output inttpncc0 signal note the tpnees1 and tpnees0 bits can be set only when timer output (topn1) is used. however, set the tpnccr0 and tpnccr1 registers to the same value. remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 409 (2) interval timer mode operation timing (a) operation if tpnccr0 re gister is set to 0000h if the tpnccr0 register is set to 0000h, the inttpn cc0 signal is generated at each count clock, and the output of the topn0 pin is inverted. the value of the 16-bit counter is always 0000h. count clock 16-bit counter tpnce bit tpnccr0 register topn0 pin output inttpncc0 signal 0000h interval time count clock cycle interval time count clock cycle interval time count clock cycle ffffh 0000h 0000h 0000h 0000h remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 410 (b) operation if tpnccr0 register is set to ffffh if the tpnccr0 register is set to ffffh, the 16-bit co unter counts up to ffffh. t he counter is cleared to 0000h in synchronization with the next count-up timing. the inttpncc0 signal is generated and the output of the topn0 pin is inverted. at this time, an overflow interrupt request signal (inttpnov) is not generated, nor is the overflow flag (tpnopt0.tpnovf bit) set to 1. ffffh 16-bit counter 0000h tpnce bit tpnccr0 register topn0 pin output inttpncc0 signal ffffh interval time 10000h count clock cycle interval time 10000h count clock cycle interval time 10000h count clock cycle remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 411 (c) notes on rewriting tpnccr0 register when the value of the tpnccr0 register is rewritten to a smaller value during counting, the 16-bit counter may overflow. if there is a possibility of ov erflow, stop counting and then change the set value. ffffh 16-bit counter 0000h tpnce bit tpnccr0 register tpnol0 bit topn0 pin output inttpncc0 signal d 1 d 2 d 1 d 1 d 2 d 2 d 2 l interval time (1) interval time (ng) interval time (2) remarks 1. interval time (1): (d 1 + 1) count clock cycle interval time (ng): (10000h + d 2 + 1) count clock cycle interval time (2): (d 2 + 1) count clock cycle 2. n = 0 to 8 if the value of the tpnccr0 register is changed from d 1 to d 2 while the count value is greater than d 2 but less than d 1 , the count value is transferred to the ccr0 buffer register as soon as the tpnccr0 register has been rewritten. consequently, the value of the 16-bit counter that is compared is d 2 . because the count value has already exceeded d 2 , however, the 16-bit c ounter counts up to ffffh, overflows, and then counts up again from 0000h. when the count value matches d 2 , the inttpncc0 signal is generated and the output of the topn0 pin is inverted. therefore, the inttpncc0 signal may not be generated at the interval time ?(d 1 + 1) count clock cycle? or ?(d 2 + 1) count clock cycle? originally expected, but may be generated at an interval of ?(10000h + d 2 + 1) count clock period?.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 412 (d) operation of tpnccr1 register figure 7-12. configuration of tpnccr1 register ccr0 buffer register tpnccr0 register tpnccr1 register ccr1 buffer register topn0 pin inttpncc0 signal topn1 pin inttpncc1 signal 16-bit counter output controller tpnce bit count clock selection clear match signal output controller match signal remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 413 when the tpnccr1 register is set to the same val ue as the tpnccr0 register, the inttpncc1 signal is generated at the same timing as the inttpncc0 signa l and the topn1 pin output is inverted. in other words, a square wave with a duty factor of 50% can be output from the topn1 pin. the following shows the operation when the tpnccr1 re gister is set to other than the value set in the tpnccr0 register. if the set value of the tpnccr1 register is less than the set value of the tpnccr0 register, the inttpncc1 signal is generated once per cycle. at the same time, the output of t he topn1 pin is inverted. the topn1 pin outputs a square wave with a duty fact or of 50% after outputting a short-width pulse. figure 7-13. timing chart when d 01 d 11 ffffh 16-bit counter 0000h tpnce bit tpnccr0 register topn0 pin output inttpncc0 signal tpnccr1 register topn1 pin output inttpncc1 signal d 01 d 11 d 01 d 11 d 11 d 11 d 11 d 01 d 01 d 01 remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 414 if the set value of the tpnccr1 register is greater than the set value of the tpnccr0 register, the count value of the 16-bit counter does not match the va lue of the tpnccr1 register. consequently, the inttpncc1 signal is not generated, nor is the output of the topn1 pin changed. when the tpnccr1 register is not used, it is recommended to set it s value to ffffh. figure 7-14. timing chart when d 01 < d 11 ffffh 16-bit counter 0000h tpnce bit tpnccr0 register topn0 pin output inttpncc0 signal tpnccr1 register topn1 pin output inttpncc1 signal d 01 d 11 d 01 d 01 d 01 d 01 l remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 415 (3) operation by external event count input (tipn0) (a) operation to count the 16-bit counter at the va lid edge of external event count input (tipn0) in the interval timer mode, the valid edge of the external event count input is necessary once because the 16-bit counter is cleared from ffffh to 0000h immediately afte r the tpnce bit is set from 0 to 1. when 0001h is set to both the tpnccr0 and tpnccr1 r egisters, the topn1 pin output is inverted each time the 16-bit counter counts twice. the tpnctl1.tpneee bit can be set to 1 in the interval timer mode only when the timer output (topn1) is used with the external event count input. tpnce bit external event count input tpnccr0 register tpnccr1 register topn1 pin output 16-bit counter ffffh 0000h 0001h 0001h 0001h 0001h 0001h 0001h 0001h 0001h 0001h number of external events: 3 number of external events: 2 number of external events: 2 2-count width 2-count width 2-count width (tipn0 pin input) remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 416 7.6.2 external event count mode (tpnmd2 to tpnmd0 bits = 001) in the external event count mode, the valid edge of the external event count input (tipn0) is counted when the tpnctl0.tpnce bit is set to 1, and an interrupt request signal (inttpncc0) is generated each time the number of edges set by the tpnccr0 register have been counted. the topn0 and topn1 pins cannot be used. when using the topn1 pin for external event count input, set the tp nctl1.tpneee bit to 1 in the interval timer mode (see 7.6.1 (3) operation by external event count input (tipn0) ). the tpnccr1 register is not used in the external event count mode. caution in the external event count mode, the tpnccr0 and tpnccr1 registers must not be cleared to 0000h. figure 7-15. configuration in external event count mode 16-bit counter ccr0 buffer register tpnce bit tpnccr0 register edge detector clear match signal inttpncc0 signal tipn0 pin (external event count input) remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 417 figure 7-16. basic timing in external event count mode ffffh 16-bit counter 0000h tpnce bit tpnccr0 register inttpncc0 signal d 0 d 0 d 0 d 0 16-bit counter tpnccr0 register inttpncc0 signal external event count input (tipn0 pin input) d 0 number of external event count (d 0 ) note times d 0 ? 1d 0 0000 0001 number of external event count (d 0 + 1) times number of external event count (d 0 + 1) times note in the external event count mode, when the tpnct l0.tpnce bit is set to 1 (operation starts), the 16-bit counter is cleared from ffffh to 0000h at the same time. the first count operation starts from 0001h each time the valid edge of the external event count input is detected. therefore, the count of the fi rst count operation is one number smaller than the count of the second or subsequent count operation. remarks 1. this figure shows the basic timing when the ri sing edge is specified as the valid edge of the external event count input. 2. n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 418 when the tpnce bit is set to 1, the value of the 16-bit counter is clea red from ffffh to 0000h. the counter counts each time the valid edge of external event count input is detected. additionally, the set value of the tpnccr0 register is transferred to the ccr0 buffer register. when the count value of the 16-bit counter matches the valu e of the ccr0 buffer register, the 16-bit counter is cleared to 0000h, and a compare match interrupt request signal (inttpncc0) is generated. the inttpncc0 signal is generated for the first time wh en the valid edge of the exte rnal event count input has been detected ?value set to tpnccr0 register? times. after that, the inttpncc0 signal is generated each time the valid edge of the external event count input has been det ected ?value set to tpnccr0 register + 1? times. figure 7-17. register setting for operati on in external event count mode (1/2) (a) tmpn control register 0 (tpnctl0) 0/1 0 0 0 0 tpnctl0 0: stop counting 1: enable counting 000 tpncks2 tpncks1 tpncks0 tpnce (b) tmpn control register 1 (tpnctl1) 00000 tpnctl1 0, 0, 1: external event count mode 001 tpnmd2 tpnmd1 tpnmd0 tpneee tpnest (c) tmpn i/o control register 2 (tpnioc2) 0 0 0 0 0/1 tpnioc2 select valid edge of external event count input (tipn0 pin) 0/1 0 0 tpnees0 tpnets1 tpnets0 tpnees1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 419 figure 7-17. register setting for operati on in external event count mode (2/2) (d) tmpn counter read bu ffer register (tpncnt) the count value of the 16-bit counter can be read by reading the tpncnt register. (e) tmpn capture/compare register 0 (tpnccr0) if the tpnccr0 register is set to d 0 , the count is cleared when the number of external events has reached (d 0 ) and the first compare match interrupt request signal (inttpncc0) is generated. the second compare match interrupt request signal (inttpncc0) is generated when the number of external events has reached (d 0 + 1). (f) tmpn capture/compare register 1 (tpnccr1) the tpnccr1 register is not used in the external event count mode. however, the set value of the tpnccr1 register is transferred to the ccr1 buffer register. when the count value of the 16-bit counter matches the value of the ccr1 buffer re gister, a compare match interrupt request signal (inttpncc1) is generated. when the tpnccr1 registers are not used, it is recommended to set th eir value to ffffh. also mask the register by the interrupt mask flag (tpnccic1.tpnccmk1). cautions 1. set the tpnioc0 register to 00h. 2. when an external clock is used as the count clock, the external clock can be input only from the tipn0 pin. at this time, set the tpnioc1.tpnis1 and tpnioc1.tpnis0 bits to 00 (capture trigger input (tipn0 pin): no edge detection). remarks 1. tmpn i/o control register 1 (tpnioc1) and tmpn option register 0 (tpnopt0) are not used in the external event count mode. 2. n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 420 (1) external event count mode operation flow figure 7-18. flow of software processing in external event count mode ffffh 16-bit counter 0000h tpnce bit tpnccr0 register inttpncc0 signal d 0 d 0 d 0 d 0 <1> <2> tpnce bit = 1 tpnce bit = 0 register initial setting tpnctl1 register, tpnioc2 register, tpnccr0, tpnccr1 registers initial setting of these registers is performed before setting the tpnce bit to 1. the counter is initialized and counting is stopped by clearing the tpnce bit to 0. start stop <1> count operation start flow <2> count operation stop flow remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 421 (2) operation timing in external event count mode cautions 1. in the external event count mode, se tting the tpnccr0 and tpn ccr1 registers to 0000h is disabled. 2. in the external event count mode, use of th e timer output (topn0, topn1) is disabled. if performing external event count input (tipn0) using timer output (topn1), set the interval timer mode to enable the count clock operat ion (tpnctl1.tpneee bit = 1) for the external event count input (refer to 7.6.1 (3) operat ion by external event count input (tipn0)). (a) operation if tpnccr0 register is set to ffffh if the tpnccr0 register is set to ffffh, the 16-bit co unter counts to ffffh each time the valid edge of the external event count signal has been detected. the 16-bit counter is cleared to 0000h in synchronization with the next count-up timing, and the inttpncc0 signal is generated. at this time, the tpnopt0.tpnovf bit is not set. ffffh 16-bit counter 0000h tpnce bit tpnccr0 register inttpncc0 signal ffffh number of external event count ffffh times number of external event count 10000h times number of external event count 10000h times remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 422 (b) notes on rewriting the tpnccr0 register if the value of the tpnccr0 register is rewritten to a smaller value during counting, the 16-bit counter may overflow. if there is a possibility of overfl ow, stop counting and then change the set value. ffffh 16-bit counter 0000h tpnce bit tpnccr0 register inttpncc0 signal d 1 d 2 d 1 d 1 d 2 d 2 d 2 number of external event count (1) (d 1 ) times number of external event count (ng) (10000h + d 2 + 1) times number of external event count (2) (d 2 + 1) times remark n = 0 to 8 if the value of the tpnccr0 register is changed from d 1 to d 2 while the count value is greater than d 2 but less than d 1 , the count value is transferred to the ccr0 buffer register as soon as the tpnccr0 register has been rewritten. consequently, the value t hat is compared with the 16-bit counter is d 2 . because the count value has already exceeded d 2 , however, the 16-bit c ounter counts up to ffffh, overflows, and then counts up again from 0000h. when the count value matches d 2 , the inttpncc0 signal is generated. therefore, the inttpncc0 signal may not be generated at the va lid edge count of ?(d 1 + 1) times? or ?(d 2 + 1) times? originally expected, but may be generated at the valid edge count of ?(10000h + d 2 + 1) times?.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 423 (c) operation of tpnccr1 register figure 7-19. configuration of tpnccr1 register ccr0 buffer register tpnce bit tpnccr0 register 16-bit counter tpnccr1 register ccr1 buffer register clear match signal match signal inttpncc0 signal inttpncc1 signal edge detector tipn0 pin (external event count input) remark n = 0 to 8 if the set value of the tpnccr1 register is smalle r than the set value of the tpnccr0 register, the inttpncc1 signal is generated once per cycle. figure 7-20. timing chart when d 01 d 11 ffffh 16-bit counter 0000h tpnce bit tpnccr0 register inttpncc0 signal tpnccr1 register inttpncc1 signal d 01 d 11 d 01 d 11 d 11 d 11 d 11 d 01 d 01 d 01 remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 424 if the set value of the tpnccr1 register is greater than the set value of the tpnccr0 register, the inttpncc1 signal is not generated because the count va lue of the 16-bit counte r and the value of the tpnccr1 register do not match. it is recommended to set ffffh to the tpnccr1 register when the tpnccr1 register is not used. figure 7-21. timing chart when d 01 < d 11 ffffh 16-bit counter 0000h tpnce bit tpnccr0 register inttpncc0 signal tpnccr1 register inttpncc1 signal d 01 d 11 d 01 d 01 d 01 d 01 l remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 425 7.6.3 external trigger pulse output m ode (tpnmd2 to tpnmd0 bits = 010) in the external trigger pulse output mode, 16-bit timer/event counter p waits for a trigger when the tpnctl0.tpnce bit is set to 1. when the valid edge of an ex ternal trigger input signal is detected, 16-bit timer/event counter p starts counting, and outputs a pwm waveform from the topn1 pin. pulses can also be output by generating a software trigger instead of using the external trigger. when using a software trigger, a square wave that has one cycle of the pwm waveform as half its cycle can also be output from the topn0 pin. figure 7-22. configuration in external trigger pulse output mode ccr0 buffer register tpnce bit tpnccr0 register 16-bit counter tpnccr1 register ccr1 buffer register clear match signal match signal inttpncc0 signal output controller (rs-ff) output controller topn1 pin inttpncc1 signal topn0 pin note count clock selection count start control edge detector software trigger generation tipn0 pin note (external trigger input) transfer transfer s r note because the external trigger input pin (tipn0) and timer output pin (topn0) share the same alternate- function pin, two functions cannot be used at the same time. caution in external trigger pulse output mode, select the internal clock (set tpnctl1.tpneee bit = 0) as the count clock. remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 426 figure 7-23. basic timing in exte rnal trigger pulse output mode ffffh 16-bit counter 0000h tpnce bit tpnccr0 register inttpncc0 signal tpnccr1 register inttpncc1 signal topn1 pin output external trigger input (tipn0 pin input) topn0 pin output (only when software trigger is used) d 1 d 0 d 0 d 1 d 1 d 1 d 1 d 0 d 0 d 0 wait for trigger active level width (d 1 ) cycle (d 0 + 1) cycle (d 0 + 1) cycle (d 0 + 1) active level width (d 1 ) active level width (d 1 ) 16-bit timer/event counter p waits for a trigger when the tpnc e bit is set to 1. when the trigger is generated, the 16-bit counter is cleared from ffffh to 0000h, starts count ing at the same time, and out puts a pwm waveform from the topn1 pin. if the trigger is generated again while the counter is operating, the counter is cleared to 0000h and restarted. (the output of th e topn0 pin is inverted. the topn1 pin ou tputs a high-level regardless of the status (high/low) when a trigger occurs.) the active level width, cycle, and duty factor of the pwm waveform can be calculated as follows. active level width = (set value of tpnccr1 register) count clock cycle cycle = (set value of tpnccr0 register + 1) count clock cycle duty factor = (set value of tpnccr1 regist er)/(set value of tpnccr0 register + 1) the compare match request signal inttpncc0 is generat ed when the 16-bit counter counts next time after its count value matches the value of the cc r0 buffer register, and the 16-bit counter is cleared to 0000h. the compare match interrupt request signal inttpncc1 is generated when t he count value of the 16-bit counter matches the value of the ccr1 buffer register. the value set to the tpnccra register is transferred to t he ccra buffer register when the count value of the 16-bit counter matches the value of the ccra buffer regi ster and the 16-bit counter is cleared to 0000h. the valid edge of an external trigger input (tipn0) signal, or setting the software trigger (tpnctl1.tpnest bit) to 1 is used as the trigger. remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 427 figure 7-24. setting of registers in exte rnal trigger pulse output mode (1/2) (a) tmpn control register 0 (tpnctl0) 0/1 0 0 0 0 tpnctl0 select count clock 0: stop counting 1: enable counting 0/1 0/1 0/1 tpncks2 tpncks1 tpncks0 tpnce (b) tmpn control register 1 (tpnctl1) 0 0/1 0 0 0 tpnctl1 0: operate on count clock selected by tpncks0 to tpncks2 bits generate software trigger when 1 is written 010 tpnmd2 tpnmd1 tpnmd0 tpneee tpnest 0, 1, 0: external trigger pulse output mode (c) tmpn i/o control register 0 (tpnioc0) 0 0 0 0 0/1 tpnioc0 0: disable topn0 pin output 1: enable topn0 pin output setting output level of topn0 pin in status of waiting for external trigger 0: low level 1: high level 0: disable topn1 pin output 1: enable topn1 pin output setting output level of topn1 pin in status of waiting for external trigger 0: low level 1: high level 0/1 0/1 0/1 note tpnoe1 tpnol0 tpnoe0 tpnol1 topn1 pin output 16-bit counter ? when tpnol1 bit = 0 topn1 pin output 16-bit counter ? when tpnol1 bit = 1 note clear this bit to 0 when the topn0 pin is not used in the external trigger pulse output mode.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 428 figure 7-24. setting of registers in exte rnal trigger pulse output mode (2/2) (d) tmpn i/o control register 2 (tpnioc2) 00000 tpnioc2 select valid edge of external trigger input (tipn0 pin) 0 0/1 0/1 tpnees0 tpnets1 tpnets0 tpnees1 (e) tmpn counter read bu ffer register (tpncnt) the value of the 16-bit counter can be read by reading the tpncnt register. (f) tmpn capture/compare register s 0 and 1 (tpnccr0 and tpnccr1) if d 0 is set to the tpnccr0 register and d 1 to the tpnccr1 register, the cycle and active level of the pwm waveform are as follows. cycle = (d 0 + 1) count clock cycle active level width = d 1 count clock cycle remarks 1. tmpn i/o control register 1 (tpnioc1) and tmpn option register 0 (tpnopt0) are not used in the external trigger pulse output mode. 2. n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 429 (1) operation flow in extern al trigger pulse output mode figure 7-25. software processing flow in ex ternal trigger pulse output mode (1/2) ffffh 16-bit counter 0000h tpnce bit tpnccr0 register ccr0 buffer register inttpncc0 signal tpnccr1 register ccr1 buffer register inttpncc1 signal topn1 pin output external trigger input (tipn0 pin input) topn0 pin output (only when software trigger is used) d 10 d 00 d 00 d 01 d 00 d 00 d 10 d 10 d 11 d 10 d 10 d 10 d 11 d 10 d 01 d 00 d 10 d 10 d 00 d 10 d 00 d 11 d 11 d 01 d 01 d 01 <1> <2> <3> <4> <5> remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 430 figure 7-25. software processing flow in ex ternal trigger pulse output mode (2/2) tpnce bit = 1 setting of tpnccr0 register register initial setting tpnctl0 register (tpncks0 to tpncks2 bits) tpnctl1 register, tpnioc0 register, tpnioc2 register, tpnccr0 register, tpnccr1 register initial setting of these registers is performed before setting the tpnce bit to 1. the tpncks0 to tpncks2 bits can be set at the same time when counting is enabled (tpnce bit = 1). trigger wait status writing the same value (same as the tpnccr1 register already set) to the tpnccr1 register is necessary only when the set cycle is changed. when the counter is cleared after setting, the value of the tpnccra register is transferred to the ccra buffer register. start setting of tpnccr1 register <1> count operation start flow <2> tpnccr0 and tpnccr1 register setting change flow setting of tpnccr0 register when the counter is cleared after setting, the value of the tpnccra register is transferred to the ccra buffer register. setting of tpnccr1 register <4> tpnccr0, tpnccr1 register setting change flow only writing of the tpnccr1 register must be performed when the set duty factor is changed. when the counter is cleared after setting, the value of the tpnccra register is transferred to the ccra buffer register. setting of tpnccr1 register <3> tpnccr0, tpnccr1 register setting change flow tpnce bit = 0 counting is stopped. stop <5> count operation stop flow remark n = 0 to 8 m = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 431 (2) external trigger pulse output mode operation timing (a) note on changing pulse width during operation to change the pwm waveform while the counter is operating, write the tpnccr1 register last. rewrite the tpnccrm register after writing the tpnccr 1 register after the inttpncc0 signal is detected. ffffh 16-bit counter 0000h tpnce bit tpnccr0 register ccr0 buffer register inttpncc0 signal tpnccr1 register ccr1 buffer register inttpncc1 signal topn1 pin output external trigger input (tipn0 pin input) topn0 pin output (only when software trigger is used) d 10 d 00 d 00 d 01 d 00 d 10 d 11 d 10 d 11 d 01 d 10 d 10 d 00 d 00 d 11 d 11 d 01 d 01 remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 432 in order to transfer data from the tpnccra register to the ccra buffer register, the tpnccr1 register must be written. to change both the cycle and active level width of the pwm waveform at this time, first set the cycle to the tpnccr0 register and then set the active level width to the tpnccr1 register. to change only the cycle of the pwm waveform, first set the cycle to the tpnccr0 register, and then write the same value (same as the tpnccr1 regist er already set) to the tpnccr1 register. to change only the active level width (duty factor) of the pwm waveform, only the tpnccr1 register has to be set. after data is written to the tpnccr1 register, the val ue written to the tpnccra register is transferred to the ccra buffer register in synchr onization with clearing of the 16-bi t counter, and is used as the value compared with the 16-bit counter. to write the tpnccr0 or tpnccr1 register again after writing the tpnccr1 register once, do so after the inttpncc0 signal is generated. otherwise, the value of the ccra buffer register may become undefined because the timing of transferring data from the tpnccra register to the ccra buffer register conflicts with writing the tpnccra register. remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 433 (b) 0%/100% output of pwm waveform to output a 0% waveform, set the tpnccr1 register to 0000h. the 16-bit counter is cleared to 0000h and the inttpncc0 and inttpncc1 signals are generate d at the next timing after a match between the count value of the 16-bit counter and t he value of the ccr0 buffer register. count clock 16-bit counter tpnce bit tpnccr0 register tpnccr1 register inttpncc0 signal inttpncc1 signal topn1 pin output external trigger input (tipn0 pin input) d 0 l 0000h d 0 0000h d 0 0000h d 0 ? 1d 0 0000 ffff 0000 d 0 ? 1d 0 0000 0001 remark n = 0 to 8 to output a 100% waveform, set a value of (set value of tpnccr0 register + 1) to the tpnccr1 register. if the set value of the tpnccr0 register is ffffh, 100% output cannot be produced. d 0 d 0 + 1 d 0 d 0 + 1 d 0 d 0 + 1 d 0 0000 ffff 0000 d 0 0000 0001 count clock 16-bit counter tpnce bit tpnccr0 register tpnccr1 register inttpncc0 signal inttpncc1 signal topn1 pin output d 0 ? 1d 0 ? 1 external trigger input (tipn0 pin input) remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 434 (c) conflict between trigger detection and match with ccr1 buffer register if the trigger is detected immediately after the inttp ncc1 signal is generated, the 16-bit counter is immediately cleared to 0000h, the output signal of the topn1 pin is asserted, and the counter continues counting. consequently, the inactive peri od of the pwm waveform is shortened. 16-bit counter ccr1 buffer register inttpncc1 signal topn1 pin output external trigger input (tipn0 pin input) d 1 d 1 ? 1 0000 ffff 0000 shortened remark n = 0 to 8 if the trigger is detected immediately before the inttp ncc1 signal is generated, the inttpncc1 signal is not generated, and the 16-bit counter is cleared to 0000h and continues counting. t he output signal of the topn1 pin remains active. consequently, the active period of the pwm waveform is extended. 16-bit counter ccr1 buffer register inttpncc1 signal topn1 pin output external trigger input (tipn0 pin input) d 1 d 1 ? 2d 1 ? 1d 1 0000 ffff 0000 0001 extended remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 435 (d) conflict between trigger detection and match with ccr0 buffer register if the trigger is detected immediately after the inttp ncc0 signal is generated, the 16-bit counter is cleared to 0000h and continues counting up. therefore, the active period of the topn1 pin is extended by time from generation of the inttpncc0 signal to trigger detection. 16-bit counter ccr0 buffer register inttpncc0 signal topn1 pin output external trigger input (tipn0 pin input) d 0 d 0 ? 1d 0 0000 ffff 0000 0000 extended remark n = 0 to 8 if the trigger is detected immediately before the inttp ncc0 signal is generated, the inttpncc0 signal is not generated. the 16-bit counter is cleared to 0000h, the topn1 pin is asserted, and the counter continues counting. consequently, the inactive period of the pwm waveform is shortened. 16-bit counter ccr0 buffer register inttpncc0 signal topn1 pin output external trigger input (tipn0 pin input) d 0 d 0 ? 1d 0 0000 ffff 0000 0001 shortened remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 436 (e) generation timing of compare match interrupt request signal (inttpncc1) the timing of generation of the inttpncc1 signal in the external trigger pulse output mode differs from the timing of other mode inttpncc1 signals; the in ttpncc1 signal is generated when the count value of the 16-bit counter matches the value of the tpnccr1 register. count clock 16-bit counter tpnccr1 register topn1 pin output inttpncc1 signal d 1 d 1 ? 2d 1 ? 1d 1 d 1 + 1 d 1 + 2 remark n = 0 to 8 usually, the inttpncc1 signal is generated in synch ronization with the next count up, after the count value of the 16-bit counter matches the value of the tpnccr1 register. in the external trigger pulse output mode, however, it is generated one clock earlier. this is because the timing is changed to match the timing of cha nging the output signal of the topn1 pin.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 437 7.6.4 one-shot pulse output mode (tpnmd2 to tpnmd0 bits = 011) in the one-shot pulse output mode, 16-bit timer/event coun ter p waits for a trigger when the tpnctl0.tpnce bit is set to 1. when the valid edge of an external trigger inpu t (tipn0) is detected, 16-bit timer/event counter p starts counting, and outputs a one-shot pulse from the topn1 pin. instead of the external trigger (tipn0), a software trigger can also be generated to output the pulse. when the software trigger is used, the topn0 pin outputs the active le vel while the 16-bit counter is counting, and the inactive level when the counter is stopped (waiting for a trigger). figure 7-26. configuration in one-shot pulse output mode ccr0 buffer register tpnce bit tpnccr0 register tpnccr1 register ccr1 buffer register clear match signal match signal inttpncc0 signal output controller (rs-ff) topn1 pin inttpncc1 signal topn0 pin note count clock selection count start control edge detector software trigger generation tipn0 pin note (external trigger input) transfer transfer s r output controller (rs-ff) s r 16-bit counter note because the external trigger input pin (tipn0) and timer output pin (topn0) share the same alternate-function pin, two functions cannot be used at the same time. caution in one-shot pulse output mode, select th e internal clock (set tpnctl1.tpneee bit = 0) as the count clock. remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 438 figure 7-27. basic timing in one-shot pulse output mode ffffh 16-bit counter 0000h tpnce bit tpnccr0 register inttpncc0 signal tpnccr1 register inttpncc1 signal topn1 pin output external trigger input (tipn0 pin input) topn0 pin output (only when software trigger is used) d 1 d 0 d 0 d 1 d 1 d 1 d 0 d 0 delay (d 1 ) delay (d 1 ) delay (d 1 ) active level width (d 0 ? d 1 + 1) active level width (d 0 ? d 1 + 1) active level width (d 0 ? d 1 + 1) when the tpnce bit is set to 1, 16-bit timer/event counter p waits for a trigger. when the trigger is generated, the 16-bit counter is cleared from ffffh to 0000h, starts counti ng, and outputs a one-shot pul se from the topn1 pin. after the one-shot pulse is output, the 16-bit counter is set to 0000h, stops counting, and waits for a trigger. when the trigger is generated again, the 16-bit counter starts countin g from 0000h. generations of a trigger is ignored while the one-shot pulse is being output. the output delay period and active level width of the one-shot pulse can be calculated as follows. output delay period = (set value of tpnccr1 register) count clock cycle active level width = (set value of tpnccr0 register ? set value of tpnccr1 register + 1) count clock cycle the compare match interrupt request signal inttpncc0 is generated when the 16-bit counter counts after its count value matches the value of the ccr0 buffer regist er. the compare match interrupt request signal inttpncc1 is generated when the count value of the 16-bit counter matches the va lue of the ccr1 buffer register. the valid edge of an external trigger in put (tipn0 pin) or setting the software tr igger (tpnctl1.tpnest bit) to 1 is used as the trigger. remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 439 figure 7-28. setting of registers in one-shot pulse output mode (1/2) (a) tmpn control register 0 (tpnctl0) 0/1 0 0 0 0 tpnctl0 select count clock 0: stop counting 1: enable counting 0/1 0/1 0/1 tpncks2 tpncks1 tpncks0 tpnce (b) tmpn control register 1 (tpnctl1) 0 0/1 0 0 0 tpnctl1 0: operate on count clock selected by tpncks0 to tpncks2 bits generate software trigger when 1 is written 011 tpnmd2 tpnmd1 tpnmd0 tpneee tpnest 0, 1, 1: one-shot pulse output mode (c) tmpn i/o control register 0 (tpnioc0) 0 0 0 0 0/1 tpnioc0 0: disable topn0 pin output 1: enable topn0 pin output setting of topn0 pin output level in status of waiting for external trigger 0: low level 1: high level 0: disable topn1 pin output 1: enable topn1 pin output setting of topn1 pin output level in status of waiting for external trigger 0: low level 1: high level 0/1 0/1 0/1 note tpnoe1 tpnol0 tpnoe0 tpnol1 topn1 pin output 16-bit counter ? when tpnol1 bit = 0 topn1 pin output 16-bit counter ? when tpnol1 bit = 1 note clear this bit to 0 when the topn0 pin is not used in the one-shot pulse output mode.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 440 figure 7-28. setting of registers in one-shot pulse output mode (2/2) (d) tmpn i/o control register 2 (tpnioc2) 00000 tpnioc2 select valid edge of external trigger input (tipn0 pin) 0 0/1 0/1 tpnees0 tpnets1 tpnets0 tpnees1 (e) tmpn counter read bu ffer register (tpncnt) the value of the 16-bit counter can be read by reading the tpncnt register. (f) tmpn capture/compare register s 0 and 1 (tpnccr0 and tpnccr1) if d 0 is set to the tpnccr0 register and d 1 to the tpnccr1 register, the active level width and output delay period of the one-shot pulse are as follows. active level width = (d 0 ? d 1 + 1) count clock cycle output delay period = (d 1 ) count clock cycle caution one-shot pulses are not output even in the one-shot pulse outpu t mode, if the value set in the tpnccr1 register is greater than that set in the tpnccr0 register. remarks 1. tmpn i/o control register 1 (tpnioc1) and tmpn option register 0 (tpnopt0) are not used in the one-shot pulse output mode. 2. n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 441 (1) operation flow in one-shot pulse output mode figure 7-29. software processing flow in one-shot pulse output mode ffffh 16-bit counter 0000h tpnce bit tpnccr0 register inttpncc0 signal tpnccr1 register inttpncc1 signal topn1 pin output external trigger input (tipn0 pin input) <1> <3> tpnce bit = 1 register initial setting tpnctl0 register (tpncks0 to tpncks2 bits) tpnctl1 register, tpnioc0 register, tpnioc2 register, tpnccr0 register, tpnccr1 register initial setting of these registers is performed before setting the tpnce bit to 1. the tpncks0 to tpncks2 bits can be set at the same time when counting has been started (tpnce bit = 1). trigger wait status start <1> count operation start flow tpnce bit = 0 count operation is stopped stop <3> count operation stop flow d 10 d 00 d 11 d 01 d 00 d 10 d 11 <2> d 01 setting of tpnccr0, tpnccr1 registers as rewriting the tpnccra register immediately forwards to the ccra buffer register, rewriting immediately after the generation of the inttpncc0 signal is recommended. <2> tpnccr0, tpnccr1 register setting change flow remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 442 (2) operation timing in one-shot pulse output mode (a) note on rewriti ng tpnccra register if the value of the tpnccra register is rewritten to a smaller value during counting, the 16-bit counter may overflow. if there is a possibility of overfl ow, stop counting and then change the set value. ffffh 16-bit counter 0000h tpnce bit tpnccr0 register inttpncc0 signal tpnccr1 register inttpncc1 signal topn1 pin output external trigger input (tipn0 pin input) topn0 pin output (only when software trigger is used) d 10 d 11 d 00 d 01 d 00 d 10 d 10 d 10 d 01 d 11 d 00 d 00 delay (d 10 ) delay (d 10 ) active level width (d 00 ? d 10 + 1) active level width (d 00 ? d 10 + 1) delay (10000h + d 11 ) active level width (d 01 ? d 11 + 1) when the tpnccr0 register is rewritten from d 00 to d 01 and the tpnccr1 register from d 10 to d 11 where d 00 > d 01 and d 10 > d 11 , if the tpnccr1 register is rewritten when the count value of the 16-bit counter is greater than d 11 and less than d 10 and if the tpnccr0 register is rewritten when the count value is greater than d 01 and less than d 00 , each set value is reflected as soon as the register has been rewritten and compared with the count value. the counter count s up to ffffh and then counts up again from 0000h. when the count value matches d 11 , the counter generates the inttpncc1 signal and asserts the topn1 pin. when the count value matches d 01 , the counter generates the in ttpncc0 signal, deasserts the topn1 pin, and stops counting. therefore, the counter may output a pulse with a delay period or ac tive period different from that of the one-shot pulse that is originally expected. remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 443 (b) generation timing of compare match interrupt request signal (inttpncc1) the generation timing of the inttpncc1 signal in the on e-shot pulse output mode is different from other mode inttpncc1 signals; the inttpncc1 signal is gen erated when the count val ue of the 16-bit counter matches the value of the tpnccr1 register. count clock 16-bit counter tpnccr1 register topn1 pin output inttpncc1 signal d 1 d 1 ? 2d 1 ? 1d 1 d 1 + 1 d 1 + 2 remark n = 0 to 8 usually, the inttpncc1 signal is generated when the 16- bit counter counts up next time after its count value matches the value of the tpnccr1 register. in the one-shot pulse output mode, howe ver, it is generated one clock earlier. this is because the timing is changed to match the change timing of the topn1 pin. remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 444 7.6.5 pwm output mode (tpnmd 2 to tpnmd0 bits = 100) in the pwm output mode, a pwm waveform is output from the topn1 pin when the tpnctl0.tpnce bit is set to 1. in addition, a square wave with a duty factor of 50% with th e set value of the tpnccr0 register + 1 as half its cycle is output from the topn0 pin. figure 7-30. configuration in pwm output mode ccr0 buffer register tpnce bit tpnccr0 register 16-bit counter tpnccr1 register ccr1 buffer register clear match signal match signal inttpncc0 signal output controller (rs-ff) output controller topn1 pin inttpncc1 signal topn0 pin note transfer transfer s r count clock selection internal count clock tipn0 pin note (external event count input) edge detector note because the external event count input pin (t ipn0) and timer output pin (topn0) share the same alternate-function pin, two functions cannot be used at the same time. remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 445 figure 7-31. basic timing in pwm output mode ffffh 16-bit counter 0000h tpnce bit tpnccr0 register ccr0 buffer register inttpncc0 signal topn0 pin output tpnccr1 register ccr1 buffer register inttpncc1 signal topn1 pin output d 10 d 00 d 00 d 01 d 00 d 10 d 11 d 10 d 11 d 01 d 10 d 10 d 00 d 00 d 11 d 11 d 01 d 01 active period (d 10 ) cycle (d 00 + 1) inactive period (d 00 ? d 10 + 1) when the tpnce bit is set to 1, the 16-bit counter is cleared from ffffh to 0000h, starts count ing, and outputs a pwm waveform from the topn1 pin. the active level width, cycle, and duty factor of the pwm waveform can be calculated as follows. active level width = (set value of tpnccr1 register ) count clock cycle cycle = (set value of tpnccr0 register + 1) count clock cycle duty factor = (set value of tpnccr1 regist er)/(set value of tpnccr0 register + 1) the pwm waveform can be changed by rewriting the tpnccra register while the counter is operating. the newly written value is reflected when the count value of the 16-bit counter matches the value of the ccr0 buffer register and the 16-bit counter is cleared to 0000h. the compare match interrupt request signal inttpncc0 is generated when the 16-bit counter counts next time after its count value matches the value of the ccr0 buffer register, and the 16-bit counter is cleared to 0000h. the compare match interrupt request signal inttpncc1 is gener ated when the count value of the 16-bit counter matches the value of the ccr1 buffer register. the value set to the tpnccra register is transferred to t he ccra buffer register when the count value of the 16-bit counter matches the value of the ccra buffer regi ster and the 16-bit counter is cleared to 0000h. remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 446 figure 7-32. setting of registers in pwm output mode (1/2) (a) tmpn control register 0 (tpnctl0) 0/1 0 0 0 0 tpnctl0 select count clock note 0: stop counting 1: enable counting 0/1 0/1 0/1 tpncks2 tpncks1 tpncks0 tpnce note the setting is invalid when the tpnctl1.tpneee bit = 1. (b) tmpn control register 1 (tpnctl1) 0 0 0/1 0 0 tpnctl1 100 tpnmd2 tpnmd1 tpnmd0 tpneee tpnest 1, 0, 0: pwm output mode 0: operate on count clock selected by tpncks0 to tpncks2 bits 1: count external event input signal (c) tmpn i/o control register 0 (tpnioc0) 0 0 0 0 0/1 tpnioc0 0: disable topn0 pin output 1: enable topn0 pin output setting of topn0 pin output level before count operation 0: low level 1: high level 0: disable topn1 pin output 1: enable topn1 pin output setting of topn1 pin output level before count operation 0: low level 1: high level 0/1 0/1 tpnoe1 tpnol0 tpnoe0 tpnol1 topn1 pin output 16-bit counter ? when tpnol1 bit = 0 topn1 pin output 16-bit counter ? when tpnol1 bit = 1 0/1 note note clear this bit to 0 when the topn0 pin is not used in the pwm output mode.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 447 figure 7-32. register setting in pwm output mode (2/2) (d) tmpn i/o control register 2 (tpnioc2) 0 0 0 0 0/1 tpnioc2 select valid edge of external event count input (tipn0 pin). 0/1 0 0 tpnees0 tpnets1 tpnets0 tpnees1 (e) tmpn counter read bu ffer register (tpncnt) the value of the 16-bit counter can be read by reading the tpncnt register. (f) tmpn capture/compare register s 0 and 1 (tpnccr0 and tpnccr1) if d 0 is set to the tpnccr0 register and d 1 to the tpnccr1 register, the cycle and active level of the pwm waveform are as follows. cycle = (d 0 + 1) count clock cycle active level width = d 1 count clock cycle remarks 1. tmpn i/o control register 1 (tpnioc1) and tmpn option register 0 (tpnopt0) are not used in the pwm output mode. 2. n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 448 (1) operation flow in pwm output mode figure 7-33. software processing flow in pwm output mode (1/2) ffffh 16-bit counter 0000h tpnce bit tpnccr0 register ccr0 buffer register inttpncc0 signal topn0 pin output tpnccr1 register ccr1 buffer register inttpncc1 signal topn1 pin output d 10 d 00 d 00 d 01 d 00 d 00 d 10 d 10 d 11 d 10 d 10 d 10 d 11 d 10 d 01 d 00 d 10 d 10 d 00 d 10 d 00 d 11 d 11 d 01 d 01 d 01 <1> <2> <3> <4> <5> remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 449 figure 7-33. software processing flow in pwm output mode (2/2) tpnce bit = 1 setting of tpnccr0 register register initial setting tpnctl0 register (tpncks0 to tpncks2 bits) tpnctl1 register, tpnioc0 register, tpnioc2 register, tpnccr0 register, tpnccr1 register initial setting of these registers is performed before setting the tpnce bit to 1. the tpncks0 to tpncks2 bits can be set at the same time when counting is enabled (tpnce bit = 1). when the counter is cleared after setting, the value of the tpnccra register is transferred to the ccra buffer register. start setting of tpnccr1 register <1> count operation start flow <2> tpnccr0, tpnccr1 register setting change flow (frequency only) setting of tpnccr0 register when the counter is cleared after setting, the value of the tpnccra register is transferred to the ccra buffer register. setting of tpnccr1 register <4> tpnccr0, tpnccr1 register setting change flow (frequency and duty) only writing of the tpnccr1 register must be performed when the set duty factor is changed. when the counter is cleared after setting, the value of compare register a is transferred to the ccra buffer register. setting of tpnccr1 register <3> tpnccr0, tpnccr1 register setting change flow (duty only) tpnce bit = 0 counting is stopped. stop <5> count operation stop flow writing the same value (same as the value of the tpnccr1 register already set) to the tpnccr1 register is necessary only when the set cycle is changed. remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 450 (2) pwm output mode operation timing (a) changing pulse width during operation to change the pwm waveform while the counter is operating, write the tpnccr1 register last. rewrite the tpnccra register after writing the tpnccr1 register after the inttpncc0 signal is detected. ffffh 16-bit counter 0000h tpnce bit tpnccr0 register ccr0 buffer register tpnccr1 register ccr1 buffer register topn1 pin output inttpncc0 signal d 10 d 00 d 00 d 01 d 00 d 10 d 11 d 10 d 11 d 01 d 10 d 10 d 00 d 00 d 11 d 11 d 01 d 01 to transfer data from the tpnccra register to the ccra buffer register, the tpnccr1 register must be written. to change both the cycle and active level of the pwm waveform at this time, first set the cycle to the tpnccr0 register and then set the active level to the tpnccr1 register. to change only the cycle of the pwm waveform, first set the cycle to the tpnccr0 register, and then write the same value (same as the value of the tpnccr1 register already set) to the tpnccr1 register. to change only the active level width (duty factor) of the pwm waveform, only the tpnccr1 register has to be set. after data is written to the tpnccr1 register, the val ue written to the tpnccra register is transferred to the ccra buffer register in synchr onization with clearing of the 16-bi t counter, and is used as the value compared with the 16-bit counter. to write the tpnccr0 or tpnccr1 register again after writing the tpnccr1 register once, do so after the inttpncc0 signal is generated. otherwise, the value of the ccra buffer register may become undefined because the timing of transferring data from the tpnccra register to the ccra buffer register conflicts with writing the tpnccra register. remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 451 (b) 0%/100% output of pwm waveform to output a 0% waveform, set the tpnccr1 register to 0000h. the 16-bit counter is cleared to 0000h and the inttpncc0 and inttpncc1 signals are generate d at the next timing after a match between the count value of the 16-bit counter and t he value of the ccr0 buffer register. count clock 16-bit counter tpnce bit tpnccr0 register tpnccr1 register inttpncc0 signal inttpncc1 signal topn1 pin output d 00 0000h d 00 0000h d 00 0000h d 00 ? 1d 00 0000 ffff 0000 d 00 ? 1d 00 0000 0001 l remark n = 0 to 8 to output a 100% waveform, set a value of (set value of tpnccr0 register + 1) to the tpnccr1 register. if the set value of the tpnccr0 register is ffffh, 100% output cannot be produced. d 00 d 00 + 1 d 00 d 00 + 1 d 00 d 00 + 1 d 00 0000 ffff 0000 d 00 0000 0001 count clock 16-bit counter tpnce bit tpnccr0 register tpnccr1 register inttpncc0 signal inttpncc1 signal topn1 pin output d 00 ? 1d 00 ? 1 l remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 452 (c) generation timing of compare match interrupt request signal (inttpncc1) the timing of generation of the inttpncc1 signal in the pwm output mode differs from the timing of other mode inttpncc1 signals; the inttpncc1 signal is gen erated when the count val ue of the 16-bit counter matches the value of the tpnccr1 register. count clock 16-bit counter tpnccr1 register topn1 pin output inttpncc1 signal d 1 d 1 ? 2d 1 ? 1d 1 d 1 + 1 d 1 + 2 remark n = 0 to 8 usually, the inttpncc1 signal is generated in synch ronization with the next counting up after the count value of the 16-bit counter matches the value of the tpnccr1 register. in the pwm output mode, however, it is generated one clock earlier. this is because the timing is changed to match the change timing of the output signal of the topn1 pin.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 453 7.6.6 free-running timer mode (t pnmd2 to tpnmd0 bits = 101) in the free-running timer mode, 16-bit timer/event counter p starts counting when the tp nctl0.tpnce bit is set to 1. at this time, the tpnccra register can be used as a compare register or a c apture register, depending on the setting of the tpnopt0.tpnccs 0 and tpnopt0.tpnccs1 bits. figure 7-34. configuration in free-running timer mode tpnccr0 register (capture) tpnce bit tpnccr1 register (compare) 16-bit counter tpnccr1 register (compare) tpnccr0 register (capture) output controller tpnccs0, tpnccs1 bits (capture/compare selection) topn0 pin note 1 output controller topn1 pin note 2 edge detector count clock selection edge detector edge detector tipn0 pin note 1 (external event count input/ capture trigger input) tipn1 pin note 2 (capture trigger input) internal count clock 0 1 0 1 inttpnov signal inttpncc1 signal inttpncc0 signal notes 1. because the external event count input pin (tipn0), capture trigger input pin (tipn0), and timer output pin (topn0) share the same alte rnate-function pin, two or more functions cannot be used at the same time. 2. because the capture trigger i nput pin (tipb1) and timer output pin (topb1) share the same alternate-function pin, two or more func tions cannot be used at the same time. remark n = 0 to 8 a = 0, 1 b = 0 to 6, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 454 ? compare operation when the tpnce bit is set to 1, 16-bit timer/event counte r p starts counting, and the output signals of the topn0 and topn1 pins are inverted. when the count value of the 16-bit counter later matches the set value of the tpnccra register, a compare match interrupt request sign al (inttpncca) is generated, and the output signal of the topna pin is inverted. the 16-bit counter continues counting in synchronization with the count cloc k. when it counts up to ffffh, it generates an overflow interrupt request signal (inttpnov) at the next clock, is cleared to 0000h, and continues counting. at this time, the overflow flag (tpnopt0.tpnovf bi t) is also set to 1. confirm that the overflow flag is set to 1 and then clear it to 0 by executing the clr instruction via software. the tpnccra register can be rewritten while the counter is operating. if it is rewritten, the new value is reflected at that time by anytime write, and compared with the count value. figure 7-35. basic timing in free-r unning timer mode (compare function) ffffh 16-bit counter 0000h tpnce bit tpnccr0 register inttpncc0 signal topn0 pin output tpnccr1 register inttpncc1 signal topn1 pin output inttpnov signal tpnovf bit d 00 d 01 d 10 d 11 d 00 d 10 d 10 d 11 d 11 d 11 d 00 d 01 d 01 cleared to 0 by clr instruction cleared to 0 by clr instruction cleared to 0 by clr instruction cleared to 0 by clr instruction remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 455 ? capture operation when the tpnce bit is set to 1, the 16-bit counter starts counting. when the valid edge input to the tipna pin is detected, the count value of the 16-bit counter is stored in the tpnccra register, and a capture interrupt request signal (inttpncca) is generated. the 16-bit counter continues counting in synchronization with the count cloc k. when it counts up to ffffh, it generates an overflow interrupt request signal (inttpnov) at the next clock, is cleared to 0000h, and continues counting. at this time, the overflow flag (tpnopt0.tpnovf bi t) is also set to 1. confirm that the overflow flag is set to 1 and then clear it to 0 by executing the clr instruction via software. figure 7-36. basic timing in free-r unning timer mode (capture function) ffffh 16-bit counter 0000h tpnce bit tipn0 pin input tpnccr0 register inttpncc0 signal tipn1 pin input tpnccr1 register inttpncc1 signal inttpnov signal tpnovf bit d 00 d 01 d 02 d 03 d 10 d 00 d 01 d 02 d 03 d 11 d 12 d 13 d 10 d 11 d 12 d 13 cleared to 0 by clr instruction cleared to 0 by clr instruction cleared to 0 by clr instruction remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 456 figure 7-37. register setting in free-running timer mode (1/3) (a) tmpn control register 0 (tpnctl0) 0/1 0 0 0 0 tpnctl0 select count clock note 0: stop counting 1: enable counting 0/1 0/1 0/1 tpncks2 tpncks1 tpncks0 tpnce note the setting is invalid when the tpnctl1.tpneee bit = 1 (b) tmpn control register 1 (tpnctl1) 0 0 0/1 0 0 tpnctl1 101 tpnmd2 tpnmd1 tpnmd0 tpneee tpnest 1, 0, 1: free-running timer mode 0: operate with count clock selected by tpncks0 to tpncks2 bits 1: count on external event count input signal (c) tmpn i/o control register 0 (tpnioc0) 0 0 0 0 0/1 tpnioc0 0: disable topn0 pin output 1: enable topn0 pin output setting topn0 pin output level before count operation 0: low level 1: high level 0: disable topn1 pin output 1: enable topn1 pin output setting topn1 pin output level before count operation 0: low level 1: high level 0/1 0/1 0/1 tpnoe1 tpnol0 tpnoe0 tpnol1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 457 figure 7-37. register setting in free-running timer mode (2/3) (d) tmpn i/o control register 1 (tpnioc1) 0 0 0 0 0/1 tpnioc1 select valid edge of tipn0 pin input note select valid edge of tipn1 pin input 0/1 0/1 0/1 tpnis2 tpnis1 tpnis0 tpnis3 note set the valid edge selection of the unused alternat e external input signals to ?no edge detection?. (e) tmpn i/o control register 2 (tpnioc2) 0 0 0 0 0/1 tpnioc2 0/1 0 0 tpnees0 tpnets1 tpnets0 tpnees1 select valid edge of external event count input (tipn0 pin) note note set the valid edge selection of the unused alternat e external input signals to ?no edge detection?. (f) tmpn option register 0 (tpnopt0) 0 0 0/1 0/1 0 tpnopt0 overflow flag specifies if tpnccr0 register functions as capture or compare register 0: compare register 1: capture register specifies if tpnccr1 register functions as capture or compare register 0: compare register 1: capture register 0 0 0/1 tpnccs0 tpnovf tpnccs1 (g) tmpn counter read bu ffer register (tpncnt) the value of the 16-bit counter can be read by reading the tpncnt register.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 458 figure 7-37. register setting in free-running timer mode (3/3) (h) tmpn capture/compare regist ers 0 and 1 (tpnccr0 and tpnccr1) these registers function as captur e registers or compare registers depending on the setting of the tpnopt0.tpnccsa bit. when the registers function as captur e registers, they store the count value of the 16-bit counter when the valid edge input to t he tipna pin is detected. when the registers function as compare registers and when d a is set to the tpnccra register, the inttpncca signal is generated when the counter reaches (d a + 1), and the output signal of the topna pin is inverted. remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 459 (1) operation flow in free-running timer mode (a) when using capture/compare register as compare register figure 7-38. software processing flow in fr ee-running timer mode (c ompare function) (1/2) d 00 d 01 d 10 d 11 d 00 d 10 d 10 d 11 d 11 d 11 d 00 d 01 d 01 cleared to 0 by clr instruction cleared to 0 by clr instruction cleared to 0 by clr instruction <1> <2> <2> <2> <3> ffffh 16-bit counter 0000h tpnce bit tpnccr0 register inttpncc0 signal topn0 pin output tpnccr1 register inttpncc1 signal topn1 pin output inttpnov signal tpnovf bit remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 460 figure 7-38. software processing flow in fr ee-running timer mode (c ompare function) (2/2) tpnce bit = 1 read tpnopt0 register (check overflow flag). register initial setting tpnctl0 register (tpncks0 to tpncks2 bits) tpnctl1 register, tpnioc0 register, tpnioc2 register, tpnopt0 register, tpnccr0 register, tpnccr1 register initial setting of these registers is performed before setting the tpnce bit to 1. the tpncks0 to tpncks2 bits can be set at the same time when counting has been started (tpnce bit = 1). start execute instruction to clear tpnovf bit (clr tpnovf). <1> count operation start flow <2> overflow flag clear flow tpnce bit = 0 counter is initialized and counting is stopped by clearing tpnce bit to 0. stop <3> count operation stop flow tpnovf bit = 1 no yes remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 461 (b) when using capture/compare register as capture register figure 7-39. software processing flow in fr ee-running timer mode (c apture function) (1/2) ffffh 16-bit counter 0000h tpnce bit tipn0 pin input tpnccr0 register inttpncc0 signal tipn1 pin input tpnccr1 register inttpncc1 signal inttpnov signal tpnovf bit d 00 0000 0000 d 01 d 02 d 03 d 10 d 00 d 01 d 02 d 03 d 11 d 12 d 10 0000 d 11 d 12 0000 cleared to 0 by clr instruction cleared to 0 by clr instruction <3> <1> <2> <2> remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 462 figure 7-39. software processing flow in fr ee-running timer mode (c apture function) (2/2) tpnce bit = 1 read tpnopt0 register (check overflow flag). register initial setting tpnctl0 register (tpncks0 to tpncks2 bits) tpnctl1 register, tpnioc1 register, tpnopt0 register initial setting of these registers is performed before setting the tpnce bit to 1. the tpncks0 to tpncks2 bits can be set at the same time when counting has been started (tpnce bit = 1). start execute instruction to clear tpnovf bit (clr tpnovf). <1> count operation start flow <2> overflow flag clear flow tpnce bit = 0 counter is initialized and counting is stopped by clearing tpnce bit to 0. stop <3> count operation stop flow tpnovf bit = 1 no yes remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 463 (2) operation timing in free-running timer mode (a) interval operation with compare register when 16-bit timer/event counter p is used as an interval timer with the tpnccra register used as a compare register, software processing is necessary for setting a comparison value to generate the next interrupt request signal each time the inttpncca signal has been detected. ffffh 16-bit counter 0000h tpnce bit tpnccr0 register inttpncc0 signal topn pin output tpnccr1 register inttpncc1 signal topn1 pin output d 00 d 01 d 02 d 03 d 04 d 05 d 10 d 00 d 11 d 01 d 12 d 04 d 13 d 02 d 03 d 11 d 10 d 12 d 13 d 14 interval period (d 10 + 1) interval period (10000h + d 11 ? d 10 ) interval period (10000h + d 12 ? d 11 ) interval period (10000h + d 13 ? d 12 ) interval period (d 00 + 1) interval period (10000h + d 01 ? d 00 ) interval period (d 02 ? d 01 ) interval period (10000h + d 03 ? d 02 ) interval period (10000h + d 04 ? d 03 ) when performing an interval operation in the free-running timer mode, two intervals can be set with one channel. to perform the interval operation, the value of the corresponding tpnccra register must be re-set in the interrupt servicing that is executed when the inttpncca signal is detected. the set value for re-setting the tpnccra register can be calculated by the following expression, where ?d a ? is the interval period. compare register default value: d a ? 1 value set to compare register second and subsequent time: previous set value + d a (if the calculation result is greate r than ffffh, subtract 10000h from the result and set this value to the register.) remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 464 (b) pulse width measurement with capture register when pulse width measurement is performed with the tpnccra register used as a capture register, software processing is necessary for reading the capt ure register each time the inttpncca signal has been detected and for calculating an interval. ffffh 16-bit counter 0000h tpnce bit tipn0 pin input tpnccr0 register inttpncc0 signal tipn1 pin input tpnccr1 register inttpncc1 signal inttpnov signal tpnovf bit 0000h d 00 d 01 d 02 d 03 d 04 d 10 d 00 d 11 d 01 d 12 d 04 d 13 d 02 d 03 d 10 0000h d 11 d 12 d 13 pulse interval (d 00 ) pulse interval (10000h + d 01 ? d 00 ) pulse interval (d 02 ? d 01 ) pulse interval (10000h + d 03 ? d 02 ) pulse interval (10000h + d 04 ? d 03 ) pulse interval (d 10 ) pulse interval (10000h + d 11 ? d 10 ) pulse interval (10000h + d 12 ? d 11 ) pulse interval (10000h + d 13 ? d 12 ) cleared to 0 by clr instruction cleared to 0 by clr instruction cleared to 0 by clr instruction when executing pulse width measurement in the fr ee-running timer mode, two pulse widths can be measured with one channel. to measure a pulse width, the pulse width can be calcul ated by reading the value of the tpnccra register in synchronization with the inttpncca signal, and calculating the difference between the read value and the previously read value. remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 465 (c) processing of overflow when two capture registers are used care must be exercised in processing the overflow flag when two capture registers are used. first, an example of incorrect processing is shown below. example of incorrect processing when two capture regi sters are used ffffh 16-bit counter 0000h tpnce bit tipn0 pin input tpnccr0 register tipn1 pin input tpnccr1 register inttpnov signal tpnovf bit d 00 d 01 d 10 d 11 d 10 <1> <2> <3> <4> d 00 d 11 d 01 the following problem may occur when two pulse widt hs are measured in the free-running timer mode. <1> read the tpnccr0 register (setting of t he default value of the tipn0 pin input). <2> read the tpnccr1 register (setting of t he default value of the tipn1 pin input). <3> read the tpnccr0 register. read the overflow flag. if the overflow flag is 1, clear it to 0. because the overflow flag is 1, the pulse width can be calculated by (10000h + d 01 ? d 00 ). <4> read the tpnccr1 register. read the overflow flag. because the flag is cleared in <3>, 0 is read. because the overflow flag is 0, the pulse width can be calculated by (d 11 ? d 10 ) (incorrect). remark n = 0 to 8 when two capture registers are used, and if the overflow flag is cleared to 0 by one capture register, the other capture register may not obtain the correct pulse width. use software when using two capture registers. an example of how to use software is shown below.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 466 (1/2) example when two capture registers are used (usi ng overflow interrupt) ffffh 16-bit counter 0000h tpnce bit inttpnov signal tpnovf bit tpnovf0 flag note tipn0 pin input tpnccr0 register tpnovf1 flag note tipn1 pin input tpnccr1 register d 10 d 11 d 00 d 01 d 10 <1> <2> <5> <6> <3> <4> d 00 d 11 d 01 note the tpnovf0 and tpnovf1 flags are set on the internal ram by software. <1> read the tpnccr0 register (setting of t he default value of the tipn0 pin input). <2> read the tpnccr1 register (setting of t he default value of the tipn1 pin input). <3> an overflow occurs. set the tpnovf0 and tpnovf 1 flags to 1 in the overflow interrupt servicing, and clear the overflow flag to 0. <4> read the tpnccr0 register. read the tpnovf0 flag. if the tpnovf0 flag is 1, clear it to 0. because the tpnovf0 flag is 1, the pulse width can be calculated by (10000h + d 01 ? d 00 ). <5> read the tpnccr1 register. read the tpnovf1 flag. if the tpnovf1 flag is 1, clear it to 0 (the tpnovf0 flag is cleared in <4>, and the tpnovf1 flag remains 1). because the tpnovf1 flag is 1, the pulse width can be calculated by (10000h + d 11 ? d 10 ) (correct). <6> same as <3> remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 467 (2/2) example when two capture re gisters are used (without using overflow interrupt) ffffh 16-bit counter 0000h tpnce bit inttpnov signal tpnovf bit tpnovf0 flag note tipn0 pin input tpnccr0 register tpnovf1 flag note tipn1 pin input tpnccr1 register d 10 d 11 d 00 d 01 d 10 <1> <2> <5> <6> <3> <4> d 00 d 11 d 01 l note the tpnovf0 and tpnovf1 flags are set on the internal ram by software. <1> read the tpnccr0 register (setting of t he default value of the tipn0 pin input). <2> read the tpnccr1 register (setting of t he default value of the tipn1 pin input). <3> an overflow occurs. nothing is done by software. <4> read the tpnccr0 register. read the overflow flag. if the overflow flag is 1, set only the tpnovf1 flag to 1, and clear the overflow flag to 0. because the overflow flag is 1, the pulse width can be calculated by (10000h + d 01 ? d 00 ). <5> read the tpnccr1 register. read the overflow flag. because the overflow flag is cleared in <4>, 0 is read. read the tpnovf1 flag. if the tpnovf1 flag is 1, clear it to 0. because the tpnovf1 flag is 1, the pul se width can be calculated by (10000h + d 11 ? d 10 ) (correct). <6> same as <3> remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 468 (d) processing of overflow if capture trigger interval is long if the pulse width is greater than one cycle of the 16- bit counter, care must be exercised because an overflow may occur more than once from the first captur e trigger to the next. first, an example of incorrect processing is shown below. example of incorrect processing when capture trigger interval is long ffffh 16-bit counter 0000h tpnce bit tipna pin input tpnccra register inttpnov signal tpnovf bit d a0 d a1 d a0 d a1 <1> <2> <3> <4> 1 cycle of 16-bit counter pulse width the following problem may occur when long pulse width is measured in the free-running timer mode. <1> read the tpnccra register (setting of t he default value of the tipna pin input). <2> an overflow occurs. nothing is done by software. <3> an overflow occurs a second time. nothing is done by software. <4> read the tpnccra register. read the overflow flag. if the overflow flag is 1, clear it to 0. because the overflow flag is 1, the pul se width can be calculated by (10000h + d a1 ? d a0 ) (incorrect). actually, the pulse width must be (20000h + d a1 ? d a0 ) because an overflow occurs twice. remark n = 0 to 8, a = 0, 1 if an overflow occurs twice or more when the capture tr igger interval is long, the correct pulse width may not be obtained. if the capture trigger interval is long, slow the count clock to lengthen one cycle of the 16-bit counter, or use software. an example of how to use software is shown next.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 469 example when capture trigger interval is long ffffh 16-bit counter 0000h tpnce bit tipna pin input tpnccra register inttpnov signal tpnovf bit overflow counter note d a0 d a1 1h 0h 2h 0h d a0 d a1 <1> <2> <3> <4> 1 cycle of 16-bit counter pulse width note the overflow counter is set arbitrarily by software on the internal ram. <1> read the tpnccra register (setting of t he default value of the tipna pin input). <2> an overflow occurs. increment the overflow count er and clear the overflow flag to 0 in the overflow interrupt servicing. <3> an overflow occurs a second time. increment (+1) the overflow counter and clear the overflow flag to 0 in the overflow interrupt servicing. <4> read the tpnccra register. read the overflow counter. when the overflow counter is ?n?, t he pulse width can be calculated by (n 10000h + d a1 ? d a0 ). in this example, the pulse width is (20000h + d a1 ? d a0 ) because an overflow occurs twice. clear the overflow counter (0h). remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 470 (e) clearing overflow flag the overflow flag can be cleared to 0 by clearing t he tpnovf bit to 0 with the clr instruction after reading the tpnovf bit when it is 1 and by writing 8-bi t data (bit 0 is 0) to t he tpnopt0 register after reading the tpnovf bit when it is 1. (3) note on capture operation when the capture operation is used and a slow clock is selected as the count clock, ffffh, not 0000h, may be captured in the tpnccra register , or the capture operation may not be performed (capture interrupt does not occur) if the capture trigger is input immedi ately after the tpnctl0.tpnce bit is set to 1. the same operation results during the period in which no external event counts are input while the capture operation is used and an external event count input is used as a count clock. count clock 0000h ffffh tpnce bit tpnccr0 register ffffh 0001h 0000h tipn0 pin input capture trigger input 16-bit counter sampling clock capture trigger input remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 471 7.6.7 pulse width measurement mode (tpnmd2 to tpnmd0 bits = 110) in the pulse width measurement mode, 16-bit timer/event counter p starts counting when the tpnctl0.tpnce bit is set to 1. each time the valid edge input to the tipna pi n has been detected, the count va lue of the 16-bit counter is stored in the tpnccra register, and the 16-bit counter is cleared to 0000h. the interval of the valid edge can be measured by readin g the tpnccra register after a capture interrupt request signal (inttpncca) occurs. for example, in case of figure 7-41, select either t he tipn0 or tipn1 pin as the capture trigger input pin, and specify ?no edge detected? by using the tpnioc1 register for the unused pin. figure 7-40. configuration in pulse width measurement mode tpnccr0 register (capture) tpnce bit tpnccr1 register (capture) count clock selection edge detector edge detector tipn0 pin (capture trigger input) tipn1 pin (capture trigger input) clear inttpnov signal inttpncc0 signal inttpncc1 signal 16-bit counter caution when in pulse width measurement mode, select the internal clock (set tpnctl1.tpneee bit = 0) as the count clock. remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 472 figure 7-41. basic timing in pulse width measurement mode ffffh 16-bit counter 0000h tpnce bit tipna pin input tpnccra register inttpncca signal inttpnov signal tpnovf bit d 0 0000h d 1 d 2 d 3 cleared to 0 by clr instruction remark n = 0 to 8 a = 0, 1 when the tpnce bit is set to 1, the 16-bit counter starts counting. when the valid edge input to the tipna pin is later detected, the count value of the 16-bit counter is stored in the tpnccra register, the 16-bit counter is cleared to 0000h, and a capture interrupt request signal (inttpncca) is generated. the pulse width is calculated as follows. pulse width = captured value count clock cycle if the valid edge is not input to the tipnm pin even wh en the 16-bit counter counted up to ffffh, an overflow interrupt request signal (inttpnov) is generated at the next count clock, and the counter is cleared to 0000h and continues counting. at this time, the overflow flag (tpnopt0.t pnovf bit) is also set to 1. clear the overflow flag to 0 by executing the clr instruction via software. if the overflow flag is set to 1, the pu lse width can be calculated as follows. pulse width = (10000h tpnovf bit set (1) count + captured value) count clock cycle remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 473 figure 7-42. register setting in pu lse width measurement mode (1/2) (a) tmpn control register 0 (tpnctl0) 0/1 0 0 0 0 tpnctl0 select count clock 0: stop counting 1: enable counting 0/1 0/1 0/1 tpncks2 tpncks1 tpncks0 tpnce (b) tmpn control register 1 (tpnctl1) 00000 tpnctl1 110 tpnmd2 tpnmd1 tpnmd0 tpneee tpnest 1, 1, 0: pulse width measurement mode 0: operate with count clock selected by tpncks0 to tpncks2 bits (c) tmpn i/o control register 1 (tpnioc1) 0 0 0 0 0/1 tpnioc1 select valid edge of tipn0 pin input select valid edge of tipn1 pin input 0/1 0/1 0/1 tpnis2 tpnis1 tpnis0 tpnis3
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 474 figure 7-42. register setting in pu lse width measurement mode (2/2) (d) tmpn option register 0 (tpnopt0) 00000 tpnopt0 overflow flag 0 0 0/1 tpnccs0 tpnovf tpnccs1 (e) tmpn counter read bu ffer register (tpncnt) the value of the 16-bit counter can be read by reading the tpncnt register. (f) tmpn capture/compare register s 0 and 1 (tpnccr0 and tpnccr1) these registers store the count valu e of the 16-bit counter when the valid edge input to the tipna pin is detected. remarks 1. tmpn i/o control register 0 (tpnioc0) and tmpn i/o control register 2 (tpnioc2) are not used in the pulse width measurement mode. 2. n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 475 (1) operation flow in pul se width measurement mode figure 7-43. software processing flow in pulse width measurement mode tpnce bit = 1 tpnce bit = 0 register initial setting tpnctl0 register (tpncks0 to tpncks2 bits), tpnctl1 register, tpnioc1 register, tpnopt0 register initial setting of these registers is performed before setting the tpnce bit to 1. the tpncks0 to tpncks2 bits can be set at the same time when counting has been started (tpnce bit = 1). the counter is initialized and counting is stopped by clearing the tpnce bit to 0. start stop <1> count operation start flow <2> count operation stop flow <1> <2> ffffh 16-bit counter 0000h tpnce bit tipn0 pin input tpnccr0 register inttpncc0 signal d 0 0000h 0000h d 1 d 2 remark n = 0 to 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 476 (2) operation timing in pul se width measurement mode (a) clearing overflow flag the overflow flag can be cleared to 0 by clearing t he tpnovf bit to 0 with the clr instruction after reading the tpnovf bit when it is 1 and by writing 8-bi t data (bit 0 is 0) to t he tpnopt0 register after reading the tpnovf bit when it is 1. (3) notes if a slow clock is selected as the count clock, ffffh, not 0000h, may be captured to the tpnccra register, or the capture operation may not be performed (capture interr upt does not occur) if the capture trigger is input immediately after the tpnctl0.tpnce bit has been set to 1. count clock 0000h ffffh tpnce bit tpnccr0 register ffffh 0002h 0000h tipn0 pin input capture trigger input 16-bit counter sampling clock capture trigger input remark n = 0 to 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 477 7.6.8 encoder count function (only for tmp7 and tmp8) the encoder count function incl udes an encoder compare mode (see 7.6.9 encoder compare mode (tpmmd3 to tpmmd0 bits = 1000) ). mode tpmccr0 register tpmccr1 register encoder compare mode compare only compare only (1) count-up/-down control counting up or down by the 16-bit counter is contro lled by the phase of input encoder signals (tencm0 and tencm1) and setting of the tpmctl2.tp muds1 and tpmctl2.tpmuds0 bits. when the encoder count function is us ed, the internal count clock and ex ternal event count input (tipm0) cannot be used. set the tpmctl0.tpmcks2 to tpmctl0.tpmcks0 bits to 000 and the tpmctl1.tpmeee bit to 0. (2) setting initial value of 16-bit counter the initial count value set to the tpmtcw register when the tpmctl2.tpmecc bit = 0 is transferred to the 16-bit counter immediately after the counter starts its operation (tpmctl0.tpmce bit = 0 1), and the counter starts the operation after it detects the valid edge of the encoder input signal (tencm0 or tencm1). (3) basic operation the tpmccra register generates a compare match interrupt request signal (inttpmcca) when the count value of the 16-bit counter matches t he value of the ccra buffer register. (4) clear operation the 16-bit counter is cleared when the following condit ions are satisfied in the encoder compare mode. ? when the value of the 16-bit count er matches the value of the com pare register (the tpmctl2.tpmecm1 and tpmctl2.tpmecm0 bits are set) ? when the edge of the encoder clear input signal (tecrm) is detected and cleared (the tpmecs1 and tpmecs0 bits are set when the tpmioc3.tpmsce bit = 0) ? when the clear level condition of the tencm0, tencm1, and tecrm pins is detected (the tpmzcl, tpmbcl, and tpmacl bits are set when the tpmsce bit = 1) remark m = 7, 8 a = 0, 1
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 478 (5) controlling bits of tpmctl2 register the setting of the tpmctl2 register in the encoder compare mode is shown below. table 7-7. setting of tpmctl2 register mode tpmuds1, tpmuds0 bits (<1>) tpmecm1 bit (<2>) tpmecm0 bit (<2>) tpmlde bit (<3>) counter clear (target compare register) transfer to counter 0 ? 0 1 ? possible 0 ? 0 1 1 tpmccr0 possible note 0 invalid tpmccr1 ? encoder compare mode can be set to 00, 01, 10, or 11. 1 1 invalid tpmccr0, tpmccr1 ? note the counter can operate in a range from 0000h to the set value of the tpmccr0 register. remark m = 7, 8 (a) outline of each bit <1> the tpmuds1 and tpmuds0 bits identify the counti ng direction (up or down) of the 16-bit counter by the phase input from the encoder input pin (tencm0 or tencm1). <2> the tpmecm1 and tpmecm0 bits control clearing of the 16-bit counter when its count value matches the value of the ccr0 or ccr1 buffer register. <3> the tpmlde bit controls a function to transfer the set value of the tpmccr0 register to the 16-bit counter when the counter underfl ows. the tpmlde bit is valid only when the tpmecm1 and tpmecm0 bits are 00 or 01. it is invalid when these bits are set to any other value.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 479 (b) detailed explanation of each bit <1> tpmuds1 and tpmuds0 bits: count-up/-down selection whether the 16-bit counter is counting up or down is identified by the phase input from the tencm0 or tencm1 pin and depending on the setting of the tpmuds1 and tpmuds0 bits. these bits are valid only in the encoder compare mode. ? when tpmuds1 and tpmuds0 bits = 00 tencm0 pin tencm1 pin count operation rising edge falling edge both edges high level count down rising edge falling edge both edges low level count up remark detecting the edge of the tencm0 pin is specified by the tpmioc3.tpmeis1 and tpmeis0 bits. figure 7-44. operation example (when valid edge of tencm0 pin is specified to be rising edge and no edge is specified as valid edge of tencm1 pin) 0007h tencm0 tencm1 16-bit counter 0006h count down count up 0005h 0004h 0005h 0006h 0007h remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 480 ? when tpmuds1 and tpmuds0 bits = 01 tencm0 pin tencm1 pin count operation rising edge falling edge low level both edges rising edge falling edge high level both edges count down rising edge falling edge both edges high level rising edge falling edge both edges low level count up simultaneous input to tencm0 and tencm1 pins counter does not perform count operation but holds value immediately before. remark detecting the edge of the tencm0 pin is specified by the tpmioc3.tpmeis1 and tpmioc3.tpmeis0 bits. figure 7-45. operation example (when rising edge is specified as valid edge of tencm0 and tencm1 pins) 0006h tencm0 tencm1 16-bit counter 0007h 0008h count up value held count down 0007h 0006h 0005h remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 481 ? when tpmuds1 and tpmuds0 bits = 10 tencm0 pin tencm1 pin count operation low level falling edge counter does not perform count operation but holds value immediately before. rising edge low level count down high level rising edge falling edge rising edge high level high level falling edge counter does not perform count operation but holds value immediately before. falling edge low level count up low level rising edge falling edge rising edge counter does not perform count operation but holds value immediately before. rising edge count down falling edge falling edge count up caution specification of the valid edge of the tencm0 and tencm1 pins is invalid. figure 7-46. operation example (cou nt operation when valid edges of te ncm0 and tencm1 pins do not overlap) 0007h tencm0 tencm1 16-bit counter 0006h count down count up count down count up count down count up 0005h 0006h 0005h 0005h 0006h 0006h 0007h remark m = 7, 8 figure 7-47. operation example (count operation when valid edges of tencm0 and tencm1 pins overlap) 0007h tencm0 tencm1 16-bit counter 0006h count down value held count down count up 0005h 0006h 0007h remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 482 ? when tpmuds1 and tpmuds0 bits = 11 tencm0 pin tencm1 pin count operation low level falling edge rising edge low level high level rising edge falling edge count down rising edge high level high level falling edge falling edge low level low level rising edge count up simultaneous input to tencm0 and tencm1 pins counter does not perform count operation but holds value immediately before. caution specification of the valid edge of the tencm0 and tencm1 pins is invalid. figure 7-48. operation example (cou nt operation when valid edges of te ncm0 and tencm1 pins do not overlap) count up tencm0 tencm1 16-bit counter 0004h 0003h 0006h 0005h 0008h 0007h 000ah 0009h 0008h 0009h 0006h 0007h 0005h count down remark m = 7, 8 figure 7-49. operation example (count operation when valid edges of tencm0 and tencm1 pins overlap) count up count up count up value held value held tencm0 tencm1 16-bit counter 0004h 0003h 0005h 0008h 0007h 0006h 0007h 0006h 0006h 0005h count down remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 483 <2> tpmecm1 and tpmecm0 bits: timer/counter clear function upon match of the compare register the 16-bit counter performs its count operation in accordance with the set value of the tpmecm1 and tpmecm0 bits when the count value of the counter matches the va lue of the ccra buffer register. ? when tpmecm1 and tpmecm0 bits = 00 the 16-bit counter is not cleared when its count value matches the value of the ccra buffer register. ? when tpmecm1 and tpmecm0 bits = 01 the 16-bit counter performs a count operation un der the following condition when its count value matches the value of the ccr0 buffer register. next count operation description count up 16-bit counter is cleared to 0000h. count down count value of 16-bit counter is counted down. ? when tpmecm1 and tpmecm0 bits = 10 the 16-bit counter performs a count operation un der the following condition when its count value matches the value of the ccr1 buffer register. next count operation description count up count value of 16-bit counter is counted up. count down 16-bit counter is cleared to 0000h. ? when tpmecm1 and tpmecm0 bits = 11 the 16-bit counter performs a count operation un der the following condition when its count value matches the value of the ccr0 buffer register. next count operation description count up 16-bit counter is cleared to 0000h. count down count value of 16-bit counter is counted down. the 16-bit counter performs a count operation un der the following condition when its count value matches the value of the ccr1 buffer register. next count operation description count up count value of 16-bit counter is counted up. count down 16-bit counter is cleared to 0000h.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 484 <3> tpmlde bit: transfer function of the set value of the tpmccr0 register to the 16-bit counter when the counter underflows when the tpmlde bit = 1, the set value of the tpmccr0 register can be transferred to the 16-bit counter when the counter underflows. the tpmlde bit is valid only in the encoder compare mode. ? count operation in range from 0000h to set value of the tpmccr0 register if the 16-bit counter performs a count operati on when the tpmlde bit = 1 and tpmecm1 and tpmecm0 bits = 01, and when the count value of the counter matches the set value of the ccr0 buffer register when the tpmecm0 bit = 1, the 16-bi t counter is cleared to 0000h if the next count operation is counting up. if the 16-bit counter underflows when the tpmlde bi t = 1, the set value of the tpmccr0 register is transferred to the counter. therefore, the counter can operat e in a range from 0000h to the set value of the tpmccr0 register in which the upper-limit count value is the set value of the tpmccr0 register and the lower-limit value is 0000h. figure 7-50. operation example (count operation in range from 0000h to set value of tpmccr0 register) 16-bit counter is cleared to 0000h. set value of tpmccr0 register is transferred to 16-bit counter. 16-bit counter underflows. count up count down count value of 16-bit counter matches value of ccr0 buffer register. 16-bit counter set value of tpmccr0 register (n) 0000h remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 485 figure 7-51. operation timing (count operation in range from 0000h to set value of tpmccr0 register) peripheral clock tpmesf bit tpmcnt register tpmccr0 register inttpmcc0 signal tpmeof bit tpmeuf bit inttpmov signal count timing signal n 0002h h = down counting l 0001h 0000h n n ? 1 remarks 1. tpmesf bit: bit 0 of tmpm option register 1 (tpmopt1) tpmeof bit: bit 1 of tmpm option register 1 (tpmopt1) tpmeuf bit: bit 2 of tmpm option register 1 (tpmopt1) 2. m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 486 (6) clearing counter to 0000h by en coder clear signal (tecrm pin) the 16-bit counter can be cleared to 0000h by the input signal of the tecrm pin in two ways which are selected by the tpmioc3.tpmsce bit. the tpms ce bit also controls, depending its setting, the tpmioc3.tpmzcl, tpmioc3.tpmbcl, tpm ioc3.tpmacl, tpmioc3.tpmesc1, and tpmioc3.tpmecs0 bits. the counter can be cleared by the methods descr ibed below only in the encoder compare mode. table 7-8. relationship between tpmsce bit and tp mzcl, tpmbcl, tpmacl, tpmecs1, and tpmecs0 bits clearing method tpmsce bit tpmzcl bit tpmb cl bit tpmacl bit tpmecs1, tpmecs0 bits <1> 0 invalid invalid invalid valid <2> 1 valid valid valid invalid (a) clearing method <1>: by detecting edge of en coder clear signal (tecrm pin) (tpmsce bit = 0) when the tpmsce bit = 0, the 16-bit counter is cl eared to 0000h in synchronization with the peripheral clock if the valid edge of the tecrm pin specified by the tpmecs1 and tpmecs0 bits is detected. at this time, an encoder clear interrupt request signal (inttiecm) is generated. when the tpmsce bit = 0, setting of the tpmzcl, tpmbcl, and tpmacl bits is invalid. figure 7-52. operation example (when tpmsce bit = 0, tpmecs1 and tpmecs0 bits = 01, and tpmuds1 and tpmuds0 bits = 11) peripheral clock tpmcnt register inttiecm encoder input (tencm0 pin input) encoder input (tencm1 pin input) encoder clear input (tecrm pin input) count timing signal n + 1 n counter clear 0000h 0001h 0002h remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 487 (b) clearing method <2>: by detecting clear level condition of the tencm0, tencm1, and tecrm pins (tpmsce bit = 1) when the tpmsce bit = 1, the 16-bit counter is cleared to 0000h if the clear level condition of the tecrm, tencm0, or tencm1 pin specified by the tpmzcl, tpmbcl , and tpmacl bits is detected. at this time, the encoder clear interrupt request signal (inttiecm) is not generated. setting of the tpmecs1 and tpmecs0 bits is invalid when the tpmsce bit = 1. table 7-9. 16-bit counter cleari ng condition when tpmsce bit = 1 clear level condition setting input level of encoder pin tpmzcl bit tpmbcl bit tpmacl bi t tecrm pin tencm1 pin tencm0 pin 0 0 0 l l l 0 0 1 l l h 0 1 0 l h l 0 1 1 l h h 1 0 0 h l l 1 0 1 h l h 1 1 0 h h l 1 1 1 h h h caution the 16-bit counter is cleared to 0000h when the clear level condi tion of the tpmzcl, tpmbcl, and tpmacl bits match the input level of the tecrm, tencm1, or tencm0 pin. remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 488 figure 7-53. operation example (whe n tpmsce bit = 1, tpmzcl bit = 1, tpmbcl bit = 0, tpmacl bit = 1, tpmuds1 and tpmuds0 bits = 11, tecrm = high level , tencm1 = low level, and tencm0 = high level) (1/3) (i) if inputting the high level to the tecrm pin lags behind inputting the low level to the tencm1 pin while the counter is counting up, the co unter is cleared after it counts up. peripheral clock clear signal tpmcnt register tpmccr0 register inttpmcc0 signal tpmccr1 register inttpmcc1 signal tpmccr0 register inttpmcc0 signal encoder input (tencm0 pin input) encoder input (tencm1 pin input) encoder clear input (tecrm pin input) count timing signal n + 1 n compare match interrupt request signal is not generated. h l h 0000h n + 1 (when tpmccr0 register is set to n + 1) n (when tpmccr0 register is set to n) 0000h (when tpmccr1 register is set to 0000h) remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 489 figure 7-53. operation example (whe n tpmsce bit = 1, tpmzcl bit = 1, tpmbcl bit = 0, tpmacl bit = 1, tpmuds1 and tpmuds0 bits = 11, tecrm = high level , tencm1 = low level, and tencm0 = high level) (2/3) (ii) if the high level is input to the tecrm pin at the same time as the low level is input to the tecnm1 pin while the counter is counting up, th e counter is cleared without counting up. peripheral clock clear signal tpmcnt register encoder input (tencm0 pin input) encoder input (tencm1 pin input) encoder clear input (tecrm pin input) count timing signal 0000h n h l h (iii) if the high level is input to the tecrm pin earlie r than the low level is input to the tencm1 pin while the counter is counting up, the count er is cleared without counting up. peripheral clock clear signal tpmcnt register encoder input (tencm0 pin input) encoder input (tencm1 pin input) encoder clear input (tecrm pin input) count timing signal 0000h n h l h remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 490 figure 7-53. operation example (whe n tpmsce bit = 1, tpmzcl bit = 1, tpmbcl bit = 0, tpmacl bit = 1, tpmuds1 and tpmuds0 bits = 11, tecrm = high level , tencm1 = low level, and tencm0 = high level) (3/3) (iv) if the high level is input to the tecrm pin later than the low level is input to the tencm1 pin while the counter is counting up, the count er is cleared after it counts up. peripheral clock clear signal tpmcnt register tpmccr0 register inttpmcc0 signal tpmccr1 register inttpmcc1 signal tpmccr0 register inttpmcc0 signal encoder input (tencm0 pin input) encoder input (tencm1 pin input) encoder clear input (tecrm pin input) count timing signal n ? 1 n compare match interrupt request signal is not generated. h l h 0000h n ? 1 (when tpmccr0 register is set to n ? 1) n (when tpmccr0 register is set to n) 0000h (when tpmccr1 register is set to 0000h) remark m = 7, 8 if the counter is cleared in this way, a miscount does not occur even if inputting the signal to the tecrm pin is late, because the clear level condition of t he tecrm, tencm1, and tencm0 pins is set and the 16- bit counter is cleared to 0000h when the clear level condition is detected.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 491 7.6.9 encoder compare mode (t pmmd3 to tpmmd0 bits = 1000) in the encoder compare mode, the enc oder is controlled by using both the tpmccr0 and tpmccr1 registers as compare registers and the input pins for encoder count function (tencm0, tencm1, and tecrm). in this mode, the 16-bit counter can be cleared to 0000h in three ways: when the c ount value of the counter matches the value of the ccra buffer register (compar e match interrupt request signal (inttpmcca) is generated), when the edge of the encoder clear inpu t (tecrm pin) is detected and cleared, and when the clear level condition of tencm0, tencm1, and tecrm pi ns is detected and cleared. when the 16-bit counter underflows, the set value of t he tpmccr0 register can be transferred to the counter. (1) encoder compare mode operation flow figure 7-54. encoder compare mode operation flow tpmce bit = 1 tpmce bit = 0 encoder compare mode operation processing register initial setting tpmctl1 register (tpmmd3 to tpmmd0 bits), tpmctl2 register (tpmlde, tpmecm1, tpmecm0, tpmuds1, tpmuds0 bits), tpmioc3 register (tpmsce, tpmzcl, tpmacl, tpmbcl, tpmecs1, tpmecs0, tpmeis1, tpmeis0 bits), tpmccr0, tpmccr1 registers, tpmtcw register start end operation end? yes no : see figure 7-55 encoder compare mode operation processing . remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 492 figure 7-55. encoder compar e mode operation processing count up 16-bit counter cleared and started. inttpmcc0 signal generated. 16-bit counter cleared and started. 16-bit counter cleared and started. inttiecm signal generated. tpmecm0 = 1? (tpmctl2) yes no tecrm edge detected? yes no clear level condition of tencm0, tencm1, and tecrm pins detected? yes a a no tpmsce = 1? (tpmioc3) yes no count value matches ccr0 register value? yes no no 16-bit counter cleared and started. inttpmcc1 signal generated. tpmccr0 set value transferred to 16-bit counter. inttpmcc0 signal generated. valid edge of tencm0, tencm1 detected? yes no which count operation? count down tpmecm1 = 1? (tpmctl2) yes no yes tpmlde = 1? (tpmctl2) yes no underflow? yes no count value matches ccr1 register value? remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 493 (2) encoder compare mode operation timing (a) basic timing 1 [register setting conditions] ? tpmctl2.tpmecm1 and tpmctl2.tpmecm0 bits = 01 the 16-bit counter is cleared to 0000h when its count value matches the value of the ccr0 buffer register. ? tpmctl2.tpmlde bit = 1 the set value of the tpmccr0 register is trans ferred to the 16-bit counter when it overflows. ? tpmioc3.tpmsce bit = 0, and tpmioc3.tpmecs1 and tpmioc3.tpmecs0 bits = 00 specification of the edge of encoder clear input signal (tecrm pi n) to be detected and cleared (no edge specified) cm 00 cm 00 tpmccr0 register ccr0 buffer register inttpmcc0 signal tpmccr1 register ccr1 buffer register inttpmcc1 signal tpmesf bit inttpmov signal tpmeof bit tpmeuf bit 0000h ffffh tpmcnt register clear clear clear transfer cm 00 cm 01 cm 00 cm 10 cm 11 cm 10 l cm 11 cm 12 cm 12 cm 01 cm 02 cm 02 cm 03 cm 03 cm 03 cm 03 cm 11 cm 02 cm 12 cm 01 remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 494 when the 16-bit counter starts operating (tpmce bit = 0 1), the set value of the tpmtcw register is transferred to the counter and the 16-bit counter starts operating. when the count value of the counter matches the val ue of the ccr0 buffer register, the compare match interrupt request signal (inttpmcc0) is generated. because the tpmecm0 bit = 1, the 16-bit counter is cleared to 0000h if the next count operation is counting up. when the count value of the 16-bit counter matches t he value of the ccr1 buffer register, the compare match interrupt request signal (inttpmcc1) is gener ated. because the tpmecm1 bit = 0, the 16-bit counter is not cleared to 0000h when its valu e matches that of the ccr1 buffer register. when the tpmlde bit = 1 and tpmecm0 bit = 1, the co unter can operate in a range from 0000h to the set value of the tpmccr0 register.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 495 (b) basic timing 2 [register setting condition] ? tpmctl2.tpmecm1 and tpmctl2.tpmecm0 bits = 00 the 16-bit counter is not cleared even when its co unt value matches the value of the ccra buffer register (a = 0, 1). ? tpmctl2.tpmlde bit = 0 the set value of the tpmccr0 register is not tr ansferred to the 16-bit counter after the counter underflows. ? tpmioc3.tpmsce bit = 0, and tpmioc3.tpmecs1 and tpmioc3.tpmecs0 bits = 00 specification of the edge of the encoder clear input signal (te crm pin) to be detected and cleared (no edge specified) cm 10 cm 00 cm 00 tpmccr0 register ccr0 buffer register inttpmcc0 signal tpmccr1 register ccr1 buffer register inttpmcc1 signal tpmesf bit inttpmov signal tpmeof bit tpmeuf bit 0000h ffffh tpmcnt register underflow overflow cm 00 cm 01 cm 00 cm 10 cm 11 cm 10 cm 11 cm 12 cm 12 cm 01 cm 02 cm 02 cm 11 cm 02 cm 12 cm 01 cm 01 remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 496 when the 16-bit counter starts operating (tpmce bit = 0 1), the set value of the tpmtcw register is transferred to the 16-bit counter and the counter starts operating. when the count value of the 16-bit counter matches the value of the ccr0 buffer register, a compare match interrupt request signal (inttpmcc0) is generated. when the count value of the 16-bit counter matches the value of the ccr1 buffer register, a compare match interrupt request signal (inttpmcc1) is generated. the 16-bit counter is not cleared to 0000h even when its count value matches the value of the ccra buffer register because the tpmecm1 and tpmecm0 bits = 00 (a = 0, 1).
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 497 (c) basic timing 3 [register setting condition] ? tpmctl2.tpmecm1 and tpmctl2.tpmecm0 bits = 11 the count value of the 16- bit counter is cleared to 0000h when it s value matches the value of the ccr0 buffer register. the count value of the 16- bit counter is cleared to 0000h when it s value matches the value of the ccr1 buffer register. ? setting of the tpmctl2.tpmlde bit is invalid. ? tpmioc3.tpmsce bit = 0, and tpmioc3.tpmecs1 and tpmioc3.tpmecs0 bits = 00 specification of the edge of the encoder clear input signal (te crm pin) to be detected and cleared (no edge specified) cm 00 cm 01 cm 01 cm 11 cm 10 tpmccr0 register ccr0 buffer register inttpmcc0 signal tpmccr1 register ccr1 buffer register inttpmcc1 signal tpmesf bit inttpmov signal tpmeof bit tpmeuf bit 0000h ffffh tpmcnt register clear clear clear clear underflow underflow underflow overflow cm 00 cm 01 cm 00 cm 10 cm 11 cm 10 cm 11 cm 12 cm 12 cm 01 cm 02 cm 02 cm 12 cm 12 cm 02 remark m = 7, 8
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 498 when the 16-bit counter starts operating (tpmce bit = 0 1), the set value of the tpmtcw register is transferred to the 16-bit counter and the counter starts operating. when the count value of the 16-bit counter matches the value of the ccr0 buffer register, a compare match interrupt request signal (inttpmcc0) is generated. at this time, the 16-bit counter is cleared to 0000h if the next count operation is counting up. when the count value of the 16-bit counter matches the value of the ccr1 buffer register, a compare match interrupt request signal (inttpmcc1) is generated. at this time, the 16-bit counter is cleared to 0000h if the next count operation is counting down.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 499 7.7 selector function in the v850e/sj3-h and v850e/sk3-h, the tip input or rxda input and the tiq input or tsout signal note can be selected as the capture trigger input of tmp and tmq, respectively. by using this function, the following is possible. ? the tiq02 and tiq03 in put signals of tmq0 can be selected from the port/timer alternate-function pins (tiq02 and tiq03 pins) and the tsout signal note of the can controller. if the tsout signal of can0 or can1 is selected, the time stamp function of t he can controller can be used. ? the tip10 and tip11 input signals of tmp1 can be selected from the port/timer alternate-function pins (tip10 and tip11 pins) and the uarta reception alternate-function pins (rxda0 and rxda1). the tip31 input signal of tmp3 can be selected from a port/timer alternate-func tion pin (tip31 pin) and the uarta re ception alternate- function pin (rxda3). when the rxda0, rxda1, or rxda3 signal of uart0, uart1, or uart3 is se lected, the lin reception transfer rate and baud rate error of uarta can be calculated. cautions 1. when using the select or function, set the capture trigger input of tmp or tmq before connecting the timer. 2. when setting the selector function, firs t disable the peripheral i/o to be connected (tmp/uarta or tmq/can controller note ). note can controller versions only the capture trigger input for the selector func tion is specified by the following register.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 500 (1) selector operation control register 0 (selcnt0) the selcnt0 register is an 8-bit register that se lects the capture trigger for tmp1, tmp3, and tmq0. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 tip31 pin input (alternate function of p94 pin) rxda3 pin input (alternate function of p80 pin) isel6 0 1 selection of tip31 input signal (tmp3) selcnt0 isel6 0 isel4 isel3 0 isel1 note 1 isel0 note 2 tip11 pin input (alternate function of p35 pin) rxda1 pin input/kr3 pin input (alternate function of p91 or p150 note 3 pin) isel4 0 1 selection of tip11 input signal (tmp1) tip10 pin input (alternate function of p34 pin) rxda0 pin input (alternate function of p31 pin) isel3 0 1 selection of tip10 input signal (tmp1) tiq03 pin input/kr2 pin input (alternate function of p52 or p65 pin) tsout signal of can1 isel1 note 1 0 1 selection of tiq03 input signal (tmq0) tiq02 pin input (alternate function of p51 pin) tsout signal of can0 isel0 note 2 0 1 selection of tiq02 input signal (tmq0) after reset: 00h r/w address: fffff308h < > < > < > < > < > notes 1. the isel1 bit is available only in the can controller (2-channel) version. in other cases, be sure to clear this bit to 0. 2. the isel0 bit is valid only for the can controller version. in other cases, be sure to clear this bit to 0. 3. p150/rxda1/kr7 is available only in the v850e/sk3-h. caution to set the isel0, isel1, isel3, isel4, and isel6 bits to 1, set the corresponding pin in the capture trigger input mode.
chapter 7 16-bit timer/event counter p (tmp) user?s manual u19201ej3v0ud 501 7.8 cautions (1) dma transfer start factors in the v850e/sj3-h and v850e/sk3-h, the dma transfer start factors inttp0ov signal and intub0tit signal, inttp1ov signal and intub1tir signal, and inttp2ov signal and intub1tit signal are used alternately and cannot be used simultaneously. to use the inttp0ov, inttp1ov, or inttp2ov signal as dma transfer start factors, set the dtfrob0 bit in the option byte area 0000007ah to 0 (see chapter 33 option byte function ). in this case, the intub0tit, intub1ti r, and intub1tit signals cannot be used as a dma transfer start factor. remark for details, see table 22-1 dma transfer start factors .
user?s manual u19201ej3v0ud 502 chapter 8 16-bit timer/event counter q (tmq) timer q (tmq) is a 16-bit timer/event counter. the v850e/sj3-h and v850e/sk3-h incorporate tmq0. 8.1 overview an outline of tmq0 is shown below. ? clock selection: 8 ways ? capture/trigger input pins: 4 ? external event count input pin: 1 ? external trigger input pin: 1 ? timer/counter: 1 ? capture/compare registers: 4 ? capture/compare match interrupt request signals: 4 ? overflow interrupt request signal: 1 ? timer output pins: 4 8.2 functions tmq0 has the following functions. ? interval timer ? external event counter ? external trigger pulse output ? one-shot pulse output ? pwm output ? free-running timer ? pulse width measurement
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 503 8.3 configuration tmq0 includes the following hardware. table 8-1. configuration of tmq0 item configuration timer register 16-bit counter registers tmq0 capture/compare registers 0 to 3 (tq0ccr0 to tq0ccr3) tmq0 counter read buffer register (tq0cnt) ccr0 to ccr3 buffer registers timer inputs 4 (tiq00 note 1 to tiq03 pins) timer outputs 4 (toq00 to toq03 pins) control registers note 2 tmq0 control registers 0, 1 (tq0ctl0, tq0ctl1) tmq0 i/o control registers 0 to 2 (tq0ioc0 to tq0ioc2) tmq0 option register 0 (tq0opt0) notes 1. the tiq00 pin functions alternately as a capt ure trigger input signal, external event count input signal, and external trigger input signal. 2. when using the functions of the tiq00 to tiq03 and toq00 to toq03 pins, refer to table 4-25 using port pin as alternate-function pin .
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 504 figure 8-1. block diagram of tmq0 tq0cnt tq0ccr0 tq0ccr1 tq0ccr2 toq00 inttq0ov ccr2 buffer register tq0ccr3 ccr3 buffer register toq01 toq02 toq03 inttq0cc0 inttq0cc1 inttq0cc2 inttq0cc3 f xp f xp /2 f xp /4 f xp /8 f xp /16 f xp /32 f xp /64 f xp /128 tiq00 tiq01 tiq02 tiq03 selector internal bus internal bus selector edge detector ccr0 buffer register ccr1 buffer register 16-bit counter output controller clear remark f xp : peripheral clock frequency (prescaler 1 input clock frequency). in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clocks (1) 16-bit counter this 16-bit counter can count inte rnal clocks or external events. the count value of this counter can be read by using the tq0cnt register. when the tq0ctl0.tq0ce bit = 0, the va lue of the 16-bit counter is ffffh. if the tq0cnt register is read at this time, 0000h is read. reset sets the tq0ce bit to 0. (2) ccr0 buffer register this is a 16-bit compare register that com pares the count value of the 16-bit counter. when the tq0ccr0 register is used as a compare regist er, the value written to the tq0ccr0 register is transferred to the ccr0 buffer register. when the count value of the 16-bit counter matches the value of the ccr0 buffer register, a compare match interrupt request signal (inttq0cc0) is generated. the ccr0 buffer register cannot be read or written directly. the ccr0 buffer register is cleared to 0000h after reset, as the tq0ccr0 register is cleared to 0000h.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 505 (3) ccr1 buffer register this is a 16-bit compare register that com pares the count value of the 16-bit counter. when the tq0ccr1 register is used as a compare regist er, the value written to the tq0ccr1 register is transferred to the ccr1 buffer register. when the count value of the 16-bit counter matches the value of the ccr1 buffer register, a compare match interrupt request signal (inttq0cc1) is generated. the ccr1 buffer register cannot be read or written directly. the ccr1 buffer register is cleared to 0000h after reset, as the tq0ccr1 register is cleared to 0000h. (4) ccr2 buffer register this is a 16-bit compare register that com pares the count value of the 16-bit counter. when the tq0ccr2 register is used as a compare regist er, the value written to the tq0ccr2 register is transferred to the ccr2 buffer register. when the count value of the 16-bit counter matches the value of the ccr2 buffer register, a compare match interrupt request signal (inttq0cc2) is generated. the ccr2 buffer register cannot be read or written directly. the ccr2 buffer register is cleared to 0000h after reset, as the tq0ccr2 register is cleared to 0000h. (5) ccr3 buffer register this is a 16-bit compare register that com pares the count value of the 16-bit counter. when the tq0ccr3 register is used as a compare regist er, the value written to the tq0ccr3 register is transferred to the ccr3 buffer register. when the count value of the 16-bit counter matches the value of the ccr3 buffer register, a compare match interrupt request signal (inttq0cc3) is generated. the ccr3 buffer register cannot be read or written directly. the ccr3 buffer register is cleared to 0000h after reset, as the tq0ccr3 register is cleared to 0000h. (6) edge detector this circuit detects the valid edges input to the tiq 00 and tiq03 pins. no edge, rising edge, falling edge, or both the rising and falling edges can be selected as the valid edge by using the tq0ioc1 and tq0ioc2 registers. (7) output controller this circuit controls the output of the toq00 to toq 03 pins. the output contro ller is controlled by the tq0ioc0 register. (8) selector this selector selects the count clock for the 16-bit counter . eight types of internal clocks or an external event can be selected as the count clock.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 506 8.4 registers the registers that control tmq0 are as follows. ? tmq0 control register 0 (tq0ctl0) ? tmq0 control register 1 (tq0ctl1) ? tmq0 i/o control register 0 (tq0ioc0) ? tmq0 i/o control register 1 (tq0ioc1) ? tmq0 i/o control register 2 (tq0ioc2) ? tmq0 option register 0 (tq0opt0) ? tmq0 capture/compare register 0 (tq0ccr0) ? tmq0 capture/compare register 1 (tq0ccr1) ? tmq0 capture/compare register 2 (tq0ccr2) ? tmq0 capture/compare register 3 (tq0ccr3) ? tmq0 counter read buffer register (tq0cnt) remark when using the functions of the tiq00 to tiq03 and toq00 to toq03 pins, refer to table 4-25 using port pin as alternate-function pin .
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 507 (1) tmq0 control register 0 (tq0ctl0) the tq0ctl0 register is an 8-bit register that controls the operation of tmq0. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. the same value can always be written to the tq0ctl0 register by software. tq0ce tmq0 operation disabled (tmq0 reset asynchronously note ). tmq0 operation enabled. tmq0 operation started. tq0ce 0 1 tmq0 operation control tq0ctl0 0 0 0 0 tq0cks2 tq0cks1 tq0cks0 654321 after reset: 00h r/w address: fffff540h <7> 0 f xp f xp /2 f xx /4 f xp /8 f xp /16 f xp /32 f xp /64 f xp /128 tq0cks2 0 0 0 0 1 1 1 1 internal count clock selection tq0cks1 0 0 1 1 0 0 1 1 tq0cks0 0 1 0 1 0 1 0 1 note the tq0opt0.tq0ovf bit and 16-bit c ounter are reset at the same time. in addition, the timer output pins (toq00 to toq03 pins) are reset to the status set by the tq0ioc0 register when the 16-bit counter is reset. cautions 1. set the tq0cks2 to tq0 cks0 bits when the tq0ce bit = 0. when the value of the tq0ce bi t is changed from 0 to 1, the tq0cks2 to tq0cks0 bits can be set simultaneously. 2. be sure to clear bits 3 to 6 to ?0?. remark f xp : peripheral clock frequency (prescaler 1 input clock frequency). in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clocks
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 508 (2) tmq0 control register 1 (tq0ctl1) the tq0ctl1 register is an 8-bit register that controls the operation of tmq0. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 tq0est 0 1 software trigger control tq0ctl1 tq0est tq0eee 0 0 tq0md2 tq0md1 tq0md0 <6> <5> 4 3 2 1 after reset: 00h r/w address: fffff541h generate a valid signal for external trigger input. ? in one-shot pulse output mode: a one-shot pulse is output with writing 1 to the tq0est bit as the trigger. ? in external trigger pulse output mode: a pwm waveform is output with writing 1 to the tq0est bit as the trigger. disable operation with external event count input (tiq00 pin). (perform counting with the count clock selected by the tq0ctl0.tq0cks0 to tq0cks2 bits.) tq0eee 0 1 count clock selection the tq0eee bit selects whether counting is performed with the internal count clock or the valid edge of the external event count input. 7 0 interval timer mode external event count mode external trigger pulse output mode one-shot pulse output mode pwm output mode free-running timer mode pulse width measurement mode setting prohibited tq0md2 0 0 0 0 1 1 1 1 timer mode selection tq0md1 0 0 1 1 0 0 1 1 tq0md0 0 1 0 1 0 1 0 1 enable operation with external event count input (tiq00 pin). (perform counting at the valid edge of the external event count input signal.) ? the read value of tq0est bit is always 0. cautions 1. the tq0est bit is valid on ly in the external trigger pulse output mode or one-shot pulse output mode . in any other mode, writing 1 to this bit is ignored. 2. external event count input is selected in the external event count mode regardless of the value of the tq0eee bit. 3. set the tq0eee and tq0md2 to tq0md0 bits when the tq0ctl0.tq0ce bit = 0. (the same value can be written when the tq0ce bit = 1.) the op eration is not guaranteed when rewriting is performed with the tq0ce bit = 1. if rewriting was mistakenly performed, clear the tq0ce bit to 0 and then set the bits again. 4. be sure to clear bits 3, 4, and 7 to ?0?.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 509 (3) tmq0 i/o control register 0 (tq0ioc0) the tq0ioc0 register is an 8-bit register that controls the timer output (toq00 to toq03 pins). this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. tq0ol3 tq0olm 0 1 toq0m pin output level setting (m = 0 to 3) note toq0m pin output starts at high level toq0m pin output starts at low level tq0ioc0 tq0oe3 tq0ol2 tq0oe2 tq0ol1 tq0oe1 tq0ol0 tq0oe0 <6> 5 <4> 3 <2> 1 after reset: 00h r/w address: fffff542h tq0oem 0 1 toq0m pin output setting (m = 0 to 3) timer output disabled ? when tq0olm bit = 0: low level is output from the toq0m pin ? when tq0olm bit = 1: high level is output from the toq0m pin 7 <0> timer output enabled (a pulse is output from the toq0m pin). note the output level of the timer out put pin (toq0m) specified by the tq0olm bit is shown below. tq0ce bit toq0m pin output 16-bit counter ? when tq0olm bit = 0 tq0ce bit toq0m pin output 16-bit counter ? when tq0olm bit = 1 cautions 1. the pin output changes if the setting of the tq0ioc0 register is rewritten when the port is set to output toq0m. therefore, note changes in the pin status by setting the port in the input mode and making the output status of the pins a high- impedance state. 2. rewrite the tq0olm and tq0oem bits when the tq0ctl0.tq0ce bit = 0. (the same value can be written when the tq0ce bit = 1.) if rewriting was mistakenly performed, clear the tq0ce bit to 0 and then set the bits again. 3. even if the tq0olm bit is manipulated when the tq0ce and tq0oem bits are 0, the toq0 m pin output level varies. remark m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 510 (4) tmq0 i/o control register 1 (tq0ioc1) the tq0ioc1 register is an 8-bit register that controls the valid edge of the capture trigger input signals (tiq00 to tiq03 pins). this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. tq0is7 tq0is7 0 0 1 1 tq0is6 0 1 0 1 capture trigger input signal (tiq03 pin) valid edge setting no edge detection (capture operation invalid) detection of rising edge detection of falling edge detection of both edges tq0ioc1 tq0is6 tq0is5 tq0is4 tq0is3 tq0is2 tq0is1 tq0is0 654321 after reset: 00h r/w address: fffff543h tq0is5 0 0 1 1 tq0is4 0 1 0 1 capture trigger input signal (tiq02 pin) valid edge detection no edge detection (capture operation invalid) detection of rising edge detection of falling edge detection of both edges 7 0 tq0is3 0 0 1 1 tq0is2 0 1 0 1 capture trigger input signal (tiq01 pin) valid edge setting no edge detection (capture operation invalid) detection of rising edge detection of falling edge detection of both edges tq0is1 0 0 1 1 tq0is0 0 1 0 1 capture trigger input signal (tiq00 pin) valid edge setting no edge detection (capture operation invalid) detection of rising edge detection of falling edge detection of both edges cautions 1. rewrite the tq0is7 to tq0is0 bits when the tq0ctl0.tq0ce bit = 0. (the same value can be written when the tq0ce bit = 1.) if rewriting was mistakenly performed, clear the tq0ce bit to 0 and then set the bits again. 2. the tq0is7 to tq0is0 bi ts are valid only in the free- running timer mode (only when tq0opt0.tq0ccsm bit = 1) and the pulse width measurement mode (m = 0 to 3). in all other modes, a capture operation is not possible.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 511 (5) tmq0 i/o control register 2 (tq0ioc2) the tq0ioc2 register is an 8-bit register that controls the valid edge of the external event count input signal (tiq00 pin) and external trigger input signal (tiq00 pin). this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 tq0ees1 0 0 1 1 tq0ees0 0 1 0 1 external event count input signal (tiq00 pin) valid edge setting no edge detection (external event count invalid) detection of rising edge detection of falling edge detection of both edges tq0ioc2 0 0 0 tq0ees1 tq0ees0 tq0ets1 tq0ets0 654321 after reset: 00h r/w address: fffff544h tq0ets1 0 0 1 1 tq0ets0 0 1 0 1 external trigger input signal (tiq00 pin) valid edge setting no edge detection (external trigger invalid) detection of rising edge detection of falling edge detection of both edges 7 0 cautions 1. rewrite the tq0ees1, tq0ees0, tq0ets1, and tq0ets0 bits when the tq0ctl0.tq0ce bit = 0. (the same value can be written when the tq0ce bit = 1.) if rewriting was mistakenly performed, clear the tq0ce bit to 0 and then set the bits again. 2. the tq0ees1 and tq0ees0 bits are valid only when the tq0ctl1.tq0eee bit = 1 or when the external event count mode (tq0ctl1.tq0md 2 to tq0ctl1.tq0md0 bits = 001) has been set. 3. the tq0ets1 and tq0ets0 bits are valid only when the external trigger pulse output mode (tq0ctl1.tq0md2 to tq0ctl1.tq0md0 bits = 010) or the one-shot pulse output mode (tq0ctl1.tq0 md2 to tq0ctl1.tq0md0 = 011) is set.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 512 (6) tmq0 option register 0 (tq0opt0) the tq0opt0 register is an 8-bit register used to set the capture/co mpare operation and detect an overflow. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. tq0ccs3 tq0ccsm 0 1 tq0ccrm register capture/compare selection the tq0ccsm bit setting is valid only in the free-running timer mode. compare register selected capture register selected (cleared by setting the tq0ctl0.tq0ce bit = 0) tq0opt0 tq0ccs2 tq0ccs1 tq0ccs0 0 0 0 tq0ovf 654321 after reset: 00h r/w address: fffff545h tq0ovf set (1) reset (0) tmq0 overflow detection flag ? the tq0ovf bit is set when the 16-bit counter count value overflows from ffffh to 0000h in the free-running timer mode or the pulse width measurement mode. ? an overflow interrupt request signal (inttq0ov) is generated at the same time that the tq0ovf bit is set to 1. the inttq0ov signal is not generated in modes other than the free-running timer mode and the pulse width measurement mode. ? the tq0ovf bit is not cleared to 0 even when the tq0ovf bit or the tq0opt0 register are read when the tq0ovf bit = 1. ? before clearing the tq0ovf bit to 0 after the inttq0ov signal has been generated, be sure to confirm (read) that the tq0ovf bit is set to 1. ? the tq0ovf bit can be both read and written, but the tq0ovf bit cannot be set to 1 by software. writing 1 has no influence on the operation of tmq0. overflow occurred tq0ovf bit 0 written or tq0ctl0.tq0ce bit = 0 7 <0> cautions 1. rewrite the tq0ccs 3 to tq0ccs0 bits when the tq0ctl0.tq0ce bit = 0. (the same value can be written when the tq0ce bit = 1.) if rewriting was mistakenly performed, clear the tq0ce bit to 0 and then set the bits again. 2. be sure to clear bits 1 to 3 to ?0?. remark m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 513 (7) tmq0 capture/compare register 0 (tq0ccr0) the tq0ccr0 register is a 16-bit r egister that can be used as a captur e register or a compare register depending on the mode. this register can be used as a capture register or a compare register only in the free-running timer mode, depending on the setting of the tq0o pt0.tq0ccs0 bit. in the pulse width measurement mode, the tq0ccr0 register can be used only as a capture register. in any other m ode, this register can be used only as a compare register. the tq0ccr0 register can be r ead or written during operation. this register can be read or written in 16-bit units. reset sets this register to 0000h. caution accessing the tq0ccr0 register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock tq0ccr0 12 10 8 6 4 2 after reset: 0000h r/w address: fffff546h 14 0 13 11 9 7 5 3 15 1
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 514 (a) function as compare register the tq0ccr0 register can be rewritten even when the tq0ctl0.tq0ce bit = 1. the set value of the tq0ccr0 register is transferred to the ccr0 buffer register. when the value of the 16-bit counter matches the value of the ccr0 buffer register, a compare match interrupt request signal (inttq0cc0) is generated. if toq00 pin output is e nabled at this time, the output of the toq00 pin is inverted. when the tq0ccr0 register is used as a cycle register in the interval timer mode, external event count mode, external trigger pulse output mode, one-shot pulse output mode, or pwm output mode, the value of the 16-bit counter is cleared (0000h) if its count va lue matches the value of the ccr0 buffer register. the compare register is not cleared when the tq0ctl0.tq0ce bit = 0. (b) function as capture register when the tq0ccr0 register is used as a capture register in the free- running timer mode, the count value of the 16-bit counter is stored in the tq0ccr0 register if the valid ed ge of the capture trigger input pin (tiq00 pin) is detected. in the pulse-width measurement mode, the co unt value of the 16-bit counter is stored in the tq0ccr0 register and the 16-bit counter is cleared (0000h) if the valid edge of the capture trigger input pin (tiq00 pin) is detected. even if the capture operation and reading the tq0c cr0 register conflict, the correct value of the tq0ccr0 register can be read. the capture register is cleared when the tq0ctl0.tq0ce bit = 0. the following table shows the functions of the capture/compare re gister in each mode, and how to write data to the compare register. table 8-2. function of capture/co mpare register in each mode a nd how to write compare register operation mode capture/compare register how to write compare register interval timer compare register anytime write external event counter compare register anytime write external trigger pulse output compare register batch write note one-shot pulse output compare register anytime write pwm output compare register batch write note free-running timer capture/compare register anytime write pulse width measurement capture register none note triggered by writing to the tq0ccr1 register remark for anytime write and batch write, 8.6 (2) anytime write and batch write .
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 515 (8) tmq0 capture/compare register 1 (tq0ccr1) the tq0ccr1 register is a 16-bit r egister that can be used as a captur e register or a compare register depending on the mode. this register can be used as a capture register or a compare register only in the free-running timer mode, depending on the setting of the tq0o pt0.tq0ccs1 bit. in the pulse width measurement mode, the tq0ccr1 register can be used only as a capture register. in any other m ode, this register can be used only as a compare register. the tq0ccr1 register can be r ead or written during operation. this register can be read or written in 16-bit units. reset sets this register to 0000h. caution accessing the tq0ccr1 register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock tq0ccr1 12 10 8 6 4 2 after reset: 0000h r/w address: fffff548h 14 0 13 11 9 7 5 3 15 1
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 516 (a) function as compare register the tq0ccr1 register can be rewritten even when the tq0ctl0.tq0ce bit = 1. the set value of the tq0ccr1 register is transferred to the ccr1 buffer register. when the value of the 16-bit counter matches the value of the ccr1 buffer register, a compare match interrupt request signal (inttq0cc1) is generated. if toq01 pin output is e nabled at this time, the output of the toq01 pin is inverted. the compare register is not cleared when the tq0ctl0.tq0ce bit = 0. (b) function as capture register when the tq0ccr1 register is used as a capture register in the free- running timer mode, the count value of the 16-bit counter is stored in the tq0ccr1 register if the valid ed ge of the capture trigger input pin (tiq01 pin) is detected. in the pulse-width measurement mode, the co unt value of the 16-bit counter is stored in the tq0ccr1 register and the 16-bit counter is cleared (0000h) if the valid edge of the capture trigger input pin (tiq01 pin) is detected. even if the capture operation and reading the tq0c cr1 register conflict, the correct value of the tq0ccr1 register can be read. the capture register is cleared when the tq0ctl0.tq0ce bit = 0. the following table shows the functions of the capture/compare re gister in each mode, and how to write data to the compare register. table 8-3. function of capture/co mpare register in each mode a nd how to write compare register operation mode capture/compare register how to write compare register interval timer compare register anytime write external event counter compare register anytime write external trigger pulse output compare register batch write note one-shot pulse output compare register anytime write pwm output compare register batch write note free-running timer capture/compare register anytime write pulse width measurement capture register none note triggered by writing to the tq0ccr1 register remark for anytime write and batch write, see 8.6 (2) anytime write and batch write .
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 517 (9) tmq0 capture/compare register 2 (tq0ccr2) the tq0ccr2 register is a 16-bit r egister that can be used as a captur e register or a compare register depending on the mode. this register can be used as a capture register or a compare register only in the free-running timer mode, depending on the setting of the tq0o pt0.tq0ccs2 bit. in the pulse width measurement mode, the tq0ccr2 register can be used only as a capture register. in any other m ode, this register can be used only as a compare register. the tq0ccr2 register can be r ead or written during operation. this register can be read or written in 16-bit units. reset sets this register to 0000h. caution accessing the tq0ccr2 register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock tq0ccr2 12 10 8 6 4 2 after reset: 0000h r/w address: fffff54ah 14 0 13 11 9 7 5 3 15 1
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 518 (a) function as compare register the tq0ccr2 register can be rewritten even when the tq0ctl0.tq0ce bit = 1. the set value of the tq0ccr2 register is transferred to the ccr2 buffer register. when the value of the 16-bit counter matches the value of the ccr2 buffer register, a compare match interrupt request signal (inttq0cc2) is generated. if toq02 pin output is e nabled at this time, the output of the toq02 pin is inverted. the compare register is not cleared when the tq0ctl0.tq0ce bit = 0. (b) function as capture register when the tq0ccr2 register is used as a capture register in the free- running timer mode, the count value of the 16-bit counter is stored in the tq0ccr2 register if the valid ed ge of the capture trigger input pin (tiq02 pin) is detected. in the pulse-width measurement mode, the co unt value of the 16-bit counter is stored in the tq0ccr2 register and the 16-bit counter is cleared (0000h) if the valid edge of the capture trigger input pin (tiq02 pin) is detected. even if the capture operation and reading the tq0c cr2 register conflict, the correct value of the tq0ccr2 register can be read. the capture register is cleared when the tq0ctl0.tq0ce bit = 0. the following table shows the functions of the capture/compare re gister in each mode, and how to write data to the compare register. table 8-4. function of capture/co mpare register in each mode a nd how to write compare register operation mode capture/compare register how to write compare register interval timer compare register anytime write external event counter compare register anytime write external trigger pulse output compare register batch write note one-shot pulse output compare register anytime write pwm output compare register batch write note free-running timer capture/compare register anytime write pulse width measurement capture register none note triggered by writing to the tq0ccr1 register remark for anytime write and batch write, see 8.6 (2) anytime write and batch write .
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 519 (10) tmq0 capture/compare register 3 (tq0ccr3) the tq0ccr3 register is a 16-bit re gister that can be used as a captur e register or a compare register depending on the mode. this register can be used as a c apture register or a compare register only in the free-running timer mode, depending on the setting of the tq 0opt0.tq0ccs3 bit. in the pul se width measurement mode, the tq0ccr3 register can be used only as a capture register. in any other m ode, this register can be used only as a compare register. the tq0ccr3 register can be r ead or written during operation. this register can be read or written in 16-bit units. reset sets this register to 0000h. caution accessing the tq0ccr3 register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock tq0ccr3 12 10 8 6 4 2 after reset: 0000h r/w address: fffff54ch 14 0 13 11 9 7 5 3 15 1
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 520 (a) function as compare register the tq0ccr3 register can be rewritten even when the tq0ctl0.tq0ce bit = 1. the set value of the tq0ccr3 register is transferred to the ccr3 buffer register. when the value of the 16-bit counter matches the value of the ccr3 buffer register, a compare match interrupt request signal (inttq0cc3) is generated. if toq03 pin output is e nabled at this time, the output of the toq03 pin is inverted. the compare register is not cleared when the tq0ctl0.tq0ce bit = 0. (b) function as capture register when the tq0ccr3 register is used as a capture register in the free- running timer mode, the count value of the 16-bit counter is stored in the tq0ccr3 register if the valid ed ge of the capture trigger input pin (tiq03 pin) is detected. in the pulse-width measurement mode, the co unt value of the 16-bit counter is stored in the tq0ccr3 register and the 16-bit counter is cleared (0000h) if the valid edge of the capture trigger input pin (tiq03 pin) is detected. even if the capture operation and reading the tq0c cr3 register conflict, the correct value of the tq0ccr3 register can be read. the capture register is cleared when the tq0ctl0.tq0ce bit = 0. the following table shows the functions of the capture/compare re gister in each mode, and how to write data to the compare register. table 8-5. function of capture/co mpare register in each mode a nd how to write compare register operation mode capture/compare register how to write compare register interval timer compare register anytime write external event counter compare register anytime write external trigger pulse output compare register batch write note one-shot pulse output compare register anytime write pwm output compare register batch write note free-running timer capture/compare register anytime write pulse width measurement capture register none note triggered by writing to the tq0ccr1 register remark for anytime write and batch write, see 8.6 (2) anytime write and batch write .
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 521 (11) tmq0 counter read buffer register (tq0cnt) the tq0cnt register is a read buffer register that can read the count va lue of the 16-bit counter. if this register is read when the tq0ctl0.tq0ce bit = 1, the count value of the 16-bit timer can be read. this register is read-only, in 16-bit units. the value of the tq0cnt register is cleared to 0000h when the tq0ce bit = 0. if the tq0cnt register is read at this time, the value of the 16-bit c ounter (ffffh) is not read, but 0000h is read. the value of the tq0cnt register is cleared to 0000h after reset, as the tq0ce bit is cleared to 0. caution accessing the tq0cnt regist er is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock tq0cnt 12 10 8 6 4 2 after reset: 0000h r address: fffff54eh 14 0 13 11 9 7 5 3 15 1 8.5 timer output operations the following table shows the operations and out put levels of the toq00 to toq03 pins. table 8-6. timer output control in each mode operation mode toq00 pin toq 01 pin toq02 pin toq03 pin interval timer mode square wave output external event count mode none external trigger pulse output mode external trigger pulse output one-shot pulse output mode one-shot pulse output pwm output mode square wave output pwm output free-running timer mode square wave output (only when compare function is used) pulse width measurement mode none
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 522 table 8-7. truth table of toq00 to toq03 pins under control of timer output control bits tq0ioc0.tq0olm bit tq0ioc0.tq0oem bit tq0ctl0.tq0ce bit level of toq0m pin 0 low-level output 0 low-level output 0 1 1 low level immediately before counting, high level after counting is started 0 high-level output 0 high-level output 1 1 1 high level immediately before counting, low level after counting is started remark m = 0 to 3 8.6 operation tmq0 can perform the following operations. operation tq0ctl1.tq0est bit (software trigger bit) tiq00 pin (external trigger input) capture/compare register setting compare register write interval timer mode invalid invalid compare only anytime write external event count mode note 1 invalid invalid compare only anytime write external trigger pulse output mode note 2 valid valid compare only batch write one-shot pulse output mode note 2 valid valid compare only anytime write pwm output mode invalid invalid compare only batch write free-running timer mode invalid invalid switching enabled anytime write pulse width measurement mode note 2 invalid invalid capture only not applicable notes 1. to use the external event count m ode, specify that the valid edge of the tiq00 pin capture trigger input is not detected (by clearing the tq0ioc1.tq 0is1 and tq0ioc1.tq0is0 bits to ?00?). 2. when using the external trigger pulse output m ode, one-shot pulse output mode, and pulse width measurement mode, select the internal clock as the count clock (by cleari ng the tq0ctl1.tq0eee bit to 0).
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 523 (1) counter basic operation this section explains the basic oper ation of the 16-bit counter. for details, refer to the description of the operation in each mode. (a) counter start operation ? external event count mode when the tq0ce bit value is changed from 0 to 1, t he value of 0000h is set to the 16-bit counter. after that, it counts up from 0001h, 0002h, 0003h, and so on each time the valid edge of the external event count input (tiq00) is detected. ? mode other than above the 16-bit counter of tmq0 starts counting from the default value ffffh. it counts up from ffffh to 0000h, 0001h, 0002h, 0003h, and so on. (b) clear operation the 16-bit counter is cleared to 0000h when its value matches the value of the compare register and when its value is captured. the counting operation from ff ffh to 0000h that takes place immediately after the counter has started counting or when the counter overflows is not a clearing operation. therefore, the inttq0ccm interrupt signal is not generated (m = 0 to 3). (c) overflow operation the 16-bit counter overflows when the counter counts up from ffffh to 0000h in the free-running timer mode or pulse width measurement mode . if the counter overflows, the tq0opt0.tq0ovf bit is set to 1 and an interrupt request signal (inttq0ov) is generat ed. note that the inttq0ov signal is not generated under the following conditions. ? immediately after a count operation has been started ? if the counter value matches the compare value ffffh and is cleared ? when ffffh is captured in the pulse width measur ement mode and the counter counts up from ffffh to 0000h caution after the overflow interrupt request signa l (inttq0ov) has been generated, be sure to check that the overflow flag (tq0ovf bit) is set to 1. (d) counter read operation during counting operation the value of the 16-bit counter of tmq0 can be re ad by using the tq0cnt r egister during the count operation. when the tq0ctl0.tq0ce bit = 1, the val ue of the 16-bit counter c an be read by reading the tq0cnt register. when the tq0ce bit = 0, the 16-bit counter is fff fh and the tq0cnt register is 0000h.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 524 (e) interrupt operation tmq0 generates the following five interrupt request signals. ? inttq0cc0 interrupt: this signal functions as a match interrupt request signal of the ccr0 buffer register and as a capture interrupt re quest signal to the tq0ccr0 register. ? inttq0cc1 interrupt: this signal functions as a match interrupt request signal of the ccr1 buffer register and as a capture interrupt re quest signal to the tq0ccr1 register. ? inttq0cc2 interrupt: this signal functions as a match interrupt request signal of the ccr2 buffer register and as a capture interrupt re quest signal to the tq0ccr2 register. ? inttq0cc3 interrupt: this signal functions as a match interrupt request signal of the ccr3 buffer register and as a capture interrupt re quest signal to the tq0ccr3 register. ? inttq0ov interrupt: this signal functions as an overflow interrupt request signal.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 525 (2) anytime write and batch write the tq0ccr0 to tq0ccr3 registers can be rewritten in the tmq0 during timer operation (tq0ctl0.tq0ce bit = 1), but the write method (anytime write, batch wr ite) of the ccr0 to ccr3 buffer registers differs depending on the mode. (a) anytime write in this mode, data is transferred at any time from the tq0ccr0 to tq0ccr3 registers to the ccr0 to ccr3 buffer registers during the timer operation. figure 8-2. flowchart of basic operation for anytime write start initial settings ? set values to tq0ccrm register ? timer operation enable (tq0ce bit = 1) transfer values of tq0ccrm register to ccrm buffer register timer operation ? match between 16-bit counter and ccrk buffer register note ? match between 16-bit counter and ccr0 buffer register ? 16-bit counter clear & start inttq0cc0 signal output tq0ccrm register rewrite transfer to ccrm buffer register inttq0cck signal output note the 16-bit counter is not cleared upon a match bet ween the 16-bit counter value and the ccrk buffer register value. it is cleared upon a match between t he 16-bit counter value and the ccr0 buffer register value. remarks 1. the above flowchart illustrates an example of the operation in the interval timer mode. 2. k = 1 to 3 m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 526 figure 8-3. timing of anytime write tq0ce bit = 1 16-bit counter tq0ccr0 register tq0ccr1 register tq0ccr2 register tq0ccr3 register inttq0cc0 signal inttq0cc1 signal inttq0cc2 signal inttq0cc3 signal ccr0 buffer register ccr1 buffer register ccr2 buffer register ccr3 buffer register 0000h d 11 d 11 d 12 d 11 d 11 d 12 d 12 d 21 d 21 d 21 d 01 d 01 d 02 d 02 d 01 d 12 d 21 0000h d 01 d 02 0000h d 21 d 31 0000h d 31 d 31 d 31 d 31 d 31 0000h ffffh remarks 1. d 01 , d 02 : setting values of tq0ccr0 register d 11 , d 12 : setting values of tq0ccr1 register d 21 : setting value of tq0ccr2 register d 31 : setting value of tq0ccr3 register 2. the above timing chart illustrates an example of the operation in the interval timer mode.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 527 (b) batch write in this mode, data is transferred all at once from the tq0ccr0 to tq0ccr3 registers to the ccr0 to ccr3 buffer registers during timer operation. this data is transferred upon a match between the value of the ccr0 buffer register and the value of the 16-bit counter. transfer is enabled by writing to the tq0ccr1 register. whether to enable or disable the next transfer timing is controlled by writing or not writing to the tq0ccr1 register. in order for the setting value when the tq0ccr0 to tq 0ccr3 registers are rewritten to become the 16-bit counter comparison value (in other words, in order fo r this value to be transferred to the ccr0 to ccr3 buffer registers), it is necessary to rewrite tq0ccr0 and finally write to the tq0ccr1 register before the 16-bit counter value and the ccr0 buffer register val ue match. the values of the tq0ccr0 to tq0ccr3 registers are transferred to the ccr0 to ccr3 buffer registers upon a match bet ween the count value of the 16-bit counter and the value of the ccr0 buffer re gister. thus, even when wishing only to rewrite the value of the tq0ccr0, tq0ccr2, or tq0ccr3 register, also write the same value (same as the value of the tq0ccr1 register already set) to the tq0ccr1 register.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 528 figure 8-4. flowchart of basic operation for batch write start initial settings ? set values to tq0ccrm register ? timer operation enable (tq0ce bit = 1) transfer of values of tq0ccrm register to ccrm buffer register timer operation ? match between 16-bit counter and ccrk buffer register note ? match between 16-bit counter and ccr0 buffer register ? 16-bit counter clear & start ? transfer of values of tq0ccrk register to ccrk buffer register inttq0cck signal output tq0ccr0, tq0ccr2, tq0ccr3 register rewrite tq0ccr1 register rewrite inttq0cc0 signal output batch write enable note the 16-bit counter is not cleared upon a match bet ween the 16-bit counter value and the ccrk buffer register value. it is cleared upon a match between t he 16-bit counter value and the ccr0 buffer register value. caution writing to the tq0ccr1 regi ster includes enabling of batch write. thus, rewrite the tq0ccr1 register after rewriting the tq0ccr0 , tq0ccr2, and tq0ccr3 registers. remarks 1. the above flowchart illustrates an example of the operation in the pwm output mode. 2. k = 1 to 3 m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 529 figure 8-5. timing of batch write tq0ce bit = 1 16-bit counter tq0ccr0 register tq0ccr1 register tq0ccr2 register tq0ccr3 register inttq0cc0 signal inttq0cc1 signal inttq0cc2 signal inttq0cc3 signal ccr0 buffer register ccr1 buffer register ccr2 buffer register ccr3 buffer register 0000h d 01 d 02 d 03 0000h d 11 0000h d 21 d 12 d 21 d 12 0000h d 31 d 32 d 33 d 31 d 32 d 33 d 01 d 02 d 03 d 11 d 12 d 12 d 21 d 31 d 11 d 01 d 21 d 21 d 12 d 12 d 12 d 12 d 32 d 32 d 32 d 02 d 02 d 03 toq00 pin output toq01 pin output toq02 pin output toq03 pin output d 21 d 21 note 1 note 1 same value write 0000h ffffh note 1 note 1 note 1 note 1 note 1 note 1 note 2 note 3 d 21 d 21 notes 1. because the tq0ccr1 register was not rewritten, d 02 is not transferred. 2. because tq0ccr1 register has been written (d 12 ), data is transferred to the ccr1 buffer register upon a match between the value of the 16-bit ti mer and the value of the tq0ccr0 register (d 01 ). 3. because tq0ccr1 register has been written (d 12 ), data is transferred to the ccr1 buffer register upon a match between the value of the 16-bit ti mer and the value of the tq0ccr0 register (d 12 ). remarks 1. d 01 , d 02 , d 03 : setting values of tq0ccr0 register d 11 , d 12 : setting values of tq0ccr1 register d 21 : setting value of tq0ccr2 register d 31 , d 32 , d 33 : setting values of tq0ccr3 register 2. the above timing chart illustrates the opera tion in the pwm output mode as an example.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 530 8.6.1 interval timer mode (t q0md2 to tq0md0 bits = 000) in the interval timer mode, an interrupt request signal (inttq0cc0) is generated at the interval set by the tq0ccr0 register if the tq0ct l0.tq0ce bit is set to 1. a square wave wit h a duty factor of 50% whose half cycle is equal to the interval can be output from the toq00 pin. the tq0ccr1 to tq0ccr3 registers are not used in the interval timer mode. however, the set value of the tq0ccr1 to tq0ccr3 registers is transferred to the ccr1 to ccr3 buffer registers and, when the count value of the 16-bit counter matches the value of the ccr1 to ccr3 bu ffer registers, compare match interrupt request signals (inttq0cc1 to inttq0cc3) are generated. in addition, a square wave with a duty factor of 50%, which is inverted when the inttq0cc1 to inttq0cc3 signals are generat ed, can be output from the toq01 to toq03 pins. the value of the tq0ccr1 to tq0ccr3 registers c an be rewritten even while the timer is operating. figure 8-6. configuration of interval timer 16-bit counter output controller ccr0 buffer register tq0ce bit tq0ccr0 register count clock selection clear match signal toq00 pin inttq0cc0 signal figure 8-7. basic timing of operation in interval timer mode ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register toq00 pin output inttq0cc0 signal d 0 d 0 d 0 d 0 d 0 interval (d 0 + 1) interval (d 0 + 1) interval (d 0 + 1) interval (d 0 + 1)
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 531 when the tq0ce bit is set to 1, the va lue of the 16-bit counter is cleared fr om ffffh to 0000h in synchronization with the count clock, and the counter starts counting. at this time, the output of the toq00 pin is inverted. additionally, the set value of the tq0ccr0 register is transferred to the ccr0 buffer register. when the count value of the 16-bit counter matches the valu e of the ccr0 buffer register, the 16-bit counter is cleared to 0000h, the output of the toq00 pin is in verted, and a compare match interrupt request signal (inttq0cc0) is generated. the interval can be calculated by the following expression. interval = (set value of tq0ccr0 register + 1) count clock cycle figure 8-8. register setting for in terval timer mode operation (1/3) (a) tmq0 control register 0 (tq0ctl0) 0/1 0 0 0 0 tq0ctl0 select count clock 0: stop counting 1: enable counting 0/1 0/1 0/1 tq0cks2 tq0cks1 tq0cks0 tq0ce (b) tmq0 control register 1 (tq0ctl1) 0 0 0/1 note 00 tq0ctl1 0, 0, 0: interval timer mode 000 tq0md2 tq0md1 tq0md0 tq0eee tq0est 0: operate on count clock selected by bits tq0cks0 to tq0cks2 1: count with external event count input signal note the tq0eee bit can be set to 1 only when the time r output (toq0k) is used. however, the tq0ccr0 and tq0ccrk registers must be set to the same value (k = 1 to 3).
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 532 figure 8-8. register setting for in terval timer mode operation (2/3) (c) tmq0 i/o control register 0 (tq0ioc0) 0/1 0/1 0/1 0/1 0/1 tq0ioc0 0: disable toq00 pin output 1: enable toq00 pin output setting of toq00 pin output level before count operation 0: low level 1: high level 0: disable toq01 pin output 1: enable toq01 pin output setting of toq01 pin output level before count operation 0: low level 1: high level 0/1 0/1 0/1 tq0oe1 tq0ol0 tq0oe0 tq0ol1 0: disable toq02 pin output 1: enable toq02 pin output setting of toq02 pin output level before count operation 0: low level 1: high level 0: disable toq03 pin output 1: enable toq03 pin output setting of toq03 pin output level before count operation 0: low level 1: high level tq0oe3 tq0ol2 tq0oe2 tq0ol3 (d) tmq0 i/o control register 2 (tq0ioc2) 0 0 0 0 0/1 note tq0ioc2 0/1 note 00 tq0ees0 tq0ets1 tq0ets0 tq0ees1 select valid edge of external event count input (tiq00 pin). note the tq0ees1 and tq0ees0 bits can be set onl y when timer outputs (toq01 to toq03) are used. however, set the tq0ccr0 to tq0ccr3 registers to the same value. (e) tmq0 counter read buffer register (tq0cnt) by reading the tq0cnt register, the count va lue of the 16-bit counter can be read. (f) tmq0 capture/compare register 0 (tq0ccr0) if the tq0ccr0 register is set to d 0 , the interval is as follows. interval = (d 0 + 1) count clock cycle
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 533 figure 8-8. register setting for in terval timer mode operation (3/3) (g) tmq0 capture/compare regist ers 1 to 3 (tq0ccr1 to tq0ccr3) the tq0ccr1 to tq0ccr3 registers ar e not used in the interval timer mode. however, the set value of the tq0ccr1 to tq0ccr3 registers are transferred to the ccr1 to ccr3 buffer registers. the toq01 to toq03 pin outputs are inverted and compare ma tch interrupt request signals (inttq0cc1 to inttq0cc3) are generated when the count value of t he 16-bit counter matches the value of the ccr1 to ccr3 buffer registers. when the tq0ccr1 to tq0ccr3 registers are not us ed, it is recommended to set their values to ffffh. also mask the registers by the in terrupt mask flags (tq0ccic1.tq0ccmk1 to tq0ccic3.tq0ccmk3). remark tmq0 i/o control register 1 (tq0ioc1) and tm q0 option register 0 (tq0opt0) are not used in the interval timer mode.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 534 (1) interval timer mode operation flow figure 8-9. software processing flow in interval timer mode tq0ce bit = 1 tq0ce bit = 0 register initial setting tq0ctl0 register (tq0cks0 to tq0cks2 bits) tq0ctl1 register, tq0ioc0 register, tq0ioc2 register note , tq0ccr0 register initial setting of these registers is performed before setting the tq0ce bit to 1. the tq0cks0 to tq0cks2 bits can be set at the same time when counting has been started (tq0ce bit = 1). the counter is initialized and counting is stopped by clearing the tq0ce bit to 0. the output level of the toq00 pin is as specified by the tq0ioc0 register. start stop <1> count operation start flow <2> count operation stop flow d 0 <1> <2> d 0 d 0 d 0 ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register toq00 pin output inttq0cc0 signal note the tq0ees1 and tq0ees0 bits can be set only when timer output (toq0k) is used. however, set the tq0ccr0 and tq0ccrk registers to the same value (k = 1 to 3).
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 535 (2) interval timer mode operation timing (a) operation if tq0ccr0 re gister is set to 0000h if the tq0ccr0 register is set to 0000h, the inttq0cc0 signal is generated at each count clock, and the output of the toq00 pin is inverted. the value of the 16-bit counter is always 0000h. count clock 16-bit counter tq0ce bit tq0ccr0 register toq00 pin output inttq0cc0 signal 0000h interval time count clock cycle interval time count clock cycle interval time count clock cycle ffffh 0000h 0000h 0000h 0000h (b) operation if tq0ccr0 re gister is set to ffffh if the tq0ccr0 register is set to ffffh, the 16-bit co unter counts up to ffffh. the counter is cleared to 0000h in synchronization with the next count-up timing. the inttq0cc0 signal is generated and the output of the toq00 pin is inverted. at this time, an overflow interrupt request signal (inttq0ov) is not generated, nor is the overflow flag (tq0opt0.tq0ovf bit) set to 1. ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register toq00 pin output inttq0cc0 signal ffffh interval time 10000h count clock cycle interval time 10000h count clock cycle interval time 10000h count clock cycle
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 536 (c) notes on rewriting tq0ccr0 register if the value of the tq0ccr0 register is rewritten to a smaller value duri ng counting, the 16-bit counter may overflow. if there is a possibility of overfl ow, stop counting and then change the set value. ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register tq0ol0 bit toq00 pin output inttq0cc0 signal d 1 d 2 d 1 d 1 d 2 d 2 d 2 l interval time (1) interval time (ng) interval time (2) remark interval time (1): (d 1 + 1) count clock cycle interval time (ng): (10000h + d 2 + 1) count clock cycle interval time (2): (d 2 + 1) count clock cycle if the value of the tq0ccr0 register is changed from d 1 to d 2 while the count value is greater than d 2 but less than d 1 , the count value is transferred to the ccr0 buff er register as soon as the tq0ccr0 register has been rewritten. consequently, the value of the 16-bit counter that is compared is d 2 . because the count value has already exceeded d 2 , however, the 16-bit c ounter counts up to ffffh, overflows, and then counts up again from 0000h. when the count value matches d 2 , the inttq0cc0 signal is generated and the output of the toq00 pin is inverted. therefore, the inttq0cc0 signal may not be generated at the interval time ?(d 1 + 1) count clock cycle? or ?(d 2 + 1) count clock cycle? originally expected, but may be generated at an interval of ?(10000h + d 2 + 1) count clock period?.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 537 (d) operation of tq0ccr1 to tq0ccr3 registers figure 8-10. configuration of tq0ccr1 to tq0ccr3 registers ccr0 buffer register tq0ce bit tq0ccr0 register clear match signal inttq0cc0 signal toq03 pin inttq0cc3 signal toq00 pin tq0ccr1 register ccr1 buffer register match signal toq01 pin inttq0cc1 signal tq0ccr3 register ccr3 buffer register match signal toq02 pin inttq0cc2 signal tq0ccr2 register ccr2 buffer register match signal output controller count clock selection output controller output controller output controller 16-bit counter
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 538 if the same value as the set value of the tq0ccr0 register is set to the tq0ccrk register, the inttq0cck signal is generated together with the inttq 0cc0 signal, and the output of the toq0k pin is inverted. this means that a square wave with a dut y factor of 50% can be output from the toq0k pin. if a value different from the set value of the tq0c cr0 register is set to the tq0ccrk register, the operation is as follows. if the set value of the tq0ccrk register is less than the set value of the tq0ccr0 register, the inttq0cck signal is generated once per cycle. at the same time, the output of the toq0k pin is inverted. the toq0k pin outputs a square wave with a duty factor of 50% after it first outputs a short-width pulse. remark k = 1 to 3 figure 8-11. timing chart when d 01 d k1 d 01 d 11 d 21 d 31 d 21 d 11 d 31 d 01 d 01 d 21 d 11 d 31 d 01 d 21 d 11 d 31 d 01 d 21 d 11 d 31 ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register toq00 pin output inttq0cc0 signal tq0ccr1 register toq01 pin output inttq0cc1 signal tq0ccr2 register toq02 pin output inttq0cc2 signal tq0ccr3 register toq03 pin output inttq0cc3 signal
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 539 if the set value of the tq0ccrk regi ster is greater than the set value of the tq0ccr0 register, the count value of the 16-bit counter does not match the value of the tq0ccr k register. consequently, the inttq0cck signal is not generated, nor is the output of the toq0k pin changed. it is recommended to set ffffh to the tq0ccrk register when the tq0ccrk register is not used. remark k = 1 to 3 figure 8-12. timing chart when d 01 < d k1 d 01 d 11 d 21 l l l d 31 d 01 d 01 d 01 d 01 ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register toq00 pin output inttq0cc0 signal tq0ccr1 register toq01 pin output inttq0cc1 signal tq0ccr2 register toq02 pin output inttq0cc2 signal tq0ccr3 register toq03 pin output inttq0cc3 signal
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 540 (3) operation by external event count input (tiq00) (a) operation to count the 16-bit counter at the va lid edge of external event count input (tiq00) in the interval timer mode, the valid edge of the external event count input is necessary once because the 16-bit counter is cleared from ffffh to 0000h immediately afte r the tq0ce bit is set from 0 to 1. when 0001h is set to both the tq0ccr0 and tq0ccrk registers, the output of the toq0k pins is inverted each time the 16-bit counter counts twice (k = 1 to 3). the tq0ctl0.tq0eee bit can be set to 1 in the inte rval timer mode only when the timer output (toq0k) is used with the external event count input. tq0ce bit 16-bit counter tq0ccr0 register toq01 pin output tq0ccr1 register toq02 pin output tq0ccr2 register toq03 pin output tq0ccr3 register ffffh 0000h 0001h 0001h 0001h 0001h 0001h 0001h 0001h 0001h 0001h 0001h 0001h 0001h 0001h 0001h 0001h external event count input (tiq00 pin input) number of external events: 3 number of external events: 2 number of external events: 2 2-count width 2-count width 2-count width
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 541 8.6.2 external event count mode (tq0md2 to tq0md0 bits = 001) in the external event count mode, t he valid edge of the external event c ount input (tiq00) is counted when the tq0ctl0.tq0ce bit is set to 1, and an interrupt request signal (inttq0cc0) is generated each time the specified number of edges set by the tq0ccr0 register have be en counted. the toq00 to toq03 pins cannot be used. when using the toq01 and toq03 pins for external event count input, set the tq0ctl1.tq0eee bit to 1 in the interval timer mode (see 8.6.1 (3) operation by external event count input (tiq00) ). the tq0ccr1 to tq0ccr3 registers are not used in the external event count mode. caution in the external event count mode, the tq0 ccr0 to tq0ccr3 registers must not be cleared to 0000h. figure 8-13. configuration in external event count mode 16-bit counter ccr0 buffer register tq0ce bit tq0ccr0 register edge detector clear match signal inttq0cc0 signal tiq00 pin (external event count input)
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 542 figure 8-14. basic timing in external event count mode ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register inttq0cc0 signal d 0 d 0 d 0 d 0 16-bit counter tq0ccr0 register nttq0cc0 signal external event count input (tiq00 pin input) d 0 number of external event count (d 0 ) times note d 0 ? 1d 0 0000 0001 number of external event count (d 0 + 1) times number of external event count (d 0 + 1) times note in the external event count mode, the 16-bit c ounter is cleared from ffffh to 0000h as soon as the tq0ctl0.tq0ce bit has been set (1) (operation is started). the first counting operation is started from 0001h each time the valid edge of t he external event count input has been detected. therefore, the number of counts of the first counting operation is one less than that of the second counting operation. remark this figure shows the basic timing when the risi ng edge is specified as the valid edge of the external event count input.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 543 when the tq0ce bit is set to 1, the value of the 16-bit count er is cleared from ffffh to 0000h. the counter counts each time the valid edge of external event count input is detec ted. additionally, the set value of the tq0ccr0 register is transferred to the ccr0 buffer register. when the count value of the 16-bit counter matches the valu e of the ccr0 buffer register, the 16-bit counter is cleared to 0000h, and a compare match interrupt request signal (inttq0cc0) is generated. the inttq0cc0 signal is generated for the first time when the valid edge of the external event count input has been detected ?value set to tq0ccr0 register? times. a fter that, the inttq0cc0 signal is generated each time the valid edge of the external event count has been detec ted ?value set to tq0ccr0 register + 1? times. figure 8-15. register setting for operati on in external event count mode (1/2) (a) tmq0 control register 0 (tq0ctl0) 0/1 0 0 0 0 tq0ctl0 0: stop counting 1: enable counting 000 tq0cks2 tq0cks1 tq0cks0 tq0ce (b) tmq0 control register 1 (tq0ctl1) 00000 tq0ctl1 0, 0, 1: external event count mode 001 tq0md2 tq0md1 tq0md0 tq0eee tq0est (c) tmq0 i/o control register 2 (tq0ioc2) 0 0 0 0 0/1 tq0ioc2 select valid edge of external event count input (tiq00 pin) 0/1 0 0 tq0ees0 tq0ets1 tq0ets0 tq0ees1 (d) tmq0 counter read buffer register (tq0cnt) the count value of the 16-bit counter can be read by reading the tq0cnt register.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 544 figure 8-15. register setting for operati on in external event count mode (2/2) (e) tmq0 capture/compare register 0 (tq0ccr0) if the tq0ccr0 register is set to d 0 , the count is cleared when the number of external events has reached (d 0 ) and the first compare match interrupt request signal (inttq0cc0) is generated. the second compare match interrupt request signal (inttq0cc0) is generated when the number of external events has reached (d 0 + 1). (f) tmq0 capture/compare register s 1 to 3 (tq0ccr1 to tq0ccr3) the tq0ccr1 to tq0ccr3 registers are not used in t he external event count mode. however, the set value of the tq0ccr1 to tq0ccr3 registers are trans ferred to the ccr1 to ccr3 buffer registers. when the count value of the 16-bit counter matches t he value of the ccr1 to ccr3 buffer registers, compare match interrupt request signals (inttq0cc1 to inttq0cc3) are generated. when the tq0ccr1 to tq0ccr3 registers are not us ed, it is recommended to set their values to ffffh. also mask the registers by the in terrupt mask flags (t q0ccic1.tq0ccmk1 to tq0ccic3.tq0ccmk3). cautions 1. set the tq0ioc0 register to 00h. 2. when an external clock is used as the count clock, the external clock can be input only from the tiq00 pin. at this time, set the tq0ioc1.tq0is1 and tq0ioc1.tq0is0 bits to 00 (capture trigger input (tiq00 pin): no edge detection). remark the tmq0 i/o control register 1 (tq0ioc1) and tmq0 option register 0 (tq0opt0) are not used in the external event count mode.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 545 (1) external event count mode operation flow figure 8-16. flow of software processing in external event count mode ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register inttq0cc0 signal d 0 d 0 d 0 d 0 <1> <2> tq0ce bit = 1 tq0ce bit = 0 register initial setting tq0ctl1 register, tq0ioc2 register, tq0ccr0 to tq0ccr3 register initial setting of these registers is performed before setting the tq0ce bit to 1. the counter is initialized and counting is stopped by clearing the tq0ce bit to 0. start stop <1> count operation start flow <2> count operation stop flow
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 546 (2) operation timing in external event count mode cautions 1. in the external even t count mode, setting the tq0ccr0 to tq0ccr3 registers to 0000h is disabled. 2. in the external event count mode, use of th e timer output (toq00 to toq03) is disabled. if performing external event count input (tiq00) using the timer outputs (toq01 to toq03), set the interval timer mode to enable the count clock operation (tq0ctl1.tq0eee bit = 1) for the external event count input (refer to 8.6.1 (3) operation by external event count input (tiq00)). (a) operation if tq0ccr0 re gister is set to ffffh if the tq0ccr0 register is set to ffffh, the 16-bit counter counts to ffffh each time the valid edge of the external event count signal has been detected. the 16-bit counter is cleared to 0000h in synchronization with the next count-up timing, and the in ttq0cc0 signal is generated. at this time, the tq0opt0.tq0ovf bit is not set. ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register inttq0cc0 signal ffffh number of external event count ffffh times number of external event count 10000h times number of external event count 10000h times
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 547 (b) notes on rewriting the tq0ccr0 register if the value of the tq0ccr0 register is rewritten to a smaller value duri ng counting, the 16-bit counter may overflow. if there is a possibility of overfl ow, stop counting and then change the set value. ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register inttq0cc0 signal d 1 d 2 d 1 d 1 d 2 d 2 d 2 number of external event count (1) (d 1 ) times number of external event count (ng) (10000h + d 2 + 1) times number of external event count(2) (d 2 + 1) times if the value of the tq0ccr0 register is changed from d 1 to d 2 while the count value is greater than d 2 but less than d 1 , the count value is transferred to the ccr0 buff er register as soon as the tq0ccr0 register has been rewritten. consequently, the value t hat is compared with the 16-bit counter is d 2 . because the count value has already exceeded d 2 , however, the 16-bit c ounter counts up to ffffh, overflows, and then counts up again from 0000h. when the count value matches d 2 , the inttq0cc0 signal is generated. therefore, the inttq0cc0 signal may not be generated at the valid edge count of ?(d 1 + 1) times? or ?(d 2 + 1) times? originally expected, but may be generated at the valid edge count of ?(10000h + d 2 + 1) times?.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 548 (c) operation of tq0ccr1 to tq0ccr3 registers figure 8-17. configuration of tq0ccr1 to tq0ccr3 registers ccr0 buffer register tq0ce bit tq0ccr0 register clear match signal inttq0cc0 signal inttq0cc3 signal tiq00 pin (external event count input) tq0ccr1 register ccr1 buffer register match signal inttq0cc1 signal tq0ccr3 register ccr3 buffer register match signal inttq0cc2 signal tq0ccr2 register ccr2 buffer register match signal 16-bit counter edge detector
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 549 if the set value of the tq0ccrk register is smalle r than the set value of the tq0ccr0 register, the inttq0cck signal is generated once per cycle. remark k = 1 to 3 figure 8-18. timing chart when d 01 d k1 d 01 d 11 d 21 d 31 d 21 d 11 d 31 d 01 d 01 d 21 d 11 d 31 d 01 d 21 d 11 d 31 d 01 d 21 d 11 d 31 ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register inttq0cc0 signal tq0ccr1 register inttq0cc1 signal tq0ccr2 register inttq0cc2 signal tq0ccr3 register inttq0cc3 signal
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 550 if the set value of the tq0ccrk regi ster is greater than the set va lue of the tq0ccr0 register, the inttq0cck signal is not generated because the count va lue of the 16-bit counter and the value of the tq0ccrk register do not match. it is recommended to set ffffh to the tq0ccrk register when the tq 0ccrk register is not used. remark k = 1 to 3 figure 8-19. timing chart when d 01 < d k1 d 01 d 11 d 21 l l l d 31 d 01 d 01 d 01 d 01 ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register inttq0cc0 signal tq0ccr1 register inttq0cc1 signal tq0ccr2 register inttq0cc2 signal tq0ccr3 register inttq0cc3 signal
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 551 8.6.3 external trigger pulse output m ode (tq0md2 to tq0md0 bits = 010) in the external trigger pulse output mode, 16-bit ti mer/event counter q waits for a trigger when the tq0ctl0.tq0ce bit is set to 1. when the valid edge of an external trigger i nput signal (tiq00) is detected, 16-bit timer/event counter q starts counting, and output s a pwm waveform from the toq01 to toq03 pins. pulses can also be output by generating a software trigger instead of using the external trigger. when using a software trigger, a square wave with a duty factor of 50% wh ose half cycle is the set val ue of the tq0ccr0 register + 1 can also be output from the toq00 pin. figure 8-20. configuration in external trigger pulse output mode ccr0 buffer register tq0ce bit tq0ccr0 register clear match signal inttq0cc0 signal toq03 pin inttq0cc3 signal toq00 pin note tiq00 pin note (external trigger input) transfer s r tq0ccr1 register ccr1 buffer register match signal toq01 pin inttq0cc1 signal transfer transfer s r tq0ccr3 register ccr3 buffer register match signal transfer toq02 pin inttq0cc2 signal s r tq0ccr2 register ccr2 buffer register match signal 16-bit counter count clock selection count start control edge detector software trigger generation output controller (rs-ff) output controller output controller (rs-ff) output controller note because the external trigger input pin (tiq00) and timer output pin (toq00) share the same alternate- function pin, two functions cannot be used at the same time. caution in external trigger pulse output mode, select the internal clock (set the tq0ctl1.tq0eee bit = 0) as the count clock.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 552 figure 8-21. basic timing in exte rnal trigger pulse output mode d 1 d 2 d 3 d 1 d 2 d 3 d 1 d 2 d 3 d 1 d 1 d 2 d 3 active level width (d 2 ) active level width (d 2 ) active level width (d 2 ) active level width (d 3 ) active level width (d 3 ) cycle (d 0 + 1) cycle (d 0 + 1) wait for trigger active level width (d 3 ) cycle (d 0 + 1) ffffh 16-bit counter 0000h tq0ce bit external trigger input (tiq00 pin input) tq0ccr0 register inttq0cc0 signal toq00 pin output (only when software trigger is used) tq0ccr1 register inttq0cc1 signal toq01 pin output tq0ccr2 register inttq0cc2 signal toq02 pin output tq0ccr3 register inttq0cc3 signal toq03 pin output active level width (d 1 ) active level width (d 1 ) active level width (d 1 ) active level width (d 1 ) active level width (d 1 ) d 0 d 1 d 3 d 2 d 0 d 0 d 0 d 0
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 553 16-bit timer/event counter q waits for a trigger when the tq0ce bit is set to 1. when the trigger is generated, the 16-bit counter is cleared from ffffh to 0000h, starts count ing at the same time, and out puts a pwm waveform from the toq0k pin. if the trigger is generated again while the counter is operating, the c ounter is cleared to 0000h and restarted. (the output of the toq00 pin is inverted. the toq0k pin outputs a high-level regar dless of the status (high/low) when a trigger occurs.) the active level width, cycle, and duty factor of the pwm waveform can be calculated as follows. active level width = (set value of tq0ccrk register) count clock cycle cycle = (set value of tq0ccr0 register + 1) count clock cycle duty factor = (set value of tq0ccrk regist er)/(set value of tq0ccr0 register + 1) the compare match request signal inttq0 cc0 is generated when the 16-bit c ounter counts next time after its count value matches the value of the cc r0 buffer register, and the 16-bit counter is cleared to 0000h. the compare match interrupt request signal inttq0cck is generated when the count value of the 16-bit counter matches the value of the ccrk buffer register. the value set to the tq0ccrm register is transferred to the ccrm buffer register w hen the count value of the 16- bit counter matches the value of the ccr0 buffer r egister and the 16-bit counter is cleared to 0000h. the valid edge of an external trigger input signal (tiq00) , or setting the software trigger (tq0ctl1.tq0est bit) to 1 is used as the trigger. remark k = 1 to 3, m = 0 to 3 figure 8-22. setting of registers in exte rnal trigger pulse output mode (1/3) (a) tmq0 control register 0 (tq0ctl0) 0/1 0 0 0 0 tq0ctl0 select count clock 0: stop counting 1: enable counting 0/1 0/1 0/1 tq0cks2 tq0cks1 tq0cks0 tq0ce
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 554 figure 8-22. setting of registers in exte rnal trigger pulse output mode (2/3) (b) tmq0 control register 1 (tq0ctl1) 0 0/1 0 0 0 tq0ctl1 0: operate on count clock selected by tq0cks0 to tq0cks2 bits generate software trigger when 1 is written 010 tq0md2 tq0md1 tq0md0 tq0eee tq0est 0, 1, 0: external trigger pulse output mode (c) tmq0 i/o control register 0 (tq0ioc0) 0/1 0/1 0/1 0/1 0/1 tq0ioc0 0: disable toq00 pin output 1: enable toq00 pin output setting of toq00 pin output level in status of waiting for external trigger 0: low level 1: high level 0: disable toq01 pin output 1: enable toq01 pin output setting of toq01 pin output level in status of waiting for external trigger 0: low level 1: high level 0/1 0/1 0/1 note tq0oe1 tq0ol0 tq0oe0 tq0ol1 toq0k pin output 16-bit counter ? when tq0olk bit = 0 toq0k pin output 16-bit counter ? when tq0olk bit = 1 tq0oe3 tq0ol2 tq0oe2 tq0ol3 setting of toq03 pin output level in status of waiting for external trigger 0: low level 1: high level 0: disable toq02 pin output 1: enable toq02 pin output setting of toq02 pin output level in status of waiting for external trigger 0: low level 1: high level 0: disable toq03 pin output 1: enable toq03 pin output note clear this bit to 0 when the toq00 pin is not used in the external trigger pulse output mode.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 555 figure 8-22. setting of registers in exte rnal trigger pulse output mode (3/3) (d) tmq0 i/o control register 2 (tq0ioc2) 00000 tq0ioc2 select valid edge of external trigger input (tiq00 pin) 0 0/1 0/1 tq0ees0 tq0ets1 tq0ets0 tq0ees1 (e) tmq0 counter read buffer register (tq0cnt) the value of the 16-bit counter can be read by reading the tq0cnt register. (f) tmq0 capture/compare register s 0 to 3 (tq0ccr0 to tq0ccr3) if d 0 is set to the tq0ccr0 register, d 1 to the tq0ccr1 register, d 2 to the tq0ccr2 register, and d 3 , to the tq0ccr3 register, the cycle and active level of the pwm waveform are as follows. cycle = (d 0 + 1) count clock cycle toq01 pin pwm waveform active level width = d 1 count clock cycle toq02 pin pwm waveform active level width = d 2 count clock cycle toq03 pin pwm waveform active level width = d 3 count clock cycle remarks 1. tmq0 i/o control register 1 (tq0ioc1) and tmq0 option register 0 (tq0opt0) are not used in the external trigger pulse output mode. 2. updating tmq0 capture/compare register 2 (tq0ccr2) and tmq0 capture/compare register 3 (tq0ccr3) is validated by writing tmq0 capture/compare register 1 (tq0ccr1).
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 556 (1) operation flow in extern al trigger pulse output mode figure 8-23. software processing flow in ex ternal trigger pulse output mode (1/2) d 10 d 10 d 10 d 20 d 30 d 00 d 11 d 21 d 01 d 31 d 11 d 21 d 00 d 31 d 20 d 30 d 00 d 21 d 00 d 31 d 11 d 21 d 00 d 31 ffffh 16-bit counter 0000h tq0ce bit external trigger input (tiq00 pin input) tq0ccr0 register ccr0 buffer register inttq0cc0 signal toq00 pin output (only when software trigger is used) tq0ccr1 register ccr1 buffer register inttq0cc1 signal toq01 pin output tq0ccr2 register ccr2 buffer register inttq0cc2 signal toq02 pin output tq0ccr3 register ccr3 buffer register inttq0cc3 signal toq03 pin output d 00 d 01 d 00 d 00 d 01 d 00 d 10 d 11 d 10 d 10 d 11 d 10 d 11 d 10 d 11 d 20 d 21 d 20 d 21 d 20 d 21 d 21 d 30 d 31 d 30 d 31 d 30 d 31 d 30 d 31 <1> <2> <3> <4> <5> <6> <7> d 11 d 11 d 20 d 10
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 557 figure 8-23. software processing flow in ex ternal trigger pulse output mode (2/2) start <1> count operation start flow tq0ce bit = 1 register initial setting tq0ctl0 register (tq0cks0 to tq0cks2 bits) tq0ctl1 register, tq0ioc0 register, tq0ioc2 register, tq0ccr0 to tq0ccr3 registers initial setting of these registers is performed before setting the tq0ce bit to 1. writing of the tq0ccr1 register must be performed when the set duty factor is only changed after writing the tq0ccr2 and tq0ccr3 registers. when the counter is cleared after setting, the value of the tq0ccrm register is transferred to the ccrm buffer register. writing the same value (same as the tq0ccr1 register already set) to the tq0ccr1 register is necessary only when the set duty factor of toq02 and toq03 pin outputs is changed. when the counter is cleared after setting, the value of the tq0ccrm register is transferred to the ccrm buffer register. only writing of the tq0ccr1 register must be performed when the set duty factor is only changed. when counter is cleared after setting, the value of the tq0ccrm register is transferred to the ccrm buffer register. counting is stopped. the tq0cks0 to tq0cks2 bits can be set at the same time when counting is enabled (tq0ce bit = 1). trigger wait status writing of the tq0ccr1 register must be performed after writing the tq0ccr0, tq0ccr2, and tq0ccr3 registers. when the counter is cleared after setting, the value of the tq0ccrm register is transferred to the ccrm buffer registers. writing the same value (same as the tq0ccr1 register already set) to the tq0ccr1 register is necessary only when the set cycle is changed. <2> tq0ccr0 to tq0ccr3 register setting change flow <3> tq0ccr0 register setting change flow <4> tq0ccr1 to tq0ccr3 register setting change flow <5> tq0ccr2, tq0ccr3 register setting change flow <6> tq0ccr1 register setting change flow <7> count operation stop flow tq0ce bit = 0 setting of tq0ccr2, tq0ccr3 registers setting of tq0ccr1 register setting of tq0ccr2, tq0ccr3 registers setting of tq0ccr1 register stop setting of tq0ccr1 register setting of tq0ccr0 register setting of tq0ccr1 register setting of tq0ccr0, tq0ccr2, and tq0ccr3 registers tq0ccr1 register when the counter is cleared after setting, the value of the tq0ccrm register is transferred to the ccrm buffer register. remark m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 558 (2) external trigger pulse output mode operation timing (a) note on changing pulse width during operation to change the pwm waveform while the counter is operating, write the tq0ccr1 register last. rewrite the tq0ccrk register after writing the tq0ccr1 register after the inttq0cc0 signal is detected. ffffh 16-bit counter 0000h tq0ce bit external trigger input (tiq00 pin input) d 30 d 00 d 01 d 30 d 30 d 20 d 20 d 20 d 21 d 11 d 00 d 00 d 31 d 01 d 01 d 21 d 11 d 31 tq0ccr0 register ccr0 buffer register inttq0cc0 signal tq0ccr1 register ccr1 buffer register inttq0cc1 signal toq01 pin output tq0ccr2 register ccr2 buffer register inttq0cc2 signal toq02 pin output tq0ccr3 register ccr3 buffer register inttq0cc3 signal toq03 pin output toq00 pin output (only when software trigger is used) d 10 d 10 d 10 d 00 d 11 d 10 d 11 d 10 d 21 d 20 d 21 d 20 d 31 d 30 d 31 d 30 d 00 d 01
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 559 in order to transfer data from the tq0ccrm register to the ccrm buffer register, the tq0ccr1 register must be written. to change both the cycle and active level width of the pwm waveform at this time, first set the cycle to the tq0ccr0 register, set the active level width to t he tq0ccr2 and tq0ccr3 registers, and then set an active level to the tq0ccr1 register. to change only the cycle of the pwm waveform, first set the cycle to the tq0ccr0 register, and then write the same value (same as the tq0ccr1 regist er already set) to the tq0ccr1 register. to change only the active level width (duty factor) of the pwm waveform, first set an active level to the tq0ccr2 and tq0ccr3 registers and then set an active level to the tq0ccr1 register. to change only the active level width (duty factor) of the pwm waveform output by the toq01 pin, only the tq0ccr1 register has to be set. to change only the active level width (duty factor) of the pwm waveform output by the toq02 and toq03 pins, first set an active level width to the tq0 ccr2 and tq0ccr3 registers, and then write the same value (same as the tq0ccr1 register already set) to the tq0ccr1 register. after data is written to the tq0ccr1 register, the value written to the tq0ccrm register is transferred to the ccrm buffer register in synchronization with clea ring of the 16-bit counter, and is used as the value compared with the 16-bit counter. to write the tq0ccr0 to tq0ccr3 registers again afte r writing the tq0ccr1 register once, do so after the inttq0cc0 signal is generated. otherwise, t he value of the ccrm buffer register may become undefined because timing of transferring data from t he tq0ccrm register to the ccrm buffer register conflicts with writing the tq0ccrm register. remark m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 560 (b) 0%/100% output of pwm waveform to output a 0% waveform, set the tq0ccrk register to 0000h. the 16-bit counter is cleared to 0000h and the inttq0cc0 and inttq0cck signals are generated at the next timing after a match between the count value of the 16-bit counter and t he value of the ccr0 buffer register. count clock 16-bit counter tq0ce bit tq0ccr0 register tq0ccrk register inttq0cc0 signal inttq0cck signal toq0k pin output external trigger input (tiq00 pin input) d 0 l 0000h d 0 0000h d 0 0000h d 0 ? 1d 0 0000 ffff 0000 d 0 ? 1d 0 0000 0001 remark k = 1 to 3 to output a 100% waveform, set a value of (set value of tq0ccr0 register + 1) to the tq0ccrk register. if the set value of the tq0ccr0 register is ffffh, 100% output cannot be produced. d 0 d 0 + 1 d 0 d 0 + 1 d 0 d 0 + 1 d 0 0000 ffff 0000 d 0 0000 0001 count clock 16-bit counter tq0ce bit tq0ccr0 register tq0ccrk register inttq0cc0 signal inttq0cck signal toq0k pin output d 0 ? 1d 0 ? 1 external trigger input (tiq00 pin input) l remark k = 1 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 561 (c) conflict between trigger detection and match with ccrk buffer register if the trigger is detected immediately after the inttq 0cck signal is generated, the 16-bit counter is immediately cleared to 0000h, the output signal of t he toq0k pin is asserted, and the counter continues counting. consequently, the inactive peri od of the pwm waveform is shortened. 16-bit counter ccrk buffer register inttq0cck signal toq0k pin output external trigger input (tiq00 pin input) d k d k ? 1 0000 ffff 0000 shortened d k remark k = 1 to 3 if the trigger is detected immediately before the in ttq0cck signal is generated, the inttq0cck signal is not generated, and the 16-bit counter is cleared to 0000h and continues counting. t he output signal of the toq0k pin remains active. consequently, the active period of the pwm waveform is extended. 16-bit counter ccrk buffer register inttq0cck signal toq0k pin output external trigger input (tiq00 pin input) d k d k ? 2d k ? 1d k 0000 ffff 0000 0001 extended remark k = 1 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 562 (d) conflict between trigger detection and match with ccr0 buffer register if the trigger is detected immediately after the inttq 0cc0 signal is generated, the 16-bit counter is cleared to 0000h and continues counting up. therefore, the active period of the toq0k pin is extended by time from generation of the inttq0cc0 signal to trigger detection. 16-bit counter ccr0 buffer register inttq0cc0 signal toq0k pin output external trigger input (tiq00 pin input) d 0 d 0 ? 1d 0 0000 ffff 0000 0000 extended remark k = 1 to 3 if the trigger is detected immediately before the in ttq0cc0 signal is generated, the inttq0cc0 signal is not generated. the 16-bit counter is cleared to 0000h, the toq0k pin is asserted, and the counter continues counting. consequently, the inactive period of the pwm waveform is shortened. 16-bit counter ccr0 buffer register inttq0cc0 signal toq0k pin output external trigger input (tiq00 pin input) d 0 d 0 ? 1d 0 0000 ffff 0000 0001 shortened remark k = 1 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 563 (e) generation timing of compare match interrupt request signal (inttq0cck) the timing of generation of the inttq 0cck signal in the external trigger pulse output mode differs from the timing of other mode inttq0cck signals; the inttq 0cck signal is generated when the count value of the 16-bit counter matches the value of the ccrk buffer register. count clock 16-bit counter ccrk buffer register toq0k pin output inttq0cck signal d k d k ? 2d k ? 1d k d k + 1 d k + 2 remark k = 1 to 3 usually, the inttq0cck signal is generated in synchro nization with the next count up after the count value of the 16-bit counter matches the va lue of the ccrk buffer register. in the external trigger pulse output mode, however, it is generated one clock earlier. this is because the timing is changed to match the timing of cha nging the output signal of the toq0k pin.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 564 8.6.4 one-shot pulse output mode (tq0md2 to tq0md0 bits = 011) in the one-shot pulse output mode, 16-bit timer/event coun ter q waits for a trigger when the tq0ctl0.tq0ce bit is set to 1. when the valid edge of an external trigger in put (tiq00) is detected, 16-bit timer/event counter q starts counting, and outputs a one-shot pulse from the toq01 to toq03 pins. instead of the external trigger input (tiq00), a software trigger can also be generated to output the pulse. when the software trigger is used, the toq 00 pin outputs the active level while t he 16-bit counter is counting, and the inactive level when the counter is stopped (waiting for a trigger). figure 8-24. configuration in one-shot pulse output mode ccr0 buffer register tq0ce bit tq0ccr0 register clear match signal inttq0cc0 signal toq03 pin inttq0cc3 signal toq00 pin note tiq00 pin note (external trigger input) transfer s r s r tq0ccr1 register ccr1 buffer register match signal toq01 pin inttq0cc1 signal transfer transfer s r tq0ccr3 register ccr3 buffer register match signal transfer toq02 pin inttq0cc2 signal s r tq0ccr2 register ccr2 buffer register match signal 16-bit counter count clock selection count start control edge detector software trigger generation output controller (rs-ff) output controller (rs-ff) output controller (rs-ff) output controller (rs-ff) note because the external trigger input pin (tiq00) and timer output pin (toq00) share the same alternate- function pin, two functions cannot be used at the same time. caution in one-shot pulse output m ode, select the internal clock (set the tq0ctl1.tq0eee bit = 0) as the count clock.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 565 figure 8-25. basic timing in one-shot pulse output mode d 0 d 1 d 2 d 3 d 1 d 2 d 3 d 0 d 1 d 2 d 3 d 0 d 1 d 2 d 3 d 0 delay (d 1 ) active level width (d 0 ? d 1 + 1) delay (d 1 ) active level width (d 0 ? d 1 + 1) delay (d 1 ) active level width (d 0 ? d 1 + 1) delay (d 2 ) active level width (d 0 ? d 2 + 1) delay (d 2 ) active level width (d 0 ? d 2 + 1) delay (d 2 ) active level width (d 0 ? d 2 + 1) delay (d 3 ) active level width (d 0 ? d 3 + 1) delay (d 3 ) active level width (d 0 ? d 3 + 1) delay (d 3 ) active level width (d 0 ? d 3 + 1) ffffh 16-bit counter 0000h tq0ce bit external trigger input (tiq00 pin input) tq0ccr0 register inttq0cc0 signal tq0ccr2 register inttq0cc2 signal toq02 pin output tq0ccr3 register inttq0cc3 signal toq03 pin output tq0ccr1 register inttq0cc1 signal toq01 pin output toq00 pin output (only when software trigger is used)
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 566 when the tq0ce bit is set to 1, 16-bit timer/event counter q waits for a trigger. when the trigger is generated, the 16-bit counter is cleared from ffffh to 0000h, starts counti ng, and outputs a o ne-shot pulse from the toq0k pin. after the one-shot pulse is output, the 16-bit counter is set to 0000h, stops counting, and waits for a trigger. when the trigger is generated again, the 16-bit counter starts countin g from 0000h. generation of a trigger is ignored while the one-shot pulse is being output. the output delay period and active level width of the one-shot pulse can be calculated as follows. output delay period = (set value of tq0ccrk register) count clock cycle active level width = (set value of tq0ccr0 register ? set value of tq0ccrk register + 1) count clock cycle the compare match interrupt request signal inttq0cc0 is generated when the 16-bit counter counts after its count value matches the value of the ccr0 buffer register. the compare match interrupt request signal inttq0cck is generated when the count value of the 16-bit counter matches the va lue of the ccrk buffer register. the valid edge of an external trigger input (tiq00 pin) or setting the software trigger (tq0ctl1.tq0est bit) to 1 is used as the trigger. remark k = 1 to 3 figure 8-26. setting of registers in one-shot pulse output mode (1/3) (a) tmq0 control register 0 (tq0ctl0) 0/1 0 0 0 0 tq0ctl0 select count clock 0: stop counting 1: enable counting 0/1 0/1 0/1 tq0cks2 tq0cks1 tq0cks0 tq0ce (b) tmq0 control register 1 (tq0ctl1) 0 0/1 0 0 0 tq0ctl1 0: operate on count clock selected by tq0cks0 to tq0cks2 bits generate software trigger when 1 is written 011 tq0md2 tq0md1 tq0md0 tq0eee tq0est 0, 1, 1: one-shot pulse output mode
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 567 figure 8-26. register setting in one-shot pulse output mode (2/3) (c) tmq0 i/o control register 0 (tq0ioc0) toq0k pin output 16-bit counter ? when tq0olk bit = 0 toq0k pin output 16-bit counter ? when tq0olk bit = 1 0/1 0/1 0/1 0/1 0/1 tq0ioc0 0: disable toq00 pin output 1: enable toq00 pin output setting of toq00 pin output level in status of waiting for external trigger 0: low level 1: high level 0: disable toq01 pin output 1: enable toq01 pin output setting of toq01 pin output level in status of waiting for external trigger 0: low level 1: high level 0/1 0/1 0/1 note tq0oe1 tq0ol0 tq0oe0 tq0ol1 tq0oe3 tq0ol2 tq0oe2 tq0ol3 setting of toq03 pin output level in status of waiting for external trigger 0: low level 1: high level 0: disable toq02 pin output 1: enable toq02 pin output setting of toq02 pin output level in status of waiting for external trigger 0: low level 1: high level 0: disable toq03 pin output 1: enable toq03 pin output note clear this bit to 0 when the toq00 pin is not used in the one-shot pulse output mode. (d) tmq0 i/o control register 2 (tq0ioc2) 00000 tq0ioc2 select valid edge of external trigger input (tiq00 pin) 0 0/1 0/1 tq0ees0 tq0ets1 tq0ets0 tq0ees1
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 568 figure 8-26. register setting in one-shot pulse output mode (3/3) (e) tmq0 counter read buffer register (tq0cnt) the value of the 16-bit counter can be read by reading the tq0cnt register. (f) tmq0 capture/compare register s 0 to 3 (tq0ccr0 to tq0ccr3) if d 0 is set to the tq0ccr0 register and d k to the tq0ccrk register, the active level width and output delay period of the one-shot pulse are as follows. active level width = (d 0 ? d k + 1) count clock cycle output delay period = (d k ) count clock cycle caution one-shot pulses are not output even in the one-shot pulse outpu t mode, if the value set in the tq0ccr0 register is greater than that set in the tq0ccrk register. remarks 1. tmq0 i/o control register 1 (tq0ioc1) and tmq0 option register 0 (tq0opt0) are not used in the one-shot pulse output mode. 2. k = 1 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 569 (1) operation flow in one-shot pulse output mode figure 8-27. software processing flow in one-shot pulse output mode (1/2) ffffh 16-bit counter 0000h tq0ce bit external trigger input (tiq00 pin input) tq0ccr0 register inttq0cc0 signal toq00 pin output (only when software trigger is used) tq0ccr1 register inttq0cc1 signal toq01 pin output tq0ccr2 register inttq0cc2 signal toq02 pin output tq0ccr3 register inttq0cc3 signal toq03 pin output d 00 d 01 d 11 d 10 d 21 d 20 d 31 d 30 d 10 d 20 d 30 d 11 d 21 d 31 d 00 d 01 <3> <1> <2>
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 570 figure 8-27. software processing flow in one-shot pulse output mode (2/2) tq0ce bit = 1 register initial setting tq0ctl0 register (tq0cks0 to tq0cks2 bits) tq0ctl1 register, tq0ioc0 register, tq0ioc2 register, tq0ccr0 to tq0ccr3 registers initial setting of these registers is performed before setting the tq0ce bit to 1. the tq0cks0 to tq0cks2 bits can be set at the same time when counting has been started (tq0ce bit = 1). trigger wait status start <1> count operation start flow tq0ce bit = 0 count operation is stopped stop <3> count operation stop flow setting of tq0ccr0 to tq0ccr3 registers as rewriting the tq0ccrm register immediately forwards to the ccrm buffer register, rewriting immediately after the generation of the inttq0cc0 signal is recommended. <2> tq0ccr0 to tq0ccr3 register setting change flow remark m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 571 (2) operation timing in one-shot pulse output mode (a) note on rewriti ng tq0ccrm register if the value of the tq0ccr0 register is rewritten to a smaller value duri ng counting, the 16-bit counter may overflow. if there is a possibility of overfl ow, stop counting and then change the set value. d k0 d k1 d 01 d 01 d 00 d k1 d 01 d k0 d k0 d k1 d 00 d 00 ffffh 16-bit counter 0000h tq0ce bit external trigger input (tiq00 pin input) tq0ccr0 register inttq0cc0 signal toq00 pin output (only when software trigger is used) tq0ccrk register inttq0cck signal toq0k pin output delay (d k0 ) active level width (d 00 ? d k0 + 1) active level width (d 01 ? d k1 + 1) active level width (d 01 ? d k1 + 1) delay (d k1 ) delay (10000h + d k1 ) when the tq0ccr0 register is rewritten from d 00 to d 01 and the tq0ccrk register from d k0 to d k1 where d 00 > d 01 and d k0 > d k1 , if the tq0ccrk register is rewritten when the count value of the 16-bit counter is greater than d k1 and less than d k0 and if the tq0ccr0 register is rewritten when the count value is greater than d 01 and less than d 00 , each set value is reflected as soon as the register has been rewritten and compared with the count value. the counter co unts up to ffffh and then counts up again from 0000h. when the count value matches d k1 , the counter generates the inttq0cck signal and asserts the toq0k pin. when the count value matches d 01 , the counter generates the inttq0cc0 signal, deasserts the toq0k pin, and stops counting. therefore, the counter may output a pulse with a delay period or ac tive period different from that of the one-shot pulse that is originally expected. remark m = 0 to 3, k = 1 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 572 (b) generation timing of compare match interrupt request signal (inttq0cck) the generation timing of the inttq0cck signal in the one-shot pulse out put mode is different from other mode inttq0cck signals; the inttq0cck signal is genera ted when the count val ue of the 16-bit counter matches the value of the tq0ccrk register. count clock 16-bit counter tq0ccrk register toq0k pin output inttq0cck signal d k d k ? 2d k ? 1d k d k + 1 d k + 2 usually, the inttq0cck signal is generated when the 16- bit counter counts up next time after its count value matches the value of the tq0ccrk register. in the one-shot pulse output mode, howe ver, it is generated one clock earlier. this is because the timing is changed to match the change timing of the toq0k pin. remark k = 1 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 573 8.6.5 pwm output mode (tq0md 2 to tq0md0 bits = 100) in the pwm output mode, a pwm waveform is output fr om the toq01 to toq03 pi ns when the tq0ctl0.tq0ce bit is set to 1. in addition, a square wave with a duty factor of 50% with the set value of the tq0ccr0 register + 1 as half its cycle is output from the toq00 pin. figure 8-28. configuration in pwm output mode ccr0 buffer register tq0ce bit tq0ccr0 register clear match signal inttq0cc0 signal toq03 pin inttq0cc3 signal toq00 pin note transfer s r tq0ccr1 register ccr1 buffer register match signal toq01 pin inttq0cc1 signal transfer transfer s r tq0ccr3 register ccr3 buffer register match signal transfer toq02 pin inttq0cc2 signal s r tq0ccr2 register ccr2 buffer register match signal 16-bit counter output controller (rs-ff) output controller output controller (rs-ff) output controller (rs-ff) tiq00 pin note (external event count input) internal count clock edge detector count clock selection note because the external event count input pin (tiq 00) and timer output pin (toq00) share the same alternate-function pin, two functions cannot be used at the same time.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 574 figure 8-29. basic timing in pwm output mode d 0 d 1 d 2 d 3 d 1 d 2 d 3 d 0 d 0 d 1 d 2 d 3 d 0 d 1 d 2 d 3 d 0 d 1 d 2 d 3 ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register inttq0cc0 signal toq00 pin output tq0ccr1 register inttq0cc1 signal toq01 pin output tq0ccr2 register inttq0cc2 signal toq02 pin output tq0ccr3 register inttq0cc3 signal toq03 pin output active level width (d 3 ) cycle (d 0 + 1) cycle (d 0 + 1) cycle (d 0 + 1) cycle (d 0 + 1) active level width (d 3 ) active level width (d 3 ) active level width (d 3 ) active level width (d 1 ) active level width (d 1 ) active level width (d 1 ) active level width (d 1 ) active level width (d 2 ) active level width (d 2 ) active level width (d 2 ) active level width (d 2 )
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 575 when the tq0ce bit is set to 1, the 16-bit counter is cleared from ffffh to 0000h, starts counting, and outputs pwm waveform from the toq0k pin. the active level width, cycle, and duty factor of the pwm waveform can be calculated as follows. active level width = (set value of tq0ccrk register ) count clock cycle cycle = (set value of tq0ccr0 register + 1) count clock cycle duty factor = (set value of tq0ccrk regist er)/(set value of tq0ccr0 register + 1) the pwm waveform can be changed by rewriting the tq0ccrm register while the counter is operating. the newly written value is reflected when the count value of the 16-bit counter matches the value of the ccr0 buffer register and the 16-bit counter is cleared to 0000h. the compare match interrupt request signal inttq0cc0 is generated when the 16-bit counter counts next time after its count value matches the value of the ccr0 buffer register, and the 16-bit counter is cleared to 0000h. the compare match interrupt request signal inttq0cck is ge nerated when the count value of the 16-bit counter matches the value of the ccrk buffer register. remark k = 1 to 3, m = 0 to 3 figure 8-30. setting of registers in pwm output mode (1/3) (a) tmq0 control register 0 (tq0ctl0) 0/1 0 0 0 0 tq0ctl0 select count clock note 0: stop counting 1: enable counting 0/1 0/1 0/1 tq0cks2 tq0cks1 tq0cks0 tq0ce note the setting is invalid when the tq0ctl1.tq0eee bit = 1. (b) tmq0 control register 1 (tq0ctl1) 0 0 0/1 0 0 tq0ctl1 100 tq0md2 tq0md1 tq0md0 tq0eee tq0est 1, 0, 0: pwm output mode 0: operate on count clock selected by tq0cks0 to tq0cks2 bits 1: count external event input signal
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 576 figure 8-30. setting of registers in pwm output mode (2/3) (c) tmq0 i/o control register 0 (tq0ioc0) toq0k pin output 16-bit counter ? when tq0olk bit = 0 toq0k pin output 16-bit counter ? when tq0olk bit = 1 0/1 0/1 0/1 0/1 0/1 tq0ioc0 0: disable toq00 pin output 1: enable toq00 pin output setting of toq00 pin output level before count operation 0: low level 1: high level 0: disable toq01 pin output 1: enable toq01 pin output setting of toq01 pin output level before count operation 0: low level 1: high level 0/1 0/1 0/1 note tq0oe1 tq0ol0 tq0oe0 tq0ol1 tq0oe3 tq0ol2 tq0oe2 tq0ol3 setting of toq03 pin output level before count operation 0: low level 1: high level 0: disable toq02 pin output 1: enable toq02 pin output setting of toq02 pin output level before count operation 0: low level 1: high level 0: disable toq03 pin output 1: enable toq03 pin output note clear this bit to 0 when the toq00 pin is not used in the pwm output mode. (d) tmq0 i/o control register 2 (tq0ioc2) 0 0 0 0 0/1 tq0ioc2 select valid edge of external event count input (tiq00 pin). 0/1 0 0 tq0ees0 tq0ets1 tq0ets0 tq0ees1 (e) tmq0 counter read buffer register (tq0cnt) the value of the 16-bit counter can be read by reading the tq0cnt register.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 577 figure 8-30. register setting in pwm output mode (3/3) (f) tmq0 capture/compare register s 0 to 3 (tq0ccr0 to tq0ccr3) if d 0 is set to the tq0ccr0 register and d k to the tq0ccr1 register, the cycle and active level of the pwm waveform are as follows. cycle = (d 0 + 1) count clock cycle active level width = d k count clock cycle remarks 1. tmq0 i/o control register 1 (tq0ioc1) and tmq0 option register 0 (tq0opt0) are not used in the pwm output mode. 2. updating the tmq0 capture/ compare register 2 (tq0ccr2) and tmq0 capture/compare register 3 (tq0ccr3) is validated by writ ing the tmq0 capture/compare register 1 (tq0ccr1).
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 578 (1) operation flow in pwm output mode figure 8-31. software processing flow in pwm output mode (1/2) d 10 d 10 d 10 d 20 d 30 d 00 d 11 d 21 d 01 d 31 d 11 d 21 d 00 d 31 d 20 d 30 d 00 d 21 d 00 d 31 d 11 d 21 d 00 d 31 ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register ccr0 buffer register inttq0cc0 signal toq00 pin output tq0ccr1 register ccr1 buffer register inttq0cc1 signal toq01 pin output tq0ccr2 register ccr2 buffer register inttq0cc2 signal toq02 pin output tq0ccr3 register ccr3 buffer register inttq0cc3 signal toq03 pin output d 00 d 01 d 00 d 00 d 01 d 00 d 10 d 11 d 10 d 10 d 11 d 10 d 11 d 10 d 11 d 11 d 20 d 21 d 20 d 21 d 20 d 21 d 21 d 30 d 31 d 30 d 31 d 30 d 31 d 30 d 31 <1> <2> <3> <4> <5> <6> <7> d 11 d 10 d 20
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 579 figure 8-31. software processing flow in pwm output mode (2/2) start <1> count operation start flow tq0ce bit = 1 register initial setting tq0ctl0 register (tq0cks0 to tq0cks2 bits) tq0ctl1 register, tq0ioc0 register, tq0ioc2 register, tq0ccr0 to tq0ccr3 registers initial setting of these registers is performed before setting the tq0ce bit to 1. only writing of the tq0ccr1 register must be performed when the set duty factor is only changed after writing the tq0ccr2 and tq0ccr3 registers. when the counter is cleared after setting, the value of the tq0ccrm register is transferred to the ccrm buffer register. writing the same value (same as the tq0ccr1 register already set) to the tq0ccr1 register is necessary only when the set duty factor of toq02 and toq03 pin outputs is changed. when the counter is cleared after setting, the value of the tq0ccrm register is transferred to the ccrm buffer register. only writing of the tq0ccr1 register must be performed when the set duty factor is only changed. when counter is cleared after setting, the value of the tq0ccrm register is transferred to the ccrm buffer register. counting is stopped. the tq0cks0 to tq0cks2 bits can be set at the same time when counting is enabled (tq0ce bit = 1). writing of the tq0ccr1 register must be performed after writing the tq0ccr0, tq0ccr2, and tq0ccr3 registers. when the counter is cleared after setting, the value of the tq0ccrm register is transferred to the ccrm buffer registers. writing the same value (same as the tq0ccr1 register already set) to the tq0ccr1 register is necessary only when the set cycle is changed. <2> tq0ccr0 to tq0ccr3 register setting change flow <3> tq0ccr0 register setting change flow <4> tq0ccr1 to tq0ccr3 register setting change flow <5> tq0ccr2, tq0ccr3 register setting change flow <6> tq0ccr1 register setting change flow <7> count operation stop flow tq0ce bit = 0 setting of tq0ccr2, tq0ccr3 registers setting of tq0ccr1 register setting of tq0ccr2, tq0ccr3 registers setting of tq0ccr1 register stop setting of tq0ccr1 register setting of tq0ccr0 register setting of tq0ccr1 register setting of tq0ccr0, tq0ccr2, and tq0ccr3 registers tq0ccr1 register when the counter is cleared after setting, the value of the tq0ccrm register is transferred to the ccrm buffer register. remark m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 580 (2) pwm output mode operation timing (a) changing pulse width during operation to change the pwm waveform while the counter is operating, write the tq0ccr1 register last. rewrite the tq0ccrm register after writing the tq 0ccr1 register after the inttq0cc0 signal is detected. ffffh 16-bit counter 0000h tq0ce bit d 30 d 00 d 01 d 30 d 30 d 20 d 20 d 20 d 21 d 11 d 00 d 00 d 31 d 01 d 01 d 21 d 11 d 31 tq0ccr0 register ccr0 buffer register inttq0cc0 signal tq0ccr1 register ccr1 buffer register inttq0cc1 signal toq01 pin output tq0ccr2 register ccr2 buffer register inttq0cc2 signal toq02 pin output tq0ccr3 register ccr3 buffer register inttq0cc3 signal toq03 pin output toq00 pin output d 10 d 10 d 10 d 00 d 11 d 10 d 11 d 10 d 21 d 20 d 21 d 20 d 31 d 30 d 31 d 30 d 00 d 01
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 581 to transfer data from the tq0ccrm register to the ccr m buffer register, the tq0ccr1 register must be written. to change both the cycle and active level of the pwm waveform at this time, first set the cycle to the tq0ccr0 register, set the active level width to t he tq0ccr2 and tq0ccr3 registers, and then set an active level width to the tq0ccr1 register. to change only the cycle of the pwm waveform, first set the cycle to the tq0ccr0 register, and then write the same value (same as the tq0ccr1 regist er already set) to the tq0ccr1 register. to change only the active level width (duty factor) of pwm wave, first set the active level to the tq0ccr2 and tq0ccr3 registers, and then set an active level to the tq0ccr1 register. to change only the active level width (duty factor) of the pwm waveform output by the toq01 pin, only the tq0ccr1 register has to be set. to change only the active level width (duty factor) of the pwm waveform output by the toq02 and toq03 pins, first set an active level width to the tq0 ccr2 and tq0ccr3 registers, and then write the same value (same as the tq0ccr1 register already set) to the tq0ccr1 register. after the tq0ccr1 register is written, the value wr itten to the tq0ccrm register is transferred to the ccrm buffer register in synchronization with the timi ng of clearing the 16-bit counter, and is used as a value to be compared with the value of the 16-bit counter. to change only the cycle of the pwm waveform, first set a cycle to the tq0ccr0 register, and then write the same value to the tq0ccr1 register. to write the tq0ccr0 to tq0ccr3 registers again afte r writing the tq0ccr1 register once, do so after the inttq0cc0 signal is generated. otherwise, t he value of the ccrm buffer register may become undefined because the timing of transferring data from the tq0ccrm register to the ccrm buffer register conflicts with writing the tq0ccrm register. remark m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 582 (b) 0%/100% output of pwm waveform to output a 0% waveform, set the tq0ccrk register to 0000h. the 16-bit counter is cleared to 0000h and the inttq0cc0 and intq0cck signals are generated at the timing following the clock in which the count value of the 16-bit counter matches the value of the ccr0 buffer register. count clock 16-bit counter tq0ce bit tq0ccr0 register tq0ccrk register inttq0cc0 signal inttq0cck signal toq0k pin output d 0 0000h d 0 0000h d 0 0000h d 0 ? 1d 0 0000 ffff 0000 d 0 ? 1d 0 0000 0001 remark k = 1 to 3 to output a 100% waveform, set a value of (set value of tq0ccr0 register + 1) to the tq0ccrk register. if the set value of the tq0ccr0 register is ffffh, 100% output cannot be produced. count clock 16-bit counter tq0ce bit tq0ccr0 register tq0ccrk register inttq0cc0 signal inttq0cck signal toq0k pin output d 0 d 0 + 1 d 0 d 0 + 1 d 0 d 0 + 1 d 0 ? 1d 0 0000 ffff 0000 d 0 ? 1d 0 0000 0001 l remark k = 1 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 583 (c) generation timing of compare match interrupt request signal (inttq0cck) the timing of generation of the inttq0cck signal in the pwm output mode differs from the timing of other mode inttq0cck signals; the inttq0cck signal is genera ted when the count val ue of the 16-bit counter matches the value of the tq0ccrk register. count clock 16-bit counter ccrk buffer register toq0k pin output inttq0cck signal d k d k ? 2d k ? 1d k d k + 1 d k + 2 remark k = 1 to 3 usually, the inttq0cck signal is generated in synch ronization with the next counting up after the count value of the 16-bit counter matches the value of the tq0ccrk register. in the pwm output mode, however, it is generated one clock earlier. this is because the timing is changed to match the change timing of the output signal of the toq0k pin.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 584 8.6.6 free-running timer mode (t q0md2 to tq0md0 bits = 101) in the free-running timer mode, 16-bit timer/event counter q starts counting when the tq0ctl0.tq0ce bit is set to 1. at this time, the tq0ccrm register can be used as a compare register or a captur e register, depending on the setting of the tq0opt0.tq0ccsm bits. remark m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 585 figure 8-32. configuration in free-running timer mode toq03 pin note 2 toq02 pin note 2 toq01 pin note 2 toq00 pin note 1 inttq0ov signal tq0ccsm bit (capture/compare selection) inttq0cc3 signal inttq0cc2 signal inttq0cc1 signal inttq0cc0 signal tiq03 pin note 2 (capture trigger input) tq0ccr3 register (capture) tiq00pin note 1 (external event count input/ capture trigger input) internal count clock tq0ce bit tiq01 pin note 2 (capture trigger input) tiq02 pin note 2 (capture trigger input) tq0ccr0 register (capture) tq0ccr1 register (capture) tq0ccr2 register (capture) tq0ccr3 register (compare) tq0ccr2 register (compare) tq0ccr1 register (compare) 0 1 0 1 0 1 0 1 16-bit counter tq0ccr0 register (compare) output controller output controller output controller output controller count clock selection edge detector edge detector edge detector edge detector edge detector notes 1. because the external event count input pin (t iq00), capture trigger in put pin (tiq00), and timer output pin (toq00) share the same alternate-function pin, two or more functions cannot be used at the same time. 2. because the capture trigger input pin (tiq0k) and external output pin (toq0k) share the same alternate-function pin, two or more functions c annot be used at the same time (k = 1 to 3).
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 586 ? compare operation when the tq0ce bit is set to 1, 16-bit timer/event co unter q starts counting, an d the output signals of the toq00 to toq03 pins are inverted. when the count value of the 16-bit count er later matches the set value of the tq0ccrm register, a compare match interrupt r equest signal (inttq0ccm) is generated, and the output signal of the toq0m pin is inverted. the 16-bit counter continues counting in synchronization with the count clock. when it counts up to ffffh, it generates an overflow interrupt request signal (inttq0ov) at the next clock, is cleared to 0000h, and continues counting. at this time, the overflow flag (tq0opt0.tq0ovf bit) is also set to 1. confirm that the overflow flag is set to 1 and then clear it to 0 by ex ecuting the clr instruction via software. the tq0ccrm register can be rewritten while the counter is operating. if it is rewritten, the new value is reflected immediately and compared with the count value. remark m = 0 to 3 figure 8-33. basic timing in free-r unning timer mode (compare function) d 10 d 20 d 30 d 00 d 20 d 31 d 31 d 30 d 00 d 11 d 11 d 21 d 01 d 11 d 21 d 01 cleared to 0 by clr instruction cleared to 0 by clr instruction cleared to 0 by clr instruction ffffh 16-bit counter 0000h toq01 pin output tq0ccr2 register inttq0cc2 signal toq02 pin output tq0ccr3 register inttq0cc3 signal toq03 pin output inttq0ov signal tq0ovf bit toq00 pin output tq0ccr1 register inttq0cc1 signal tq0ce bit tq0ccr0 register inttq0cc0 signal d 00 d 01 d 11 d 10 d 21 d 20 d 31 d 30
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 587 ? capture operation when the tq0ce bit is set to 1, the 16-bit counter starts counting. when the valid edge input to the tiq0m pin is detected, the count valu e of the 16-bit counter is stored in t he tq0ccrm register, and a capture interrupt request signal (inttq0ccm) is generated. the 16-bit counter continues counting in synchronization with the count clock. when it counts up to ffffh, it generates an overflow interrupt request signal (inttq0ov) at the next clock, is cleared to 0000h, and continues counting. at this time, the overflow flag ((tq0opt0.tq0ovf bit) is also set to 1. confirm that the overflow flag is set to 1 and then clear it to 0 by ex ecuting the clr instruction via software. remark m = 0 to 3 figure 8-34. basic timing in free-r unning timer mode (capture function) d 20 d 00 d 30 d 10 d 11 d 21 d 31 d 12 d 01 d 02 d 22 d 32 d 03 d 13 d 33 d 23 0000 d 00 d 01 d 02 d 03 0000 d 10 d 11 d 12 d 13 0000 d 20 d 21 d 23 d 22 0000 d 30 d 31 d 32 d 33 cleared to 0 by clr instruction cleared to 0 by clr instruction cleared to 0 by clr instruction ffffh 16-bit counter 0000h tiq02 pin input tq0ccr2 register inttq0cc2 signal tiq03 pin input tq0ccr3 register inttq0cc3 signal inttq0ov signal tq0ovf bit tiq01 pin input tq0ccr1 register inttq0cc1 signal tq0ce bit tiq00 pin input tq0ccr0 register inttq0cc0 signal
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 588 figure 8-35. register setting in free-running timer mode (1/3) (a) tmq0 control register 0 (tq0ctl0) 0/1 0 0 0 0 tq0ctl0 select count clock note 0: stop counting 1: enable counting 0/1 0/1 0/1 tq0cks2 tq0cks1 tq0cks0 tq0ce note the setting is invalid when the tq0ctl1.tq0eee bit = 1 (b) tmq0 control register 1 (tq0ctl1) 0 0 0/1 0 0 tq0ctl1 101 tq0md2 tq0md1 tq0md0 tq0eee tq0est 1, 0, 1: free-running timer mode 0: operate with count clock selected by tq0cks0 to tq0cks2 bits 1: count on external event count input signal (c) tmq0 i/o control register 0 (tq0ioc0) 0/1 0/1 0/1 0/1 0/1 tq0ioc0 0: disable toq00 pin output 1: enable toq00 pin output 0: disable toq01 pin output 1: enable toq01 pin output setting of toq01 pin output level before count operation 0: low level 1: high level 0/1 0/1 0/1 tq0oe1 tq0ol0 tq0oe0 tq0ol1 tq0oe3 tq0ol2 tq0oe2 tq0ol3 setting of toq03 pin output level before count operation 0: low level 1: high level 0: disable toq02 pin output 1: enable toq02 pin output setting of toq02 pin output level before count operation 0: low level 1: high level 0: disable toq03 pin output 1: enable toq03 pin output setting of toq00 pin output level before count operation 0: low level 1: high level
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 589 figure 8-35. register setting in free-running timer mode (2/3) (d) tmq0 i/o control register 1 (tq0ioc1) 0/1 0/1 0/1 0/1 0/1 tq0ioc1 select valid edge of tiq00 pin input note select valid edge of tiq01 pin input 0/1 0/1 0/1 tq0is2 tq0is1 tq0is0 tq0is3 tq0is6 tq0is5 tq0is4 tq0is7 select valid edge of tiq02 pin input select valid edge of tiq03 pin input note set the valid edge selection of the unused alternat e external input signals to ?no edge detection?. (e) tmq0 i/o control register 2 (tq0ioc2) 0 0 0 0 0/1 tq0ioc2 select valid edge of external event count input (tiq00 pin) note 0/1 0 0 tq0ees0 tq0ets1 tq0ets0 tq0ees1 note set the valid edge selection of the unused alternat e external input signals to ?no edge detection?. (f) tmq0 option register 0 (tq0opt0) 0/1 0/1 0/1 0/1 0 tq0opt0 overflow flag specifies if tq0ccr0 register functions as capture or compare register 0: compare register 1: capture register specifies if tq0ccr1 register functions as capture or compare register 0: compare register 1: capture register 0 0 0/1 tq0ccs0 tq0ovf tq0ccs1 tq0ccs2 tq0ccs3 specifies if tq0ccr2 register functions as capture or compare register 0: compare register 1: capture register specifies if tq0ccr3 register functions as capture or compare register 0: compare register 1: capture register
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 590 figure 8-35. register setting in free-running timer mode (3/3) (g) tmq0 counter read buffer register (tq0cnt) the value of the 16-bit counter can be read by reading the tq0cnt register. (h) tmq0 capture/compare regist ers 0 to 3 (tq0ccr0 to tq0ccr3) these registers function as captur e registers or compare registers depending on the setting of the tq0opt0.tq0ccsm bit. when the registers function as captur e registers, they store the count value of the 16-bit counter when the valid edge input to the tiq0m pin is detected. when the registers function as compare registers and when d m is set to the tq0ccrm register, the inttq0ccm signal is generated when the counter reaches (d m + 1), and the output signal of the toq0m pin is inverted. remark m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 591 (1) operation flow in free-running timer mode (a) when using capture/compare register as compare register figure 8-36. software processing flow in fr ee-running timer mode (c ompare function) (1/2) d 10 d 20 d 30 d 00 d 10 d 20 d 30 d 00 d 11 d 31 d 01 d 21 d 21 d 11 d 11 d 31 d 01 d 00 d 10 d 20 d 30 d 01 d 11 d 21 d 31 cleared to 0 by clr instruction cleared to 0 by clr instruction cleared to 0 by clr instruction <3> <1> <2> <2> <2> ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register inttq0cc0 signal toq00 pin output tq0ccr1 register inttq0cc1 signal toq01 pin output tq0ccr2 register inttq0cc2 signal toq02 pin output tq0ccr3 register inttq0cc3 signal toq03 pin output inttq0ov signal tq0ovf bit
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 592 figure 8-36. software processing flow in fr ee-running timer mode (c ompare function) (2/2) tq0ce bit = 1 read tq0opt0 register (check overflow flag). register initial setting tq0ctl0 register (tq0cks0 to tq0cks2 bits) tq0ctl1 register, tq0ioc0 register, tq0ioc2 register, tq0opt0 register, tq0ccr0 to tq0ccr3 registers initial setting of these registers is performed before setting the tq0ce bit to 1. the tq0cks0 to tq0cks2 bits can be set at the same time when counting has been started (tq0ce bit = 1). start execute instruction to clear tq0ovf bit (clr tq0ovf). <1> count operation start flow <2> overflow flag clear flow tq0ce bit = 0 counter is initialized and counting is stopped by clearing tq0ce bit to 0. stop <3> count operation stop flow tq0ovf bit = 1 no yes
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 593 (b) when using capture/compare register as capture register figure 8-37. software processing flow in fr ee-running timer mode (c apture function) (1/2) d 20 d 00 d 30 d 10 d 11 d 21 d 31 d 12 d 01 d 02 d 22 d 32 d 03 d 13 d 33 d 23 0000 d 00 d 01 d 02 d 03 0000 0000 0000 0000 0000 d 10 d 11 d 12 d 13 0000 d 20 d 21 d 23 d 22 0000 d 30 d 31 d 32 d 33 cleared to 0 by clr instruction cleared to 0 by clr instruction cleared to 0 by clr instruction <3> <1> <2> <2> <2> ffffh 16-bit counter 0000h tq0ce bit tiq02 pin input tq0ccr2 register inttq0cc2 signal tiq03 pin input tq0ccr3 register inttq0cc3 signal inttq0ov signal tq0ovf bit tiq01 pin input tq0ccr1 register inttq0cc1 signal tiq00 pin input tq0ccr0 register inttq0cc0 signal
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 594 figure 8-37. software processing flow in fr ee-running timer mode (c apture function) (2/2) tq0ce bit = 1 read tq0opt0 register (check overflow flag). register initial setting tq0ctl0 register (tq0cks0 to tq0cks2 bits) tq0ctl1 register, tq0ioc1 register, tq0opt0 register initial setting of these registers is performed before setting the tq0ce bit to 1. the tq0cks0 to tq0cks2 bits can be set at the same time when counting has been started (tq0ce bit = 1). start execute instruction to clear tq0ovf bit (clr tq0ovf). <1> count operation start flow <2> overflow flag clear flow tq0ce bit = 0 counter is initialized and counting is stopped by clearing tq0ce bit to 0. stop <3> count operation stop flow tq0ovf bit = 1 no yes
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 595 (2) operation timing in free-running timer mode (a) interval operation with compare register when 16-bit timer/event counter q is used as an in terval timer with the tq0ccrm register used as a compare register, software processing is necessary for setting a comparison value to generate the next interrupt request signal each time t he inttq0ccm signal has been detected. remark m = 0 to 3 d 00 d 10 d 20 d 01 d 30 d 12 d 03 d 22 d 31 d 21 d 23 d 02 d 13 ffffh 16-bit counter 0000h tq0ce bit tq0ccr0 register inttq0cc0 signal toq00 pin output tq0ccr1 register inttq0cc1 signal toq01 pin output tq0ccr2 register inttq0cc2 signal toq02 pin output tq0ccr3 register inttq0cc3 signal toq03 pin output interval period (d 00 + 1) interval period (10000h + d 02 ? d 01 ) interval period (d 01 ? d 00 ) interval period (d 03 ? d 02 ) interval period (d 04 ? d 03 ) d 00 d 01 d 02 d 03 d 04 d 05 interval period (d 10 + 1) interval period (10000h + d 12 ? d 11 ) interval period (d 11 ? d 10 ) interval period (d 13 ? d 12 ) d 10 d 11 d 12 d 13 d 14 interval period (d 20 + 1) interval period (10000h + d 21 ? d 20 ) interval period (10000h + d 23 ? d 22 ) interval period (d 22 ? d 21 ) interval period (d 30 + 1) interval period (10000h + d 31 ? d 30 ) d 20 d 21 d 22 d 23 d 31 d 30 d 32 d 04 d 11
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 596 when performing an interval operation in the free-running timer mode, two intervals can be set with one channel. to perform the interval operation, the value of the co rresponding tq0ccrm register must be re-set in the interrupt servicing that is executed when the inttq0ccm signal is detected. the set value for re-setting the tq0ccrm register c an be calculated by the following expression, where ?d m ? is the interval period. compare register default value: d m ? 1 value set to compare register second and subsequent time: previous set value + d m (if the calculation result is greate r than ffffh, subtract 10000h from the result and set this value to the register.) remark m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 597 (b) pulse width measurement with capture register when pulse width measurement is performed with the tq0ccrm register used as a capture register, software processing is necessary for reading the capt ure register each time the inttq0ccm signal has been detected and for calculating an interval. remark m = 0 to 3 d 20 d 00 d 30 d 10 d 11 d 21 d 31 d 12 d 01 d 02 d 32 d 13 d 03 d 22 d 33 d 23 0000 pulse interval (10000h + d 01 ? d 00 ) pulse interval (10000h + d 02 ? d 01 ) pulse interval (10000h + d 03 ? d 02 ) d 00 d 01 d 02 d 03 pulse interval (d 00 + 1) 0000 pulse interval (10000h + d 11 ? d 10 ) pulse interval (10000h + d 12 ? d 11 ) pulse interval (d 13 ? d 12 ) d 10 d 11 d 12 d 13 pulse interval (d 10 + 1) 0000 pulse interval (10000h + d 21 ? d 20 ) pulse interval (20000h + d 22 ? d 21 ) pulse interval (d 23 ? d 22 ) d 20 d 21 d 23 d 22 pulse interval (d 20 + 1) 0000 pulse interval (10000h + d 31 ? d 30 ) pulse interval (10000h + d 32 ? d 31 ) pulse interval (10000h + d 33 ? d 32 ) d 30 d 31 d 32 d 33 pulse interval (d 30 + 1) cleared to 0 by clr instruction cleared to 0 by clr instruction cleared to 0 by clr instruction ffffh 16-bit counter 0000h tq0ce bit tiq00 pin input tq0ccr0 register inttq0cc0 signal tiq02 pin input tq0ccr2 register inttq0cc2 signal tiq03 pin input tq0ccr3 register inttq0cc3 signal inttq0ov signal tq0ovf bit tiq01 pin input tq0ccr1 register inttq0cc1 signal
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 598 when executing pulse width measurement in the fr ee-running timer mode, four pulse widths can be measured with one channel. to measure a pulse width, the pu lse width can be calculated by re ading the value of the tq0ccrm register in synchronization with the inttq0ccm si gnal, and calculatin g the difference between the read value and the previously read value. remark m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 599 (c) processing of overflow when two or more capture registers are used care must be exercised in processing the overflow flag when two capture registers are used. first, an example of incorrect processing is shown below. example of incorrect processing when tw o or more capture registers are used ffffh 16-bit counter 0000h tq0ce bit tiq00 pin input tq0ccr0 register tiq01 pin input tq0ccr1 register inttq0ov signal tq0ovf bit d 00 d 01 d 10 d 11 d 10 <1> <2> <3> <4> d 00 d 11 d 01 the following problem may occur when two pulse widt hs are measured in the free-running timer mode. <1> read the tq0ccr0 register (setting of t he default value of t he tiq00 pin input). <2> read the tq0ccr1 register (setting of t he default value of t he tiq01 pin input). <3> read the tq0ccr0 register. read the overflow flag. if the overflow flag is 1, clear it to 0. because the overflow flag is 1, the pulse width can be calculated by (10000h + d 01 ? d 00 ). <4> read the tq0ccr1 register. read the overflow flag. because the flag is cleared in <3>, 0 is read. because the overflow flag is 0, the pulse width can be calculated by (d 11 ? d 10 ) (incorrect). when two capture registers are used, and if the overflow flag is cleared to 0 by one capture register, the other capture register may not obtain the correct pulse width. use software when using two capture registers. an example of how to use software is shown below.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 600 (1/2) example when two capture registers are used (usi ng overflow interrupt) ffffh 16-bit counter 0000h tq0ce bit inttq0ov signal tq0ovf bit tq0ovf0 flag note tiq00 pin input tq0ccr0 register tq0ovf1 flag note tiq01 pin input tq0ccr1 register d 10 d 11 d 00 d 01 d 10 <1> <2> <5> <6> <3> <4> d 00 d 11 d 01 note the tq0ovf0 and tq0ovf1 flags are set on the internal ram by software. <1> read the tq0ccr0 register (setting of t he default value of t he tiq00 pin input). <2> read the tq0ccr1 register (setting of t he default value of t he tiq01 pin input). <3> an overflow occurs. set the tq0ovf0 and tq0ovf1 flags to 1 in the overflow interrupt servicing, and clear the overflow flag to 0. <4> read the tq0ccr0 register. read the tq0ovf0 flag. if the tq0o vf0 flag is 1, clear it to 0. because the tq0ovf0 flag is 1, the pulse width can be calculated by (10000h + d 01 ? d 00 ). <5> read the tq0ccr1 register. read the tq0ovf1 flag. if the tq0ovf1 flag is 1, clear it to 0 (the tq0ovf0 flag is cleared in <4>, and the tq0ovf1 flag remains 1). because the tq0ovf1 flag is 1, the pulse width can be calculated by (10000h + d 11 ? d 10 ) (correct). <6> same as <3>
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 601 (2/2) example when two capture re gisters are used (without using overflow interrupt) ffffh 16-bit counter 0000h tq0ce bit inttq0ov signal tq0ovf bit tq0ovf0 flag note tiq00 pin input tq0ccr0 register tq0ovf1 flag note tiq01 pin input tq0ccr1 register d 10 d 11 d 00 d 01 d 10 <1> <2> <5> <6> <3> <4> d 00 d 11 d 01 l note the tq0ovf0 and tq0ovf1 flags are set on the internal ram by software. <1> read the tq0ccr0 register (setting of t he default value of t he tiq00 pin input). <2> read the tq0ccr1 register (setting of t he default value of t he tiq01 pin input). <3> an overflow occurs. nothing is done by software. <4> read the tq0ccr0 register. read the overflow flag. if the overflow flag is 1, set only the tq0ovf1 flag to 1, and clear the overflow flag to 0. because the overflow flag is 1, the pulse width can be calculated by (10000h + d 01 ? d 00 ). <5> read the tq0ccr1 register. read the overflow flag. because the overflow flag is cleared in <4>, 0 is read. read the tq0ovf1 flag. if the tq0o vf1 flag is 1, clear it to 0. because the tq0ovf1 flag is 1, the pulse width can be calculated by (10000h + d 11 ? d 10 ) (correct). <6> same as <3>
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 602 (d) processing of overflow if capture trigger interval is long if the pulse width is greater than one cycle of the 16- bit counter, care must be exercised because an overflow may occur more than once from the first captur e trigger to the next. first, an example of incorrect processing is shown below. example of incorrect processing when capture trigger interval is long ffffh 16-bit counter 0000h tq0ce bit tiq0m pin input tq0ccrm register inttq0ov signal tq0ovf bit d m0 d m1 d m0 d m1 <1> <2> <3> <4> 1 cycle of 16-bit counter pulse width the following problem may occur when a long pulse width in the free-running timer mode. <1> read the tq0ccrm register (setting of t he default value of the tiq0m pin input). <2> an overflow occurs. nothing is done by software. <3> an overflow occurs a second time. nothing is done by software. <4> read the tq0ccrm register. read the overflow flag. if the overflow flag is 1, clear it to 0. because the overflow flag is 1, the pul se width can be calculated by (10000h + d m1 ? d m0 ) (incorrect). actually, the pulse width must be (20000h + d m1 ? d m0 ) because an overflow occurs twice. remark m = 0 to 3 if an overflow occurs twice or more when the capture tr igger interval is long, the correct pulse width may not be obtained. if the capture trigger interval is long, slow the count clock to lengthen one cycle of the 16-bit counter, or use software. an example of how to use software is shown next.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 603 example when capture trigger interval is long ffffh 16-bit counter 0000h tq0ce bit tiq0m pin input tq0ccrm register inttq0ov signal tq0ovf bit overflow counter note d m0 d m1 1h 0h 2h 0h d m0 d m1 <1> <2> <3> <4> 1 cycle of 16-bit counter pulse width note the overflow counter is set arbitrarily by software on the internal ram. <1> read the tq0ccrm register (setting of t he default value of the tiq0m pin input). <2> an overflow occurs. increment the overflow count er and clear the overflow flag to 0 in the overflow interrupt servicing. <3> an overflow occurs a second time. increment (+1) the overflow counter and clear the overflow flag to 0 in the overflow interrupt servicing. <4> read the tq0ccrm register. read the overflow counter. when the overflow counter is ?n?, t he pulse width can be calculated by (n 10000h + d m1 ? d m0 ). in this example, the pulse width is (20000h + d m1 ? d m0 ) because an overflow occurs twice. clear the overflow counter (0h). remark m = 0 to 3 (e) clearing overflow flag the overflow flag can be cleared to 0 by clearing th e tq0ovf bit to 0 with t he clr instruction after reading tq0ovf bit = 1 and by writing 8-bit data (bit 0 is 0) to the tq0opt 0 register after reading tq0ovf bit = 1.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 604 (3) note on capture operation if the capture operation is used and if a slow clock is selected as the count clock, ffffh, not 0000h, may be captured to the tq0ccrm register, or the capture operation may not be performed (capture interrupt does not occur) if the capture trigger is input immediately a fter the tq0ctl0.tq0ce bit is set to 1 (m = 0 to 3). the same operation results during the period in which no external event counts are input while the capture operation is used and an external event count input is used as a count clock. count clock 0000h ffffh tq0ce bit tq0ccr0 register ffffh 0001h 0000h tiq00 pin input capture trigger input 16-bit counter sampling clock capture trigger input
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 605 8.6.7 pulse width measurement mode (tq0md2 to tq0md0 bits = 110) in the pulse width measurement mode, 16-bit timer/even t counter q starts counting when the tq0ctl0.tq0ce bit is set to 1. each time the valid edge input to the tiq0m pi n has been detected, t he count value of t he 16-bit counter is stored in the tq0ccrm register, and the 16-bit counter is cleared to 0000h. the interval of the valid edge can be measured by reading the tq0ccrm register after a capture interrupt request signal (inttq0ccm) occurs. in case of figure 8-39, select either of the tiq00 to tiq03 pins as the capture trigger input pin. specify ?no edge detected? by using the tq0ioc1 register for the unused pins. remark m = 0 to 3 k = 1 to 3 figure 8-38. configuration in pulse width measurement mode inttq0ov signal inttq0cc0 signal inttq0cc1 signal inttq0cc2 signal inttq0cc3 signal tiq03 pin (capture trigger input) tq0ccr3 register (capture) tiq00 pin (capture trigger input) tq0ce bit tiq01 pin (capture trigger input) tiq02 pin (capture trigger input) tq0ccr0 register (capture) tq0ccr1 register (capture) tq0ccr2 register (capture) 16-bit counter clear edge detector edge detector edge detector edge detector count clock selection caution in the pulse width measurement mode, select the internal clock (set the tq0ctl1.tq0eee bit = 0) as the count clock.
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 606 figure 8-39. basic timing in pulse width measurement mode ffffh 16-bit counter 0000h tq0ce bit tiq0m pin input tq0ccrm register inttq0ccm signal inttq0ov signal tq0ovf bit d 0 0000h d 1 d 2 d 3 cleared to 0 by clr instruction remark m = 0 to 3 when the tq0ce bit is set to 1, the 16-bit counter starts c ounting. when the valid edge input to the tiq0m pin is later detected, the count value of the 16-bit counter is stored in the tq0ccrm register, the 16-bit counter is cleared to 0000h, and a capture interrupt request signal (inttq0ccm) is generated. the pulse width is calculated as follows. pulse width = captured value count clock cycle if the valid edge is not input to the tiq0m pin even when the 16-bit counter coun ted up to ffffh, an overflow interrupt request signal (inttq0ov) is generated at the next c ount clock, and the counter is cleared to 0000h and continues counting. at this time, the overflow flag (tq0opt0.t q0ovf bit) is also set to 1. clear the overflow flag to 0 by executing the clr instruction via software. if the overflow flag is set to 1, the pu lse width can be calculated as follows. pulse width = (10000h tq0ovf bit set (1) count + captured value) count clock cycle remark m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 607 figure 8-40. register setting in pu lse width measurement mode (1/2) (a) tmq0 control register 0 (tq0ctl0) 0/1 0 0 0 0 tq0ctl0 select count clock 0: stop counting 1: enable counting 0/1 0/1 0/1 tq0cks2 tq0cks1 tq0cks0 tq0ce (b) tmq0 control register 1 (tq0ctl1) 00000 tq0ctl1 110 tq0md2 tq0md1 tq0md0 tq0eee tq0est 1, 1, 0: pulse width measurement mode 0: operate with count clock selected by tq0cks0 to tq0cks2 bits (c) tmq0 i/o control register 1 (tq0ioc1) 0/1 0/1 0/1 0/1 0/1 tq0ioc1 select valid edge of tiq00 pin input select valid edge of tiq01 pin input 0/1 0/1 0/1 tq0is2 tq0is1 tq0is0 tq0is3 tq0is6 tq0is5 tq0is4 tq0is7 select valid edge of tiq02 pin input select valid edge of tiq03 pin input
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 608 figure 8-40. register setting in pu lse width measurement mode (2/2) (d) tmq0 option register 0 (tq0opt0) 00000 tq0opt0 overflow flag 0 0 0/1 tq0ccs0 tq0ovf tq0ccs1 tq0ccs2 tq0ccs3 (e) tmq0 counter read buffer register (tq0cnt) the value of the 16-bit counter can be read by reading the tq0cnt register. (f) tmq0 capture/compare register s 0 to 3 (tq0ccr0 to tq0ccr3) these registers store the count va lue of the 16-bit counter when the valid edge input to the tiq0m pin is detected. remarks 1. tmq0 i/o control register 0 (tq0ioc0) and tmq0 i/o control register 2 (tq0ioc2) are not used in the pulse width measurement mode. 2. m = 0 to 3
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 609 (1) operation flow in pul se width measurement mode figure 8-41. software processing flow in pulse width measurement mode tq0ce bit = 1 tq0ce bit = 0 register initial setting tq0ctl0 register (tq0cks0 to tq0cks2 bits), tq0ctl1 register, tq0ioc1 register, tq0opt0 register initial setting of these registers is performed before setting the tq0ce bit to 1. the tq0cks0 to tq0cks2 bits can be set at the same time when counting has been started (tq0ce bit = 1). the counter is initialized and counting is stopped by clearing the tq0ce bit to 0. start stop <1> count operation start flow <2> count operation stop flow <1> <2> ffffh 16-bit counter 0000h tq0ce bit tiq00 pin input tq0ccr0 register inttq0cc0 signal d 0 0000h 0000h d 1 d 2
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 610 (2) operation timing in pul se width measurement mode (a) clearing overflow flag the overflow flag can be cleared to 0 by clearing th e tq0ovf bit to 0 with t he clr instruction after reading the tq0ovf bit when it is 1 and by writing 8-bi t data (bit 0 is 0) to t he tq0opt0 register after reading the tq0ovf bit when it is 1. (3) note if a slow clock is selected as the count clock, ffffh , not 0000h, may be captured to the tq0ccrm register, or the capture operation may not be per formed (capture interrupt does not occu r) if the capture trigger is input immediately after the tq0ctl0.tq0ce bit is set to 1 (m = 0 to 3). 0000h ffffh ffffh 0002h 0000h capture trigger input capture trigger input count clock tq0ce bit tq0ccr0 register tiq00 pin input 16-bit counter sampling clock 8.7 selector function for the selector functions, see 7.7 selector function .
chapter 8 16-bit timer/event counter q (tmq) user?s manual u19201ej3v0ud 611 8.8 cautions (1) switching of dma transfer start factor in the v850e/sj3-h and v850e/sk3-h, the inttq0ov and intub0tir signals, which are the dma transfer start factors, share the same pin, and they cannot be used at the same time. to use the inttq0ov signal as the dma transfer start factor, set the dtfrob0 bit of the option byte 0000007ah to 0 (refer to chapter 33 option byte function ). in this case, the intub0tir signal cannot be used as the dma transfer start factor. remark for details, see table 22-1 dma transfer start factors . (2) using tiq0m pin and krn pin at the same time the tiq0m pin and the krn pin cannot be used at the same time (m = 0 to 3, n = 0 to 3). although the tiq00/kr3 pin and the tiq03/kr2 pin are assigned to two di fferent ports each, the pins cannot be used at the same time at different ports. the following shows the settings when the tiq0 m pin is used and when the krn pin is used. pin name when used as tiq0m pin when used as krn pin kr0/tiq01 krm.krm0 bit = 0 tq0ioc1.tq0is3, tq0is2 bits = 00 kr1/tiq02 krm.krm1 bit = 0 tq0ioc1.tq0is5, tq0is4 bits = 00 kr2/tiq03 krm.krm2 bit = 0 tq0ioc1.tq0is7, tq0is6 bits = 00 kr3/tiq00 krm.krm3 bit = 0 tq0ioc1.tq0is1, tq0is0 bits = 00 tq0ioc2.tq0ees1, tq0ees0 bits = 00 tq0ioc2.tq0ets1, tq0ets0 bits = 00
user?s manual u19201ej3v0ud 612 chapter 9 16-bit interval timer m (tmm) timer m (tmm) is a 16-bit interval timer. the v850e/sj3-h and v850e/sk3-h incorporate tmm0 to tmm2. 9.1 overview the tmmn has the following functions (n = 0 to 2). ? interval function ? 8 clocks selectable ? 16-bit counter 1 (the 16-bit counter cannot be read during timer count operation.) ? compare register 1 (the compare register cannot be written during timer counter operation.) ? compare match interrupt 1 timer m supports only the clear & start mode. the free-running timer mode is not supported.
chapter 9 16-bit interval timer m (tmm) user?s manual u19201ej3v0ud 613 9.2 configuration tmmn includes the following hardware (n = 0 to 2). table 9-1. configuration of tmmn item configuration timer register 16-bit counter register tmmn compare register 0 (tmncmp0) control register tmmn control register 0 (tmnctl0) remark n = 0 to 2 figure 9-1. block diagram of tmm0 tm0ctl0 internal bus f xp f xp /2 f xp /4 f xp /64 f xp /512 intwt f r /8 f xt controller 16-bit counter match clear inttm0eq0 tm0cmp0 tm0ce tm0cks2 tm0cks1tm0cks0 selector remark f xp : peripheral clock frequency (prescaler 1 input clock frequency). in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clocks f r : internal oscillation clock frequency f xt : subclock frequency intwt: watch timer interrupt request signal
chapter 9 16-bit interval timer m (tmm) user?s manual u19201ej3v0ud 614 figure 9-2. block diagram of tmm1 and tmm2 tmmctl0 internal bus f xp f xp /2 f xp /4 f xp /64 f xp /512 f brg f r /8 inttmaeq0 controller 16-bit counter match clear inttmmeq0 tmmcmp0 tmmce tmmcks2tmmcks1 tmmcks0 selector remarks 1. f xp : peripheral clock frequency (prescaler 1 input clock frequency). in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clocks f brg : watch count clock frequency f r : internal oscillation clock frequency inttmneq0: tmmn compare match interrupt request signal 2. m = 1, 2 when m = 1, a = 0 when m = 2, a = 1 n = 0 to 2 (1) 16-bit counter this is a 16-bit counter that counts the internal clock. the 16-bit counter cannot be read or written. (2) tmmn compare register 0 (tmncmp0) the tmncmp0 register is a 16-bit compare register. this register can be read or written in 16-bit units. reset sets this register to 0000h. the same value can always be written to the tmncmp0 register by software. during the tmmn operation (tmnctl0.tmnce bit = 1), rewriting the tmncmp0 register is prohibited. tmncmp0 (n = 0 to 2) 12 10 8 6 4 2 after reset: 0000h r/w address: tm0cmp0 fffff694h, tm1cmp0 fffff6a4h, tm2cmp0 fffff6b4h 14 0 13 11 9 7 5 3 15 1
chapter 9 16-bit interval timer m (tmm) user?s manual u19201ej3v0ud 615 9.3 register (1) tmmn control register 0 (tmnctl0) the tmnctl0 register is an 8-bit regist er that controls the tmmn operation. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. the same value can always be written to the tmnctl0 register by software. tmnce tmmn operation disabled (16-bit counter reset asynchronously). operation clock application stopped. tmmn operation enabled. operation clock application started. tmmn operation started. tmnce 0 1 internal clock operation enable/disable specification tmnctl0 (n = 0 to 2) 0 0 0 0 tmncks2 tmncks1 tmncks0 654321 after reset: 00h r/w address: the internal clock control and internal circuit reset for tmmn are performed asynchronously with the tmnce bit. when the tmnce bit is cleared to 0, the internal clock of tmmn is disabled (fixed to low level) and 16-bit counter is reset asynchronously. <7> 0 f xp f xp /2 f xp /4 f xp /64 f xp /512 intwt f r /8 f xt f xp f xp /2 f xp /4 f xp /64 f xp /512 f brg f r /8 inttm0eq0 f xp f xp /2 f xp /4 f xp /64 f xp /512 f brg f r /8 inttm1eq0 0 0 0 0 1 1 1 1 count clock selection 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 tm0ctl0 fffff690h, tm1ctl0 fffff6a0h tm2ctl0 fffff6b0h tmncks2 tmm0 tmm1 tmm2 tmncks1 tmncks0 cautions 1. set the tmncks2 to tmncks0 bits when tmnce bit = 0. when changing the value of tmnce from 0 to 1, it is not possible to set the value of the tmncks2 to tm ncks0 bits simultaneously. 2. be sure to clear bits 3 to 6 to ?0?. remarks 1. f xp : peripheral clock frequency (prescaler 1 input clock frequency). in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clocks f brg : watch count clock frequency f r : internal oscillation clock frequency f xt : subclock frequency inttmaeq0: tmma compare match interrupt request signal 2. a = 0, 1
chapter 9 16-bit interval timer m (tmm) user?s manual u19201ej3v0ud 616 9.4 operation caution do not set the tmncmp0 register to ffffh. 9.4.1 interval timer mode in the interval timer mode, an interr upt request signal (inttmneq0) is gener ated at the specified interval by the tmncmp0 register if the tmnctl0.tmnce bit is set to 1. figure 9-3. configuration of interval timer 16-bit counter tmncmp0 register tmnce bit count clock selection clear match signal inttmneq0 signal figure 9-4. basic timing of operation in interval timer mode d 0 d 0 d 0 d 0 d 0 interval (d 0 + 2) interval (d 0 + 1) interval (d 0 + 1) interval (d 0 + 1) ffffh 16-bit counter 0000h tmnce bit tmncmp0 register inttmneq0 signal when the tmnce bit is set to 1, the value of the 16-bit counter is cleared from ffffh to 0000h in synchronization with the count clock, and the c ounter starts counting. when the count value of the 16-bit counter matches the value of the tmncmp0 register, the 16-bit counter is cleared to 0000h and a compare match interrupt request signal (inttmneq0) is generated. the interval can be calculated by the following expression. interval = (set value of tmncmp0 register + 1) count clock cycle
chapter 9 16-bit interval timer m (tmm) user?s manual u19201ej3v0ud 617 figure 9-5. register setting for interval timer mode operation (a) tmmn control register 0 (tmnctl0) 0/1 0 0 0 0 tmnctl0 0/1 0/1 0/1 tmncks2 tmncks1 tmncks0 tmnce 0: stop counting 1: enable counting select count clock (b) tmmn compare register 0 (tmncmp0) if the tmncmp0 register is set to d 0 , the interval is as follows. interval = (d 0 + 1) count clock cycle
chapter 9 16-bit interval timer m (tmm) user?s manual u19201ej3v0ud 618 (1) interval timer mode operation flow figure 9-6. software processing flow in interval timer mode tmnce bit = 1 tmnce bit = 0 register initial setting tmnctl0 register (tmncks0 to tmncks2 bits) tmncmp0 register initial setting of these registers is performed before setting the tmnce bit to 1. setting the tmncks0 to tmncks2 bits is prohibited at the same time when counting has been started (tmnce bit = 1). the counter is initialized and counting is stopped by clearing the tmnce bit to 0. start stop <1> count operation start flow <2> count operation stop flow <1> <2> d 0 d 0 d 0 d 0 ffffh 16-bit counter 0000h tmnce bit tmncmp0 register inttmneq0 signal
chapter 9 16-bit interval timer m (tmm) user?s manual u19201ej3v0ud 619 (2) interval timer mode operation timing caution do not set the tmncmp0 register to ffffh. (a) operation if tmncmp0 register is set to 0000h if the tmncmp0 register is set to 0000h, the inttm neq0 signal is generated at each count clock. the value of the 16-bit counter is always 0000h. count clock 16-bit counter tmnce bit tmncmp0 register inttmneq0 signal 0000h ffffh 0000h 0000h 0000h 0000h interval time count clock cycle 2 interval time count clock cycle interval time count clock cycle (b) operation if tmncmp0 register is set to n if the tmncmp0 register is set to n, the 16-bit counter counts up to n. the counter is cleared to 0000h in synchronization with the next count-up timing and the inttmneq0 signal is generated. ffffh 16-bit counter 0000h tmnce bit tmncmp0 register inttmneq0 signal n interval time (n + 2) count clock cycle interval time (n + 1) count clock cycle interval time (n + 1) count clock cycle n remark 0000h < n < ffffh
chapter 9 16-bit interval timer m (tmm) user?s manual u19201ej3v0ud 620 9.4.2 cautions (1) maximum time before counting start it takes the 16-bit counter up to the following time to start counting after the tmnctl0.tmnce bit is set to 1, depending on the count clock selected. selected count clock maximum time before counting start f xp 2/f xp f xp /2 3/f xp f xp /4 6/f xp f xp /64 128/f xp f xp /512 1024/f xp intwt second rising edge of intwt signal f r /8 16/f r f xt 2/f xt f brg 2/f brg inttm0eq0 second rising edge of inttm0eq0 signal inttm1eq0 second rising edge of inttm1eq0 signal remarks 1. f xp : peripheral clock frequency (prescaler 1 input clock frequency). in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clocks f brg : watch count clock frequency f r : internal oscillation clock frequency f xt : subclock frequency inttmaeq0: tmma compare match interrupt request signal 2. a = 0, 1 (2) caution on setting the tmncmp0 and tmnctl0 registers rewriting the tmncmp0 and tmnctl0 register s is prohibited while tmmn is operating. if these registers are rewritten while the tmnc e bit is 1, the operation cannot be guaranteed. if they are rewritten by mistake, clear the tm nctl0.tmnce bit to 0, and re-set the registers. (3) caution for the interval timer mode do not set the tmncmp0 register to ffffh. (4) switching dma transfer start factor in the v850e/sj3-h and v850e/sk3-h, the inttm1eq0 and intkr signals and the inttm2eq0 and intp8 signals, which are the dma transfer start factors, respecti vely share the same pin, and they cannot be used at the same time. to use inttm1eq0 or inttm2eq0 signa l as the dam transfer start factor, set the dtfrob0 bit of the option byte 0000007ah to 1. (refer to chapter 33 option byte function .) in this case, the intkr and intp8 signals cannot be used as the dma transfer start factor. remark for details, see table 22-1 dma transfer start factors .
user?s manual u19201ej3v0ud 621 chapter 10 watch functions this chapter explains prescaler 3, watch timer, and real-time counter (rtc). for timer m, refer to chapter 9 16- bit interval timer m (tmm) . 10.1 overview the v850e/sj3-h and v850e/sk3-h realizes a watch function in the following four ways. (1) watch timer this timer generates an interrupt request signal (intwt) at an interval of 0.5 or 0.25 seconds by using the main oscillation clock (f x ) or subclock (f xt ). when the main oscillation clock (f x ) is used as the count clock, its frequency is divided by a prescaler 3 to 32.768 khz. (2) watch timer + timer m0 (tmm0) the main oscillation clock (f x ) is divided by prescaler 3, watch timer, and tmm0 and an interrupt request signal (inttm0eq0) is generated at an interval of 0.5 or 0.25 seconds. the frequency of 32.768 khz is not necessary, and the watch function can be rea lized by using the main oscillation clock (f x ) of any frequency. (3) real-time counter (rtc) this counter can count up to 99 y ears, having a year, month, week, day, hour, minute, and second counters and a subcounter. the count value of the year, month, week, day, hour, minute, and second counters is indicated in bcd code note . in addition, an alarm interrupt signal (i ntrtc1) that generates an interrupt at any week, hour, and minute, and a periodic interrupt signal (intrtc0) of 1 month to 0. 5 seconds are supported. as the count clock, the main oscillation clock (f x ) or subclock (f xt ) can be used. when the main oscillation clock (f x ) is used as the count clock, its frequency is divided by prescaler 3 to 32.768 khz. (4) timer m1 or time r m2 (tmm1 or tmm2) the main oscillation clock (f x ) is divided by prescaler 3 and tmm1 or tmm2 and an interrupt request signal (inttmneq0) is generated at a time interval of 0.5 or 0.25 seconds. the fr equency of 32.768 khz is not necessary, and the watch function can be realized by the main oscillation clock (f x ) of any frequency. note bcd (binary coded decimal) code expresses the va lue of each digit of a decimal number in 4-bit binary number. remarks 1. (1) and (2) above are compatible with the v850es/sg3 and v850es/sj3. 2. when the main oscillation clock (f x ) is used as the count clock, the idle2 mode is used as the standby mode to lower the current consumption. in the idle2 m ode, the main oscillation cock (f x ) continues, so that the watch function c an continue even in the standby mode. 3. n = 1 or 2
chapter 10 watch functions user?s manual u19201ej3v0ud 622 10.2 configuration the block diagram of the watch function is shown below. figure 10-1. block diagram of watch function watch timer f brg f x prescaler 3 f xt rtc year, month, week, day, hour, minute, and second counters and subcounter intwt intrtc0 intrtc1 inttm1eq0 inttm2eq0 inttm0eq0 tmm1 tmm2 tmm0 remarks 1. f x : main oscillation clock frequency f brg : watch count clock frequency f xt : subclock frequency intwt: watch timer interrupt request signal intrtc0: periodic interrupt request signal of r eal-time counter (period: 1 month to 0.5 seconds) intrtc1: alarm interrupt request signal of real-time counter inttmmeq0: tmmm compare match interrupt request signal intwti: interval timer interrupt request signal intrtc2: interval interrupt request signal of real-time counter 2. m = 0 to 2
chapter 10 watch functions user?s manual u19201ej3v0ud 623 10.3 prescaler 3 10.3.1 function this prescaler generates a count clock (32.768 khz) of th e watch timer or real-time counter by dividing the main oscillation clock (f x ). it is also used in combination with tmm1 or tmm2, or with the watch timer and tmm0 to generate an interrupt request signal (inttmmeq0) of a time inte rval of 0.5 to 0.25 seconds which is necessary for the watch function, from the main oscillation clock (f x ) of any frequency (m = 0 to 2). 10.3.2 configuration the block diagram of prescaler 3 is shown below. figure 10-2. block di agram of prescaler 3 f brg f x f x /8 f x /4 f x /2 f x bgcs00 bgcs01 bgce0 3-bit prescaler 8-bit counter clear match f bgcs prsm0 register prscm0 register 1/2 2 internal bus clock control selector remark f x : main oscillation clock frequency f bgcs : watch source clock frequency f brg : watch count clock frequency (1) clock control this circuit controls supplying and stopping of the main oscillation clock (f x ). (2) 3-bit prescaler this is a prescaler that divides f x and generates f x /2, f x /4, or f x /8. (3) 8-bit counter this is an 8-bit counter that counts the watch source clock (f bgcs ). (4) prscm0 register this is an 8-bit compare register that sets the interval time of f brg . (5) prsm0 register this register is used to control clock supply to the watch timer and select a watch source clock (f bgcs ).
chapter 10 watch functions user?s manual u19201ej3v0ud 624 10.3.3 registers the following registers are provided for the prescaler 3. ? prescaler mode register 0 (prsm0) ? prescaler compare register 0 (prscm0) (1) prescaler mode register 0 (prsm0) the prsm0 register controls the generat ion of the watch timer count clock. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 prsm0 0 0 bgce0 0 0 bgcs01 bgcs00 disabled enabled bgce0 0 1 main clock operation enable f x f x /2 f x /4 f x /8 5 mhz 200 ns 400 ns 800 ns 1.6 s 4 mhz 250 ns 500 ns 1 s 2 s bgcs01 0 0 1 1 bgcs00 0 1 0 1 selection of watch source clock (f bgcs ) after reset: 00h r/w address: fffff8b0h < > cautions 1. do not chan ge the values of the bgcs 00 and bgcs01 bits during watch timer operation. 2. set the prsm0 register befo re setting the bgce0 bit to 1. 3. to realize the watch function by the watch timer or the real-time counter (rtc), set the prsm0 a nd prscm0 registers according to the main oscillation clock frequency (f x ) to be used so as to obtain an f brg frequency of 32.768 khz. 4. be sure to set bits 2, 3, and 5 to 7 to ??0??.
chapter 10 watch functions user?s manual u19201ej3v0ud 625 (2) prescaler compare register 0 (prscm0) the prscm0 register is an 8-bit compare register. this register can be read or written in 8-bit units. reset sets this register to 00h. prscm07 prscm0 prscm06 prscm05 prscm04 prscm03 prscm02 prscm01 prscm00 after reset: 00h r/w address: fffff8b1h cautions 1. do not rewrite the prscm0 register during watc h timer operation. 2. set the prscm0 register before setting the prsm0.bgce0 bit to 1. 3. to realize the watch function by the watch timer or the real-time counter (rtc), set the prsm0 a nd prscm0 registers according to the main oscillation clock frequency (f x ) to be used so as to obtain an f brg frequency of 32.768 khz. the calculation for f brg is shown below. f brg = f bgcs /2n remark f bgcs : watch source clock set by the prsm0 register n: set value of prscm0 register = 1 to 256 however, n = 256 only when prscm0 register is set to 00h. example when f x = 3.997696 mhz n = 61 (set value of prscm0 register = 3dh) f bgcs = f x = 3.997696 mhz (set value of prsm0 register = 10h) f brg = 3.997696/(2 61) = 32.768 [khz]
chapter 10 watch functions user?s manual u19201ej3v0ud 626 10.4 watch timer functions 10.4.1 functions the watch timer has the following functions. ? watch timer: an interrupt request signal (intwt) is gene rated at intervals of 0.5 or 0.25 seconds by using the main oscillation clock (f x ) or subclock (f xt ). ? interval timer: an interrupt request sig nal (intwti) is generated at set intervals. the watch timer and interval timer functions can be used at the same time. 10.4.2 configuration the block diagram of the watch timer is shown below. figure 10-3. block diagram of watch timer internal bus watch timer operation mode register (wtm) f brg f w /2 4 f w /2 5 f w /2 6 f w /2 7 f w /2 8 f w /2 10 f w /2 11 f w /2 9 f xt 11-bit prescaler clear clear intwt intwti wtm0 wtm1 wtm2 wtm3 wtm4 wtm5 wtm6 wtm7 5-bit counter f w 3 f x prescaler 3 selector selector selector selector remark f x : main oscillation clock frequency f brg : watch count clock frequency f xt : subclock frequency f w : watch timer clock frequency intwt: watch timer interrupt request signal intwti: interval timer interrupt request signal
chapter 10 watch functions user?s manual u19201ej3v0ud 627 (1) 11-bit prescaler this prescaler divides f w to generate a clock of f w /2 4 to f w /2 11 . (2) 5-bit counter this counter counts f w or f w /2 9 , and generates a watch timer interrupt request signal at intervals of 2 4 /f w , 2 5 /f w , 2 13 /f w , or 2 14 /f w . (3) selector the watch timer has the following four selectors. ? selector that selects the main oscillation clock (f x ) or subclock (f xt ) as the clock of the watch timer ? selector that selects f w or f w /2 9 as the count clock frequency of the 5-bit counter ? selector that selects 2 4 /f w , 2 13 /f w , 2 5 /f w , or 2 14 /f w as the intwt signal generation time interval ? selector that selects 2 4 /f w to 2 11 /f w as the interval timer interrupt re quest signal (intwti) generation time interval (4) wtm register this is an 8-bit register that contro ls the operation of the watch timer/in terval timer, and sets the interrupt request signal generation interval.
chapter 10 watch functions user?s manual u19201ej3v0ud 628 10.4.3 control registers the following registers are provided for the watch timer. ? watch timer operation mode register (wtm) ? prescaler mode register 0 (prsm0) ? prescaler compare register 0 (prscm0) (1) watch timer operation mode register (wtm) the wtm register enables or di sables the count clock and operation of t he watch timer, sets the interval time of the prescaler, controls the operat ion of the 5-bit counter, and sets the set time of the watch flag. set the prsm0 register before setting the wtm register. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. (1/2) wtm7 2 4 /f w (488 s: f w = f xt ) 2 5 /f w (977 s: f w = f xt ) 2 6 /f w (1.95 ms: f w = f xt ) 2 7 /f w (3.91 ms: f w = f xt ) 2 8 /f w (7.81 ms: f w = f xt ) 2 9 /f w (15.6 ms: f w = f xt ) 2 10 /f w (31.3 ms: f w = f xt ) 2 11 /f w (62.5 ms: f w = f xt ) 2 4 /f w (488 s: f w = f brg ) 2 5 /f w (977 s: f w = f brg ) 2 6 /f w (1.95 ms: f w = f brg ) 2 7 /f w (3.91 ms: f w = f brg ) 2 8 /f w (7.81 ms: f w = f brg ) 2 9 /f w (15.6 ms: f w = f brg ) 2 10 /f w (31.3 ms: f w = f brg ) 2 11 /f w (62.5 ms: f w = f brg ) wtm7 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 wtm6 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 selection of interval time of prescaler wtm wtm6 wtm5 wtm4 wtm3 wtm2 wtm1 wtm0 wtm5 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 wtm4 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 after reset: 00h r/w address: fffff680h < > < >
chapter 10 watch functions user?s manual u19201ej3v0ud 629 (2/2) 2 14 /f w (0.5 s: f w = f xt ) 2 13 /f w (0.25 s: f w = f xt ) 2 5 /f w (977 s: f w = f xt ) 2 4 /f w (488 s: f w = f xt ) 2 14 /f w (0.5 s: f w = f brg ) 2 13 /f w (0.25 s: f w = f brg ) 2 5 /f w (977 s: f w = f brg ) 2 4 /f w (488 s: f w = f brg ) wtm7 0 0 0 0 1 1 1 1 selection of set time of watch flag clears after operation stops starts wtm1 0 1 control of 5-bit counter operation wtm3 0 0 1 1 0 0 1 1 wtm2 0 1 0 1 0 1 0 1 stops operation (clears both prescaler and 5-bit counter) enables operation wtm0 0 1 watch timer operation enable caution rewrite the wtm2 to wtm7 bits wh ile both the wtm0 and wtm1 bits are 0. remarks 1. f w : watch timer clock frequency 2. values in parentheses apply to operation with f w = 32.768 khz (2) prescaler mode register 0 (prsm0) for details, refer to 10.3.3 (1) prescaler mode register 0 (prsm0) . (3) prescaler compare register 0 (prscm0) for details, refer to 10.3.3 (2) prescaler comp are register 0 (prscm0) .
chapter 10 watch functions user?s manual u19201ej3v0ud 630 10.4.4 operation (1) operation as watch timer the watch timer generates an interrupt request signal (i ntwt) at fixed time intervals. the watch timer operates using time intervals of 0. 25 or 0.5 seconds with the subclock (f xt ) (32.768 khz) or main oscillation clock (f x ). the count operation starts when the wtm.wtm1 and wtm.wtm0 bits are set to 11. when the wtm0 bit is cleared to 0, the 11-bit prescaler and 5-bit co unter are cleared and the count operation stops. the time of the watch timer can be adjusted by clearin g the wtm1 bit to 0 and then the 5-bit counter when operating at the same time as the interval timer. at this time, an error of up to 15.6 ms may occur for the watch timer, but the interval timer is not affected. if the main oscillation clock (f x ) is used as the count clock of the watc h timer, set the count clock using the prsm0.bgcs01 and bgcs00 bits, the 8-bit comparison value using the prscm0 register, and the count clock frequency (f brg ) of the watch timer to 32.768 khz. when the prsm0.bgce0 bit is set (1), f brg is supplied to the watch timer. (2) operation as interval timer the watch timer can also be used as an interval timer that repeatedly generates an interrupt request signal (intwti) at intervals specifie d by a preset count value. the interval time can be selected by the wtm.wtm4 to wtm7 bits. table 10-1. interval ti me of interval timer wtm7 wtm6 wtm5 wtm4 interval time 0 0 0 0 2 4 1/fw 488 s (operating at f w = f xt = 32.768 khz) 0 0 0 1 2 5 1/fw 977 s (operating at f w = f xt = 32.768 khz) 0 0 1 0 2 6 1/fw 1.95 ms (operating at f w = f xt = 32.768 khz) 0 0 1 1 2 7 1/fw 3.91 ms (operating at f w = f xt = 32.768 khz) 0 1 0 0 2 8 1/fw 7.81 ms (operating at f w = f xt = 32.768 khz) 0 1 0 1 2 9 1/fw 15.6 ms (operating at f w = f xt = 32.768 khz) 0 1 1 0 2 10 1/fw 31.3 ms (operating at f w = f xt = 32.768 khz) 0 1 1 1 2 11 1/fw 62.5 ms (operating at f w = f xt = 32.768 khz) 1 0 0 0 2 4 1/fw 488 s (operating at f w = f brg = 32.768 khz) 1 0 0 1 2 5 1/fw 977 s (operating at f w = f brg = 32.768 khz) 1 0 1 0 2 6 1/fw 1.95 ms (operating at f w = f brg = 32.768 khz) 1 0 1 1 2 7 1/fw 3.91 ms (operating at f w = f brg = 32.768 khz) 1 1 0 0 2 8 1/fw 7.81 ms (operating at f w = f brg = 32.768 khz) 1 1 0 1 2 9 1/fw 15.6 ms (operating at f w = f brg = 32.768 khz) 1 1 1 0 2 10 1/fw 31.3 ms (operating at f w = f brg = 32.768 khz) 1 1 1 1 2 11 1/fw 62.5 ms (operating at f w = f brg = 32.768 khz) remark f w : watch timer clock frequency
chapter 10 watch functions user?s manual u19201ej3v0ud 631 figure 10-4. operation timing of watch timer/interval timer start overflow overflow 0h interrupt time of watch timer (0.5 s) interrupt time of watch timer (0.5 s) interval time (t) interval time (t) nt nt 5-bit counter count clock f w or f w /2 9 watch timer interrupt intwt interval timer interrupt intwti remarks 1. when 0.5 seconds of the watch timer interrupt time is set. 2. f w : watch timer clock frequency values in parentheses apply to operation with f w = 32.768 khz. n: number of interval timer operations (3) cautions some time is required before the first watch timer inte rrupt request signal (intwt) is generated after operation is enabled (wtm.wtm1 and wtm.wtm0 bits = 1). figure 10-5. example of generation of watc h timer interrupt request signal (intwt) (when interrupt cycle = 0.5 s) it takes 0.515625 seconds (max.) for the first intwt signal to be generated (2 9 1/32768 = 0.015625 seconds longer (max.)). the intwt signal is then generated every 0.5 seconds. 0.5 s 0.5 s 0.515625 s wtm0, wtm1 intwt
chapter 10 watch functions user?s manual u19201ej3v0ud 632 10.5 real-time counter (rtc) 10.5.1 function the real-time counter (rtc) has the following functions. ? has year, month, week, day, hour, minute, and second co unters and a subcounter, and can count up to 99 years. ? the value of the year, month, week, day, hour, mi nute, and second counters is indicated in bcd code note 1 . ? alarm interrupt function ? periodic interrupt function (period: 1 month to 0.5 s) ? interval interrupt function (period: 1.95 ms to 125 ms) ? pin output function of 1 hz ? pin output function of 32.768 khz ? pin output function of 512 hz or 16.384 khz ? watch error correction function ? subclock operation or main clock operation note 2 selectable notes 1. bcd (binary coded decimal) code expresses the val ue of each digit of a decimal number as a 4-bit binary number. 2. divide the main clock to 32.768 khz by using the dedi cated baud rate generator of the real-time counter.
chapter 10 watch functions user?s manual u19201ej3v0ud 633 10.5.2 configuration the real-time counter consists of the following hardware units. table 10-2. configuration of real-time counter item configuration control registers real-time counter control register 0 (rc1cc0) real-time counter control register 1 (rc1cc1) real-time counter control register 2 (rc1cc2) real-time counter control register 3 (rc1cc3) subcount register (rc1subc) second count register (rc1sec) minute count register (rc1min) hour count register (rc1hour) day count register (rc1day) week count register (rc1week) month count register (rc1month) year count register (rc1year) watch error correction register (rc1subu) alarm minute setting register (rc1alm) alarm hour setting register (rc1alh) alarm week setting register (rc1alw)
chapter 10 watch functions user?s manual u19201ej3v0ud 634 figure 10-6. block diagra m of real-time counter count enable/disable sub-counter (16-bit) second counter (7-bit) second counter write buffer minute counter write buffer hour counter write buffer day counter write buffer week counter write buffer minute counter (7-bit) hour counter (6-bit) day counter (6-bit) week counter (3-bit) intrtc0 intrtc1 1 minute 1 hour 1 day 1 month count clock = 32.768 khz f xt f rtc /2 6 f rtc /2 f rtc /2 6 f rtc /2 7 f rtc /2 8 f rtc /2 9 f rtc /2 10 f rtc /2 11 f rtc /2 12 f brg month counter write buffer year counter write buffer month counter (5-bit) year counter (8-bit) minute alarm ict2 to ict0 bit hour alarm week alarm 12-bit counter ckdiv bit rinte bit intrtc2 rc1ckdiv cloe2 bit rc1cko cloe0 bit rc1ck1hz cloe1 bit prescaler 3 f x selector selector selector selector f rtc remark f brg : watch count clock frequency f xt : subclock frequency intrtc0: periodic interrupt request signal of real-time counter intrtc1: alarm interrupt request signal of real-time counter intrtc2: interval interrupt request signal of real-time counter
chapter 10 watch functions user?s manual u19201ej3v0ud 635 (1) pin configuration the rtc output pins constituting the real-time co unter are alternate-function pins, as shown in table 10-3 . to use each of these pins, its port f unction must be set (refer to table 4-25 using port pin as alternate- function pin ). table 10-3. pin configuration pin no. v850e/sj3-h v850e/sk3-h port rtc output other alternate function 59 71 p80 rc1ck1hz rxda3/intp8 60 72 p81 rc1ckdiv txda3/rc1cko 60 72 p81 rc1cko txda3/rc1ckdiv (2) interrupt function the rtc has the following three ty pes of interrupt request signals. (a) intrtc0 this is a periodic interrupt request signal that is generated once every 0.5 sec ond, 1 second, 1 minute, 1 hour, 1 day, or 1 month. (b) intrtc1 alarm interrupt request signal (c) intrtc2 this is an interval interrupt request signal of a period of f rtc /2 6 , f rtc /2 7 , f rtc /2 8 , f rtc /2 9 , f rtc /2 10 , f rtc /2 11 , or f rtc /2 12 .
chapter 10 watch functions user?s manual u19201ej3v0ud 636 10.5.3 registers the real-time counter is controlled by the following 16 types of registers. (1) real-time counter cont rol register 0 (rc1cc0) this register is used to select the input clock of the real-time counter. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. rc1pwr stops real-time counter operation. enables real-time counter operation. rc1pwr 0 1 control of real-time counter operation rc1cc0 rc1cks 0 0 0 0 0 0 654321 selects f xt as operating clock. selects f brg as operating clock. rc1cks 0 1 selection of operating clock 0 <7> after reset: 00h r/w address: fffffaddh cautions 1. stop the real-time counter (rc1pwr bit = 1 0) during operation as described in 10.5.4 (8) init ializing real-time counter. 2. the rc1cks bit can be rewritten only when the operation of the real- time counter is stopped (rc1pwr bi t = 0). rewriting the rc1cks bit as soon as setting the rc1pwr bit from ?0? to ?1? is prohibited. 3. be sure to set bits 0 to 5 to ?0?. (2) real-time counter cont rol register 1 (rc1cc1) this is an 8-bit register that starts or stops t he operation of the real-t ime counter, controls the rc1cko/rc1ck1hz pin, select the 12-hour or 24-hour sys tem, and sets the function of the periodic interrupt function. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h.
chapter 10 watch functions user?s manual u19201ej3v0ud 637 rtce stops counter operation. enables counter operation. rcte 0 1 control of operation of each counter rc1cc1 0 cloe1 cloe0 ampm ct2 ct1 ct0 6 <5> <4> <3> 2 1 disables output by rc1ck1hz pin (1 hz). enables output by rc1ck1hz pin (1 hz). cloe1 0 1 output control of rc1ck1hz pin disables output by rc1cko pin (32.768 khz) enables output by rc1cko pin (32.768 khz) cloe0 0 1 output control of rc1cko pin 12-hour display (a.m./p.m. indicated) 24-hour display ampm 0 1 selection of 12- or 24-hour system 0 <7> after reset: 00h r/w address: fffffadeh periodic interrupt is not used. once every 0.5 second (as soon as second counter is up) once every 1 second (as soon as second counter is up) once every 1 minute (00 second at every minute) once every 1 hour (00 minute 00 second at every hour) once every 1 day (00 hour 00 minute 00 second at every day) once every 1 month (00 hour 00 minute 00 second in the morning of the first day of every month) ct2 0 0 0 0 1 1 1 selection of periodic interrupt (intrtc0) ct1 0 0 1 1 0 0 1 ct0 0 1 0 1 0 1 cautions 1. writing ?0? to the rtce bi t is prohibited while the rtce bit = 1. clear (0) the rtce bit by cleari ng (0) the rc1pwr bit as described in 10.5.4 (8) initializing real-time counter. 2. the rc1ck1hz output pin operates as follows when the setting of the cloe1 bit is changed. ? if cloe1 bit is changed from 0 to 1: rc1ck1hz outputs a pulse of 1 hz after up to 2 clocks. ? if cloe1 bit is changed from 1 to 0: rc1ck1hz output is stopped after up to 2 clocks (fi xed to low level). 3. for how to set or change th e ampm bit, refer to 10.5.4 (1) initialization and 10.5.4 (2) re writing each counter during clock operation. when the ampm bit h as been rewritten, re-set the rc1hour register. 4. to rewrite the ct2 to ct0 bits while the real-time counter is operating (rc1pwr bit = 1), refer to 10.5.4 (4) changing setting of intrtc0 interrupt during clock operation. 5. be sure to set bit 6 to ?0?.
chapter 10 watch functions user?s manual u19201ej3v0ud 638 (3) real-time counter cont rol register 2 (rc1cc2) this is an 8-bit register that is used to control the al arm interrupt function and the wait state of the counter. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. wale does not generate interrupt when alarm matches. generates interrupt when alarm matches. wale 0 1 control of operation of alarm interrupt (intrtc1) rc1cc2 0000 0 rwst rwait 65432<1> counter is operating. counting up of the second to year counters is stopped (reading or writing the count value is enabled). rwst 0 1 wait state of real-time counter this is a status flag that indicates whether the rwait bit can be set. before reading or writing a count value, be sure to confirm that the rwst bit is 1. sets counter operation. stops counting operation of second to year counters (mode to read or write count value). rwait 0 1 wait control of real-time counter this bit controls the operation of the counter. be sure to write ? 1 ? to this bit when the count value is to be read or written. if an overflow occurs in the rc1subc register while the rwait bit is ? 1 ? , the overflow information is internally retained, ? 0 ? is written to the rwait bit, and the rc1sec register is counted up after up to 2 clocks. if the value of the second counter is rewritten when the rwait bit = 1, the overflow information that has been retained is discarded. 0 <7> after reset: 00h r/w address: fffffadfh cautions 1. to rewrite the wale bit wh ile the real-time counter is operating (rc1cc0.rc1pwr bit = 1), refer to 10.5.4 (5) changing setting of intrtc1 interrupt during clock operation. 2. to read or write the value of each counter, confirm that the rwst bit is 1. 3. even if the rwait bit is set to ?0 ?, the rwst bit is not set to 0 while each counter is being rewr itten. it is set to 0 after writing of each counter has been completed. 4. be sure to set bits 2 to 6 to ?0?.
chapter 10 watch functions user?s manual u19201ej3v0ud 639 (4) real-time counter cont rol register 3 (rc1cc3) this is an 8-bit register that is used to control t he interval interrupt function and the rc1ckdiv pin. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. rinte interval interrupt is not generated. interval interrupt is generated. rinte 0 1 control of interval interrupt (intrtc2) rc1cc3 cloe2 ckdiv 0 0 ict2 ict1 ict0 654321 output by rc1ckdiv pin is disabled. output by rc1ckdiv pin is enabled. cloe2 0 1 output control of rc1ckdiv pin rc1ckdiv pin outputs 512 hz (1.95 ms). rc1ckdiv pin outputs 16.384 khz (0.061 ms). ckdiv 0 1 selection of output frequency of rc1ckdiv pin 0 7 after reset: 00h r/w address: fffffae0h 2 6 /f rtc (1.953125 ms) 2 7 /f rtc (3.90625 ms) 2 8 /f rtc (7.8125 ms) 2 9 /f rtc (15.625 ms) 2 10 /f rtc (31.25 ms) 2 11 /f rtc (62.5 ms) 2 12 /f rtc (125 ms) ict2 0 0 0 0 1 1 1 selection of interval interrupt (intrtc2) ict1 0 0 1 1 0 0 1 ict0 0 1 0 1 0 1 cautions 1. to rewrite the rinte bit wh ile the real-time counter is operating (rcc1cc0.rc1pwr bit = 1), refer to 10.5.4 (7) changing setting of intrtc2 interrupt during clock operation. 2. the rc1ckdiv output pin operates as follows when the setting of the cloe2 bit is changed. ? when cloe2 bit is changed from 0 to 1: the pulse set by the ckdiv bit is output after up to 2 clocks. ? when cloe2 bit is changed from 1 to 0: output by the rc1ckdiv pin is stopped after up to 2 clocks (fixed to low level). 3. to rewrite the ict2 to ict0 bi ts while the real-time counter is operating (rc1pwr bit = 1), refer to 10.5.4 (7) changing setting of intrtc2 interrupt during clock operation. 4. be sure to set bits 3 and 4 to ?0?.
chapter 10 watch functions user?s manual u19201ej3v0ud 640 (5) subcount regi ster (rc1subc) this is a 16-bit register that counts the referenc e time of 1 second of the real-time counter. the value of this register ranges from 0000h to 7fffh and the regi ster counts 1 second with a clock of 32.768 khz. this register can only be read in 16-bit units. reset sets this register to 0000h. cautions 1. the value of this register may reach or exceed 8000h if the time is corrected by using the rc1subu register. 2. the rc1subc register is also clear ed by writing the second count register. 3. the value of the rc1subc register is not guaranteed if it is read during operation because a value that is changing is read. rc1subc 12 1 08 6 42 after reset: 0000h r address: fffffad0h 14 0 1 3 11 9 7 53 1 5 1 (6) second count register (rc1sec) this is an 8-bit register that indicates the count val ue of seconds in a range of 0 to 59 (decimal number). it counts up when an overflow occurs from the subcounter. if a value is written to this register, it is written to a buffer and then to the counter after up to 2 clocks (32.768 khz). set a value of 00 to 59 (decimal number) to this register in bcd code. this register can be read or written in 8-bit units. reset sets this register to 00h. caution setting values other than 00 to 59 to the rc1sec register is prohibited. remark be sure to read or write the rc1sec register by referring to 10.5.4 (1) initialization , 10.5.4 (2) rewriting each counter during clock operation , and 10.5.4 (3) reading each counter during clock operation . 0 rc1sec after reset: 00h r/w address: fffffad2h
chapter 10 watch functions user?s manual u19201ej3v0ud 641 (7) minute count register (rc1min) this is an 8-bit register that indicates the count val ue of minutes in a range of 0 to 59 (decimal number). it counts up when an overflow occurs from the second counter. if a value is written to this register, it is written to a buffer and then to the counter after up to 2 clocks (32.768 khz). set a value of 00 to 59 (decimal number) to this register in bcd code. this register can be read or written in 8-bit units. reset sets this register to 00h. caution setting a value other than 00 to 59 to the rc1min register is prohibited. remark be sure to read or write the rc1min register by referring to 10.5.4 (1) initialization , 10.5.4 (2) rewriting each counter during clock operation , and 10.5.4 (3) reading each counter during clock operation . 0 rc1min after reset: 00h r/w address: fffffad3h (8) hour count register (rc1hour) this is an 8-bit register that indica tes the count value of hours in a ran ge of 0 to 23, or 1 to 12 (decimal number). it counts up when an overflow occurs from the minute counter. if a value is written to this register, it is written to a buffer and then to the counter after up to 2 clocks (32.768 khz). set a value of 00 to 23, 01 to 12, or 21 to 32 (decimal number) to this register in bcd code. this register can be read or written in 8-bit units. reset sets this register to 12h. however, it is set to 00h if t he rc1cc1.ampm bit is set to 1. cautions 1. bit 5 of the rc1hour register indicates am (0) or pm (1) when the rc1cc1.ampm bit = 0 (12-hour system). 2. setting a value other than 01 to 12, 21 to 32 (ampm bit = 0) or 00 to 23 (ampm bit = 1) to the rc1hour register is prohibited. remark be sure to read or write the rc1hour register by referring to 10.5.4 (1) initialization , 10.5.4 (2) rewriting each counter during clock operation , and 10.5.4 (3) reading each counter during clock operation . 00 rc1hour after reset: 12h r/w address: fffffad4h
chapter 10 watch functions user?s manual u19201ej3v0ud 642 the relationship in time between the set value of the rc1cc1.ampm bit and the value of the rc1hour register is shown in table 10-4. table 10-4. time digit indication 12-hour system (ampm bit = 0) 24-hour system (ampm bit = 1) time value of rc1hour register time value of rc1hour register 0 o?clock am 12h 0 o?clock 00h 1 o?clock am 01h 1 o?clock 01h 2 o?clock am 02h 2 o?clock 02h 3 o?clock am 03h 3 o?clock 03h 4 o?clock am 04h 4 o?clock 04h 5 o?clock am 05h 5 o?clock 05h 6 o?clock am 06h 6 o?clock 06h 7 o?clock am 07h 7 o?clock 07h 8 o?clock am 08h 8 o?clock 08h 9 o?clock am 09h 9 o?clock 09h 10 o?clock am 10h 10 o?clock 10h 11 o?clock am 11h 11 o?clock 11h 0 o?clock pm 32h 12 o?clock 12h 1 o?clock pm 21h 13 o?clock 13h 2 o?clock pm 22h 14 o?clock 14h 3 o?clock pm 23h 15 o?clock 15h 4 o?clock pm 24h 16 o?clock 16h 5 o?clock pm 25h 17 o?clock 17h 6 o?clock pm 26h 18 o?clock 18h 7 o?clock pm 27h 19 o?clock 19h 8 o?clock pm 28h 20 o?clock 20h 9 o?clock pm 29h 21 o?clock 21h 10 o?clock pm 30h 22 o?clock 22h 11 o?clock pm 31h 23 o?clock 23h the value of the rc1hour register is indicated in the 12-hour system when the ampm bit is ?0? and in the 24-hour system when it is ?1?. in the 12-hour system, the fifth bit of rchour indi cates am when it is 0 or pm when it is 1.
chapter 10 watch functions user?s manual u19201ej3v0ud 643 (9) day count register (rc1day) this is an 8-bit register that indicates the count va lue of days in a range of 1 to 31 (decimal number). it counts up when an overflow occurs from the hour counter. the counter counts up as follows. ? 01 to 31 (january, march, may, july, august, october, december) ? 01 to 30 (april, june, september, november) ? 01 to 29 (february of leap year) ? 01 to 28 (february of normal year) if a value is written to this counter, it is written to a buffer and then to the counter after up to 2 clocks (32.768 khz). set a value of 01 to 31 (decimal number) to this register in bcd code. this register can be read or written in 8-bit units. reset sets this register to 01h. caution setting a value other than 01 to 31 to the rc1day register is prohibited. in addition, setting outside the above count range, such as ?february 30?, is prohibited. remark be sure to read or write the rc1day register by referring to 10.5.4 (1) initialization , 10.5.4 (2) rewriting each counter during clock operation , and 10.5.4 (3) reading each counter during clock operation . 00 rc1day after reset: 01h r/w address: fffffad6h
chapter 10 watch functions user?s manual u19201ej3v0ud 644 (10) week count register (rc1week) this is an 8-bit register that indicates the count va lue of weeks in a range of 0 to 6 (decimal number). it counts up in synchronization with the day counter. if a value is written to this register, it is written to a buffer and then to the counter after up to 2 clocks (32.768 khz). set a value of 00 to 06 (decimal number) to this register in bcd code. this register can be read or written in 8-bit units. reset sets this register to 00h. 00000 rc1week after reset: 00h r/w address: fffffad5h cautions 1. setting a value other than 00 to 06 to the rc1week register is prohibited. 2. a value corresponding to the month count regi ster and day count register is not always stored automatically in the week count register. be sure to set the week count regi ster as follows after reset release. day of week week sunday 00h monday 01h tuesday 02h wednesday 03h thursday 04h friday 05h saturday 06h remark be sure to read or write the rc1week register by referring to 10.5.4 (1) initialization , 10.5.4 (2) rewriting each counter during clock operation , and 10.5.4 (3) reading each counter during clock operation .
chapter 10 watch functions user?s manual u19201ej3v0ud 645 (11) month count register (rc1month) this is an 8-bit register that indicates the count val ue of months in a range of 0 to 12 (decimal number). it counts up when an overflow occurs from the day counter. if a value is written to this register, it is written to a buffer and then to the counter after up to 2 clocks (32.768 khz). set a value of 01 to 12 (decimal number) to this register in bcd code. this register can be read or written in 8-bit units. reset sets this register to 01h. caution setting a value other than 01 to 12 to the rc1month register is prohibited. remark be sure to read or write the rc1month register by referring to 10.5.4 (1) initialization , 10.5.4 (2) rewriting each counter during clock operation , and 10.5.4 (3) reading each counter during clock operation . 000 rc1month after reset: 01h r/w address: fffffad7h (12) year count re gister (rc1year) this is an 8-bit register that indicates the count va lue of years in a range of 0 to 99 (decimal number). it counts up when an overflow occurs from the month counter. leap years are set as 00, 04, 08, ?, 92, and 96. if a value is written to this register, it is written to a buffer and then to the counter after up to 2 clocks (32.768 khz). set a value of 00 to 99 (decimal number) to this register in bcd code. this register can be read or written in 8-bit units. reset sets this register to 00h. caution setting a value other than 00 to 99 to the rc1year register is prohibited. remark be sure to read or write the rc1year register by referring to 10.5.4 (1) initialization , 10.5.4 (2) rewriting each counter during clock operation , and 10.5.4 (3) reading each counter during clock operation . rc1year after reset: 00h r/w address: fffffad8h
chapter 10 watch functions user?s manual u19201ej3v0ud 646 (13) watch error correction register (rc1subu) this register can correct the advance or delay of t he watch with a high precision by changing the value (reference value: 7fffh) that overflow s from the subcount register (rsu bc) to the second count register. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. remarks 1. the rc1subu register can be rewritten only when the real-time counter is initialized. be sure to refer to 10.5.4 (1) initialization . 2. for watch error correction, refer to 10.5.4 (9) example of correcti ng watch error of real-time counter . dev corrects watch error when the value of rc1sec (second counter) is 00, 20, or 40 (every 20 seconds). corrects watch error when the value of rc1sec (second counter) is 00 (every 60 seconds). dev 0 1 setting of timing of correcting watch error rc1subu f6 f5 f4 f3 f2 f1 f0 654321 increments the count value of rc1subc by a value set by the f5 to f0 bits (positive correction). increment calculation expression: (set value of f5 to f0 bits ? 1) 2 decrements the count value of rc1subc by a value set by the f5 to f0 bits (negative correction). decrement calculation expression: (reverse value of set value of f5 to f0 bits + 1) 2 f6 0 1 setting of watch error correction value the watch error is not corrected when the value of the f6 to f0 bits is {1/0, 0, 0, 0, 0, 0, 1/0}. 0 7 after reset: 00h r/w address: fffffad9h
chapter 10 watch functions user?s manual u19201ej3v0ud 647 (14) alarm minute setting register (rc1alm) this register sets the minutes of alarm. this register can be read or written in 8-bit units. reset sets this register to 00h. cautions 1. set a bcd code of 00 to 59 (decimal number) to this regist er. if a value other than this range is set, the alarm is not detected. 2. to rewrite the rc1alm register while the real-time counter is operating (rc1cc0.rc1pwr bit = 1), re fer to 10.5.4 (5) changing se tting of intrtc1 interrupt during clock operation. 0 rc1alm after reset: 00h r/w address: fffffadah (15) alarm hour setting register (rc1alh) this register sets the hours of alarm. this register can be read or written in 8-bit units. reset sets this register to 12h. cautions 1. set a bcd code of 00 to 23, 01 to 12, or 21 to 32 (decimal number) to this register. if a value other than this range is set, the alarm is not detected. 2. bit 5 of the rc1alh regi ster indicates am (0) or pm (1) if the ampm bit = 0 (12-hour system). 3. to rewrite the rc1alh register wh ile the real-time c ounter is operating (rc1cc0.rc1pwr bit = 1), re fer to 10.5.4 (5) changing se tting of intrtc1 interrupt during clock operation. 00 rc1alh after reset: 12h r/w address: fffffadbh
chapter 10 watch functions user?s manual u19201ej3v0ud 648 (16) alarm week setting register (rc1alw) this register sets the weeks of alarm. this register can be read or written in 8-bit units. reset sets this register to 00h. caution to rewrite the rc1alw register while th e real-time counter is operating (rc1cc0.rc1pwr bit = 1), refer to 10.5.4 (5) ch anging setting of intrtc1 inte rrupt during clock operation. 0 rc1alw6 rc1alw5 rc1alw4 rc1alw3 rc1alw2 rc1alw1 rc1alw0 rc1alw after reset: 00h r/w address: fffffadch does not generate an alarm interrupt when rc1week register = nh. generates an alarm interrupt when rc1week register = nh (time set by rc1alm and rc1alh registers). rc1alwn 0 1 alarm interrupt week setting bit (n = 0 to 6) (a) example of setting alarm interrupt (example of setting rc1alm, rc1alh, and rc1alw registers) tables 10-5 and 10-6 show an example of setti ng where rc1week register = 00h for sundays, rc1week register = 01h for mondays, rc1week regi ster = 02h for tuesdays, and rc1week register = 06h for saturdays. table 10-5. example of setting alarm when rc1cc1.am pm bit = 0 (in 12-hour system of rc1hour register) register alarm setting time rc1alw rc1alh rc1alm am 7:00, sunday 01h 07h 00h pm 12:15, sunday and monday 03h 32h 15h pm 5:30, monday, tuesday, and friday 26h 25h 30h pm 10:45, every day 7fh 30h 45h table 10-6. example of setting alarm when rc1cc1.am pm bit = 1 (in 24-hour system of rc1hour register) register alarm setting time rc1alw rc1alh rc1alm am 7:00, sunday 01h 07h 00h pm 12:15, sunday and monday 03h 12h 15h 17:30, monday, tuesday, and friday 26h 17h 30h 22:45, every day 7fh 22h 45h
chapter 10 watch functions user?s manual u19201ej3v0ud 649 10.5.4 operation (1) initialization initialization should be executed when the watch function or periodic interrupt operation is to be performed. figure 10-7. initialization procedure setting ampm and ct2 to ct0 bits (rc1cc1) rtce bit = 0 (rc1cc1) start intrtc = 1? setting to stop counter operation selecting 12-hour or 24-hour system and interrupt (intrtc0) setting rc1pwr bit (rc1cc0) enabling the internal clock operation of the real-time counter (rtc) setting of each count register setting rc1subu register setting to correct watch error setting rc1cks bit (rc1cc0) selecting the operating clock of the real-time counter (rtc) no yes clearing if flag of interrupt clearing interrupt request flag (rtc0if) clearing mk flag of interrupt clearing interrupt mask flag (rtc0mk) rtce bit = 1 (rc1cc1) setting to start counter operation reading counter setting rc1sec register (clearing rc1subc register) setting rc1min register setting rc1hour register setting rc1week register setting rc1day register setting rc1month register setting rc1year register
chapter 10 watch functions user?s manual u19201ej3v0ud 650 (2) rewriting each counter during clock operation make the following setting to rewrite each count er (rc1sec, rc1min, rc1hour, rc1week, rc1day, rc1month, or rc1year regist er) during clock operation (rc1cc0.rc1pwr bit = 1). figure 10-8. rewriting each counter during clock operation start rwait bit = 1 (rc1cc2) setting to stop rc1sec to rc1year counters counter value writing mode setting ampm bit (rc1cc1) writing rc1sec register writing rc1min register writing rc1hour register writing rc1week register writing rc1day register writing rc1month register writing rc1year register writing to each count register selecting indication mode of the watch counter rwait bit = 0 (rc1cc2) setting to operate rc1sec to rc1year counter rwst bit = 0? (rc1cc2) no yes checking the wait status of the counter checking if the previous writing to the rc1sec to rc1year counters has been completed end rwst bit = 1? note (rc1cc2) no yes note be sure to confirm that the rwst bit = 0 before entering the stop mode. caution clear the rwait bit to 0 within 1 second. if the rwait bit = 1, the rc 1sec to rc1year registers stop operation. if the first carry occurs from the rc1subc register while the rwait bit = 1, it is internally retained. if the second carry or those that fo llow occur, however, the numbe r of times the carry has occurred cannot be retained. remark the rc1sec, rc1min, rc1hour, rc 1week, rc1day, rc1month, and rc1year registers can be rewritten in any order. all the registers do not have to be set and on ly some of the registers may be rewritten.
chapter 10 watch functions user?s manual u19201ej3v0ud 651 (3) reading each counter during clock operation read each counter (rc1sec, rc1min, rc1hour , rc1week, rc1day, rc1month, or rc1year register) during clock operation (rc1cc0.rc1pwr bit = 1) as follows. figure 10-9. reading each c ounter during clock operation start rwait bit = 1 (rc1cc2) setting to stop rc1sec to rc1year counters mode to read counter value rwait bit = 0 enabling operation of rc1sec to rc1year counters rwst bit = 0? (rc1cc2) no yes checking wait status of counter checking if the previous writing to the rc1sec to rc1year counters has been completed end rwst bit = 1? note (rc1cc2) no yes reading rc1sec register reading rc1min register reading rc1hour register reading rc1week register reading rc1day register reading rc1month register reading rc1year register reading each count register note be sure to confirm that the rwst bit = 0 before entering the stop mode. caution clear the rwait bit to 0 within 1 second. if the rwait bit = 1, the rc 1sec to rc1year registers stop operation. if the first carry occurs from the rc1subc register while the rwait bit = 1, it is internally retained. if the second carry or those that fo llow occur, however, the numbe r of times the carry has occurred cannot be retained. remark the rc1sec, rc1min, rc1hour, rc 1week, rc1day, rc1month, and rc1year registers can be read in any order. all the registers do not have to be set and only some of the registers may be read.
chapter 10 watch functions user?s manual u19201ej3v0ud 652 (4) changing setting of intrtc0 interrupt during clock operation if the setting of the intrtc0 interrupt (periodic interrupt ) is changed during the clock operation of the real-time counter (rc1cc0.rc1pwr bit = 1), a whisker may be generated on the waveform of the intrct0 interrupt and an unintended signal may be output. to mask the wh isker, change the setting of the intrtc0 interrupt request signal as follows during clock operation (rc1pwr bit = 1). figure 10-10. changing setting of intr tc0 interrupt during clock operation start setting rtc0mk bit (rtc0ic) setting to mask interrupt request signal (intrtc0) setting ct2 to ct0 bits (rc1cc1) changing setting of interrupt request signal (intrtc0) end clearing rtc0if flag (rtc0ic) clearing interrupt request flag clearing rtc0mk flag (rtc0ic) unmasking interrupt request signal (intrtc0) remark for details of the rtc0if and rtc0mk bits, refer to 24.3.4 interrupt control register (xxicn) .
chapter 10 watch functions user?s manual u19201ej3v0ud 653 (5) changing setting of intrtc1 interrupt during clock operation if the setting of the intrtc1 interrupt (alarm interrupt) is changed during the clock operation of the real-time counter (rc1cc0.rc1pwr bit = 1), a whisker may be generated on the waveform of the intrct1 interrupt and an unintended signal may be output. to mask the wh isker, change the setting of the intrtc1 interrupt request signal as follows during clock operation (rc1pwr bit = 1). figure 10-11. changing setting of intr tc1 interrupt during clock operation start setting rtc1mk bit (rtc1ic) setting to mask interrupt request signal (intrtc1) wale bit = 0 (rc1cc2) disabling alarm interrupt wale bit = 1 (rc1cc2) enabling alarm interrupt end clearing rtc1if flag (rtc1ic) clearing interrupt pending bit setting rc1alm register setting rc1alh register setting rc1alw register setting of alarm ? minute ? register setting of alarm ? hour ? register setting of alarm ? week ? register clearing rtc1mk flag (rtc1ic) unmasking interrupt request signal (intrtc1) remark for details of the rtc1if and rtc1mk bits, refer to 24.3.4 interrupt control register (xxicn) .
chapter 10 watch functions user?s manual u19201ej3v0ud 654 (6) initial setting of intrtc2 interrupt set the intrtc1 interrupt (int erval interrupt) as follows. figure 10-12. setting of intrtc2 interrupt start rc1pwr bit = 1 (rc1cc0) enabling counter operation setting ict2 to ict0 bits (rc1cc3) <1> selecting interval time of intrtc2 (interval) interrupt end rinte bit = 1 (rc1cc3) <2> enabling intrtc2 (interval) interrupt caution set <1> and <2> at the same time or set <1> first. if <2> is set first, an unintended waveform of the interrupt may be output.
chapter 10 watch functions user?s manual u19201ej3v0ud 655 (7) changing setting of intrtc2 interrupt during clock operation if the setting of the intrtc2 interrupt (interval interru pt) is changed during clock o peration of the real-time counter (rc1cc0.rc1pwr bit = 1), a whisker may be generated on the waveform of the intrct2 interrupt and an unintended signal may be output. to mask the wh isker, change the setting of the intrtc2 interrupt request signal as follows during clock operation (rc1pwr bit = 1). figure 10-13. changing setting of intr tc2 interrupt during clock operation start setting rtc2mk bit (rtc2ic) setting to mask interrupt request signal (intrtc2) setting ict2 to ict0 bits (rc1cc3) selecting interval of intrtc2 (interval) interrupt end rinte bit = 1 (rc1cc3) enabling intrtc2 (interval) interrupt clearing rtc2if flag (rtc2ic) clearing interrupt pending bit clearing rtc2mk flag (rtc2ic) unmasking interrupt request signal (intrtc2) remark for details of the rtc2if and rtc2mk bit, refer to 24.3.4 interrupt control register (xxicn) .
chapter 10 watch functions user?s manual u19201ej3v0ud 656 (8) initializing real-time counter the following figure shows the procedure fo r initializing the real-time counter figure 10-14. initializing real-time counter start setting rtcnmk bit (rtcnic) masking interrupt request signal (intrtcn) end rc1pwr bit = 0 (rc1cc0) initializing real-time counter (rtc) disabling rc1ckdiv interrupt disabling rc1ck1hz interrupt disabling rc1cko interrupt cloe2 bit = 0 (rc1cc3) cloe1 bit = 0 (rc1cc1) cloe0 bit = 0 (rc1cc1) clearing rtcnif flag (rtcnic) clearing interrupt request bit clearing rtcnmk flag (rtcnic) unmasking interrupt request signal (intrtcn) remarks 1. for details of the rtcnif and rtcnmk bits, refer to 24.3.4 interrupt control register (xxicn) . 2. n = 0 to 2
chapter 10 watch functions user?s manual u19201ej3v0ud 657 (9) example of correcting watc h error of real-time counter the watch error correction function is to correct the deviation of the oscillation frequency of the resonator connected to the v850e/sj3-h or v850e/sk3-h. the ?deviation? means the ?constant deviation? of the frequency of the resonator when the resonator was designed. a timing chart where a 32.768 khz resonator is conn ected to the device when the system is designed, because an error occurs in the intended input clock ? 32.768 khz?, and the counting operation of the rc1subc and rc1sec registers to correct that error are shown below. figure 10-15. example of watch error correction rc1cko pin (32.768 khz) rc1subc register watch count (32.768 khz) 1 second note 1 rc1sec register 00 01 7ffeh 7fffh 0000h 0001h 0002h 0003h 0004h 0005h 7ffdh 7ffeh 7fffh 0000h 0001h 0002h 0003h 02 rc1cko pin (32.769 khz) rc1subc register watch count (32.769 khz, without correction of error of 0.002) rc1sec register 0.999939 second 00 01 02 7ffeh 7fffh 0000h 0001h 0002h 0003h 0004h 0005h 7ffeh 7fffh 0000h 0001h 0002h 0003h 0004h note 2 note 3 rc1cko pin (32.769 khz) rc1subc register watch count (32.769 khz with correction of error of 0.002) rc1sec register 1 second 00 01 02 7ffeh 7fffh 0000h 0001h 0002h 0003h 0004h 0005h 7ffeh 7fffh 8000h 8001h 0000h 0001h 0002h count value is incremented by two. notes 1. one second is counted by counting 3276 8 (0000h to 7fffh) clocks of 32.768 khz. 2. 32768/32770 ? 0.999939 second if 32768 (0000h to 7fffh) clocks of 32.770 khz are counted. in this case, an error of ? 158.2 seconds ? (32768/32770 ? 1) 60 (seconds) 60 (minutes) 24 (hours) 30 (days) is generated per month. 3. one second can be counted without an error by c ounting 32770 (0000h to 8001h) clocks of 32.770 khz.
chapter 10 watch functions user?s manual u19201ej3v0ud 658 if a ?positive error? that is faster t han 32.768 khz occurs on the resonator, as shown in figure 10-15, the watch can be accurately counted by increasing the count value of the rc1subc register. similarly, if a ?negative error? that is slower than 32.768 khz occurs on t he resonator, the watch can be accurately counted by decreasing the count value of the rc1subc register. whether the value of the rc1subc register is to be incr eased or decreased is determined by the f6 to f0 bits, and the value by which the register value is to be incr eased or decreased is determined by the f5 to f0 bits. (a) increasing count value of rc1subc register when the f6 bit = 0, the count value of the rc1subc re gister is increased by the value set by the f5 to f0 bits. expression for calculating increment: (s et value of f5 to f0 bits ? 1) 2 [example of increasing count value of rc1subc register: f6 bit = 0] if 15h (010101b) is set to the f5 to f0 bits (15h ? 1) 2 = 40 (increases count value of rc1subc register by 40) count value of rc1subc register = 32768 + 40 = 32808 (b) decreasing count value of rc1subc register when the f6 bit = 1, the count value of the rc1subc register is decreased by the inverted value of the value set to the f5 to f0 bits. expression for calculating decrement: (inverted value of set value of f5 to f0 bits + 1) 2 [example of decreasing count value of rc1subc register: f6 bit = 1] if 15h (010101b) is set to the f5 to f0 bits inverted data of 15h (010101b) = 2ah (101010b) (2ah + 1) 2 = 86 (decreases count value of rc1subc register by 86) count value of rc1subc register = 32768 ? 86 = 32682
chapter 10 watch functions user?s manual u19201ej3v0ud 659 (c) rc1subu.dev bit the rc1subu.dev bit determines the timing in whic h the setting of the f6 to f0 bits is valid. the value set by the f6 to f0 bits is not always refl ected on the count value of the rc1subc register but it is reflected in the following timing. table 10-7. setting of dev bit value of dev bit timing of reflection on rc1subc register when 0 when rc1sec register is 00, 20, or 40 when 1 when rc1sec register is 00 [example when 0010101b is set to f6 to f0 bits] ? when dev bit = 0 the count value of the rc1subc regist er is 00, 20, or 40 seconds, ?32808?; otherwise, it is ?32768?. ? when dev bit = 1 the count value of the rc1subc register is 00 seconds, ?32808?; otherwise, it is ?32768?. the count value of the rc1subc r egister is not corrected every seco nd but every 20 or 60 seconds, in accordance with the deviation range of the resonator. the frequency range of the re sonator that actually can be corrected is as follows. ? when dev bit = 0: 32.76180000 khz to 32.77420000 khz ? when dev bit = 1: 32.76593333 khz to 32.77006667 khz when the dev bit = 0, a frequency range three times wider than when the dev bit = 1 can be corrected. however, when the dev bit = 1, the frequency can be set with an accuracy three times higher than when the dev bit = 0. tables 10-8 and 10-9 show the set values of the dev bit and f6 to f0 bits and a list of the frequencies that can be corrected.
chapter 10 watch functions user?s manual u19201ej3v0ud 660 table 10-8. frequency range correctable when dev bit = 0 f6 bit f5 to f0 bits rc1subc register correction value connected clock frequency (with constant deviation included) 0 000000 no correction ? 0 000001 no correction ? 0 000010 increments rc1subc register count va lue by +2 once every 20 seconds 32.76810000 khz 0 000011 increments rc1subc register count val ue by +4 once every 20 seconds 32.76820000 khz 0 000100 increments rc1subc register count va lue by +6 once every 20 seconds 32.76830000 khz : : 0 111011 increments rc1subc register count value by +120 once every 20 seconds 32.77400000 khz 0 111110 increments rc1subc register count value by +122 once every 20 seconds 32.77410000 khz 0 111111 increments rc1subc register count value by +124 once every 20 seconds 32.77420000 khz (upper limit) 1 000000 no correction ? 1 000001 no correction ? 1 000010 decrements rc1subc register count value by ? 124 once every 20 seconds 32.76180000 khz (lower limit) 1 000011 decrements rc1subc register count value by ? 122 once every 20 seconds 32.76190000 khz 1 000100 decrements rc1subc register count value by ? 120 once every 20 seconds 32.76200000 khz : : 1 11011 decrements rc1subc register count value by ? 6 once every 20 seconds 32.76770000 khz 1 11110 decrements rc1subc register count value by ? 4 once every 20 second 32.76780000 khz 1 11111 decrements rc1subc register count value by ? 2 once every 20 seconds 32.76790000 khz table 10-9. frequency range correctable when dev bit = 1 f6 bit f5 to f0 bits rc1subc register correction value connected clock frequency (with constant deviation included) 0 000000 no correction ? 0 000001 no correction ? 0 000010 increments rc1subc register count va lue by +2 once every 60 seconds 32.76803333 khz 0 000011 increments rc1subc register count va lue by +4 once every 60 seconds 32.76806667 khz 0 000100 increments rc1subc register count va lue by +6 once every 60 seconds 32.76810000 khz : : 0 111011 increments rc1subc register count value by +120 once every 60 seconds 32.77000000 khz 0 111110 increments rc1subc register count value by +122 once every 60 seconds 32.77003333 khz 0 111111 increments rc1subc register count value by +124 once every 60 seconds 32.77006667 khz (upper limit) 1 000000 no correction ? 1 000001 no correction ? 1 000010 decrements rc1subc register count value by ? 124 once every 60 seconds 32.76593333 khz (lower limit) 1 000011 decrements rc1subc register count value by ? 122 once every 60 seconds 32.76596667 khz 1 000100 decrements rc1subc register count value by ? 120 once every 60 seconds 32.76600000 khz : : 1 11011 decrements rc1subc register count value by ? 6 once every 60 seconds 32.76790000 khz 1 11110 decrements rc1subc register count value by ? 4 once every 60 seconds 32.76793333 khz 1 11111 decrements rc1subc register count value by ? 2 once every 60 seconds 32.76796667 khz
user?s manual u19201ej3v0ud 661 chapter 11 functions of watchdog timer 2 11.1 functions watchdog timer 2 has the following functions. ? default-start watchdog timer notes 1, 2 reset mode: reset operation upon overflow of wa tchdog timer 2 (generation of wdt2res signal) non-maskable interrupt request mode: nmi operation upon overflow of watchdog timer 2 (generation of intwdt2 signal) note 3 ? input selectable from main clock, internal oscillation clock, and subclock as the source clock ? when the wdtmd1 bit of the option byte 0000007ah (see chapter 33 option byte function ) is set to 1, the operation mode of watchdog ti mer 2 can be fixed to reset mode (2 12 /f r to 2 19 /f r selectable) note 4 and the source clock can be fixed to internal oscillation clock. notes 1. when watchdog timer 2 is not used or when changing the operation mode, be sure to always set the wdtmd1 bit of the option byte 0000007ah to 0. changing modes with the wdtm2 register when the wdtmd1 bit is set to 1 is invalid. 2. watchdog timer 2 automatically starts in the reset mode following reset release. when watchdog timer 2 is not used, either stop its operation before reset is executed via this function, or clear watchdog timer 2 once and stop it within the next interval time. also, write to the wdtm2 register for verifi cation purposes only once, even if the default settings (reset mode, interval time: f r /2 19 ) do not need to be changed. 3. for the non-maskable interrupt servicing due to a non-maskable interrupt request signal (intwdt2), see 24.2.2 (2) intwdt2 signal . 4. if a reset mode is fixed (wdtmd1 bit = 1) by t he option byte 0000007ah, changing modes by using the wdtm2 register becomes invali d; therefore, it can be used as a way to prevent erroneous write operation due to a cpu hang-up.
chapter 11 functions of watchdog timer 2 user?s manual u19201ej3v0ud 662 11.2 configuration the following shows the block diagram of watchdog timer 2. figure 11-1. block diag ram of watchdog timer 2 f xp /2 9 clock input controller output controller wdt2res (internal reset signal) wdcs22 internal bus intwdt2 wdcs21 wdcs20 f xt wdcs23 wdcs24 0 wdm21 wdm20 selector 16-bit counter f xp /2 18 to f xp /2 25 , f xt /2 9 to f xt /2 16 , f r /2 12 to f r /2 19 watchdog timer enable register (wdte) watchdog timer mode register 2 (wdtm2) 3 2 2 clear f r /2 3 remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock f xt : subclock frequency f r : internal oscillation clock frequency intwdt2: non-maskable interrupt request signal from watchdog timer 2 wdtres2: watchdog timer 2 reset signal watchdog timer 2 consists of the following hardware. table 11-1. configuration of watchdog timer 2 item configuration control registers watchdog timer mode register 2 (wdtm2) watchdog timer enable register (wdte)
chapter 11 functions of watchdog timer 2 user?s manual u19201ej3v0ud 663 11.3 registers (1) watchdog timer mode register 2 (wdtm2) the wdtm2 register sets the overflow time and operation clock of watchdog timer 2. this register can be read or written in 8-bit units. this register can be read any number of times, but it can be written only once following reset release. reset sets this register to 67h. caution accessing the wdtm2 register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock a nd the main clock oscillation is stopped ? when the cpu operates with th e internal oscillation clock (1/2) 0 wdtm2 wdm21 wdm20 wdcs24 wdcs23 wdcs22 wdcs21 wdcs20 after reset: 67h r/w address: fffff6d0h stops operation non-maskable interrupt request mode (generation of intwdt2 signal) reset mode (generation of wdt2res signal) wdm21 0 0 1 wdm20 0 1 ? selection of operation mode of watchdog timer 2 note note when the wdtmd1 bit of the option byte 0000007ah (see chapter 33 option byte function ) is set to 1, the reset mode is fixed.
chapter 11 functions of watchdog timer 2 user?s manual u19201ej3v0ud 664 (2/2) cautions 1. when watchdog timer 2 is not used or when changing the operation mode, be sure to always set the wdtmd1 bit of the option by te 0000007ah to 0. changing modes with the wdtm2 register when the wdtm d1 bit is set to 1 is invalid. 2. for details of the wdcs20 to wdcs24 bits, see table 11-2 watchdog timer 2 clock selection. 3. although watchdog timer 2 can be stoppe d just by stopping the operation of the internal oscillator, clear th e wdtm2 register to 00h to securely stop the timer (to avoid selection of the main clock or subclock due to an erroneous write operation). 4. if the wdtm2 register is rewritten twic e after reset, an overflow signal is forcibly generated and the counter is reset. 5. to intentionally generate an overflow si gnal, write to the wdtm2 register only twice or write a value other than ?ach? to the wdte register once. however, when watchdog timer 2 is set to st op operation, an overflow signal is not generated even if data is written to the wdtm2 regist er only twice, or a value other than ?ach? is written to the wdte register only once. 6. to stop the operation of watchdog timer 2, set the rcm.rstop bit to 1 (to stop the internal oscillator) and write 00h in th e wdtm2 register. if the rcm.rstop bit cannot be set to 1, set the wdcs23 bit to 1 (2 n /f xp is selected and the clock can be stopped in the idle1, idle2, sub- idle, and subclock operation modes). however, when the wdtmd1 bit of th e option byte 0000007ah (see chapter 33 option byte function) is set to 1, the clock cannot be stopped other than be reset. 7. be sure to clear bit 7 to ?0?. remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 11 functions of watchdog timer 2 user?s manual u19201ej3v0ud 665 table 11-2. watchdog timer 2 clock selection wdcs24 wdcs23 wdcs22 wdcs21 wdcs20 selected clock 100 khz (min.) 220 khz (typ.) 400 khz (max.) 0 0 0 0 0 2 12 /f r 41.0 ms 18.6 ms 10.2 ms 0 0 0 0 1 2 13 /f r 81.9 ms 37.2 ms 20.5 ms 0 0 0 1 0 2 14 /f r 163.8 ms 74.5 ms 41.0 ms 0 0 0 1 1 2 15 /f r 327.7 ms 148.9 ms 81.9 ms 0 0 1 0 0 2 16 /f r 655.4 ms 297.9 ms 163.8 ms 0 0 1 0 1 2 17 /f r 1310.7 ms 595.8 ms 327.7 ms 0 0 1 1 0 2 18 /f r 2621.4 ms 1191.6 ms 655.4 ms 0 0 1 1 1 2 19 /f r 5242.9 ms 2383.1 ms 1310.7 ms f xp = 32 mhz f xp = 24 mhz f xp = 16 mhz f xp = 10 mhz 0 1 0 0 0 2 18 /f xp 8.2 ms 10.9 ms 16.4 ms 26.2 ms 0 1 0 0 1 2 19 /f xp 16.4 ms 21.8 ms 32.8 ms 52.4 ms 0 1 0 1 0 2 20 /f xp 32.8 ms 43.7 ms 65.5 ms 104.9 ms 0 1 0 1 1 2 21 /f xp 65.5 ms 87.4 ms 131.1 ms 209.7 ms 0 1 1 0 0 2 22 /f xp 131.1 ms 174.8 ms 262.1 ms 419.4 ms 0 1 1 0 1 2 23 /f xp 262.1 ms 349.5 ms 524.3 ms 838.9 ms 0 1 1 1 0 2 24 /f xp 524.3 ms 699.1 ms 1048.6 ms 1677.7 ms 0 1 1 1 1 2 25 /f xp 1048.6 ms 1398.1 ms 2097.2 ms 3355.4 ms f xt = 32.768 khz 1 0 0 0 2 9 /f xt 15.625 ms 1 0 0 1 2 10 /f xt 31.25 ms 1 0 1 0 2 11 /f xt 62.5 ms 1 0 1 1 2 12 /f xt 125 ms 1 1 0 0 2 13 /f xt 250 ms 1 1 0 1 2 14 /f xt 500 ms 1 1 1 0 2 15 /f xt 1000 ms 1 1 1 1 2 16 /f xt 2000 ms caution when the wdtmd1 bit of the option byte 0000007ah (see chapter 33 option byte function) is set to 1, the clock is fi xed to the internal oscillation clock (f r ) (2 12 /f r to 2 19 /f r selectable). remark f r : internal oscillation clock frequency f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock f xt : subclock frequency
chapter 11 functions of watchdog timer 2 user?s manual u19201ej3v0ud 666 (2) watchdog timer enable register (wdte) the counter of watchdog timer 2 is cleared and counting restarted by wr iting ?ach? to the wdte register. the wdte register can be read or written in 8-bit units. reset sets this register to 9ah. wdte after reset: 9ah r/w address: fffff6d1h cautions 1. when a value other than ?ach? is writ ten to the wdte register , an overflow signal is forcibly output. 2. when a 1-bit memory mani pulation instruction is execute d for the wdte register, an overflow signal is forcibly output. 3. to intentionally generate an overflow sign al, write to the wdtm2 register only twice or write a value other than ?ach? to the wdte register once. however, when the watch dog timer 2 is set to stop opera tion, an overflow signal is not generated even if data is written to the wdtm2 register only twice, or a value other than ?ach? is written to the wdte register only once. 4. the read value of the wdte register is ?9ah? (which differs from written value ?ach?).
chapter 11 functions of watchdog timer 2 user?s manual u19201ej3v0ud 667 11.4 operation watchdog timer 2 automatically starts in t he reset mode following reset release. the wdtm2 register can be written to only once following re set using byte access. to use watchdog timer 2, write the operation mode and the interval time to the wdtm2 register using an 8-bit me mory manipulation instruction. after this, the operation of watchdog timer 2 cannot be stopped. the wdcs24 to wdcs20 bits of the wdtm 2 register are used to select the watchdog timer 2 loop detection time interval. writing ach to the wdte register cl ears the counter of watchdog timer 2 an d starts the count operation again. after the count operation has start ed, write ach to wdte within the loop detection time interval. if the time interval expires without ach being written to the wdte register, a reset signal (wdt2res) or a non- maskable interrupt request signal (intwdt2) is gener ated, depending on the set values of the wdm21 and wdtm2.wdm20 bits. when the wdtm2.wdm21 bit is set to 1 (reset mode), if a wdt overflow occurs during oscillation stabilization after a reset or standby is released, no internal reset will oc cur and the cpu clock will switch to the internal oscillation clock. to not use watchdog timer 2, write 00h to the wdtm2 register. for the non-maskable interrupt servicing while t he non-maskable interrupt request mode is set, see 24.2.2 (2) intwdt2 signal . when the wdtmd1 bit of the option byte 0000007ah (see chapter 33 option byte function ) is set to 1, the operation mode of watchdog timer 2 can be fixed to reset mode (2 12 /f r to 2 19 /f r selectable) and the source clock can be fixed to internal oscillation clock. however, when the wdtmd1 bit of the option byte 0000007ah is set to 1, watchdog timer 2 cannot be stopped other than be reset.
user?s manual u19201ej3v0ud 668 chapter 12 real-time output function (rto) 12.1 function the real-time output function transfers preset data to the rtbln and rtbh n registers, and then transfers this data by hardware to an external device via the output latches, upon occurrence of a timer interrupt. the pins through which the data is output to an external device constitute a port called the real-tim e output function (rto). because rto can output signals without jitter, it is suitable for controlling a stepper motor. in the v850e/sj3-h and v850e/sk3-h, two 6-bi t real-time output port channels are provided. the real-time output port can be se t to the port mode or real-time output port mode in 1-bit units. remark n = 0, 1
chapter 12 real-time output function (rto) user?s manual u19201ej3v0ud 669 12.2 configuration the block diagram of rto is shown below. figure 12-1. block diagram of rto inttp0cc0, inttp6cc0 note 1 inttp5cc0, inttp8cc0 note 2 inttp4cc0, inttp7cc0 note 3 rtpoen rtpegn byten extrn rtpmn5 rtpmn4 rtpmn3 rtpmn2 rtpmn1 rtpmn0 4 2 2 4 rtpn4, rtpn5 rtpn0 to rtpn3 real-time output buffer register nh (rtbhn) real-time output latch nh selector real-time output latch nl real-time output port control register n (rtpcn) transfer trigger (h) transfer trigger (l) real-time output port mode register n (rtpmn) internal bus real-time output buffer register nl (rtbln) notes 1. inttp0cc0 when n = 0, inttp6cc0 when n = 1 2. inttp5cc0 when n = 0, inttp8cc0 when n = 1 3. inttp4cc0 when n = 0, inttp7cc0 when n = 1 remark n = 0, 1 rto consists of the following hardware. table 12-1. configuration of rto item configuration registers real-time output buffer r egisters nl, nh (rtbln, rtbhn) control registers real-time output port mode register n (rtpmn) real-time output port control register n (rtpcn)
chapter 12 real-time output function (rto) user?s manual u19201ej3v0ud 670 (1) real-time output buffer registers nl, nh (rtbln, rtbhn) the rtbln and rtbhn registers are 4-bit registers that hold preset output data. these registers are mapped to independent addresses in the peripheral i/o register area. these registers can be read or wr itten in 8-bit or 1-bit units. reset sets these registers to 00h. if an operation mode of 4 bits 1 channel or 2 bits 1 channel is specified (rtpcn.byten bit = 0), data can be individually set to the rtbln and rtbhn registers. the data of both these r egisters can be read at once by specifying the address of either of these registers. if an operation mode of 6 bits 1 channel is specified (byten bit = 1), 8-bit data can be set to both the rtbln and rtbhn registers by writing the da ta to either of these registers. moreover, the data of both these registers can be read at once by specifying the address of either of these registers. table 12-2 shows the operation when the rt bln and rtbhn register s are manipulated. 0 rtbln rtbhn 0 rtbhn5 rtbhn4 rtbln3 rtbln2 rtbln1 rtbln0 after reset: 00h r/w address: rtbl0 fffff6e0h, rtbh0 fffff6e2h, rtbl1 fffff6f0h, rtbh1 fffff6f2h cautions 1. when writing to bits 6 and 7 of the rtbhn register, always write 0. 2. accessing the rtbln and rtbhn regi sters is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-chip peripheral i/o registers. ? when the cpu operates with the subc lock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock remark n = 0, 1 table 12-2. operation during manipulation of rtbln and rtbhn registers read write note operation mode register to be manipulated higher 4 bits lower 4 bits higher 4 bits lower 4 bits rtbln rtbhn rtbln invalid rtbln 4 bits 1 channel, 2 bits 1 channel rtbhn rtbhn rtbln rtbhn invalid rtbln rtbhn rtbln rtbhn rtbln 6 bits 1 channel rtbhn rtbhn rtbln rtbhn rtbln note after setting the real-time output port, set output data to the rtbln and rtbhn registers by the time a real- time output trigger is generated.
chapter 12 real-time output function (rto) user?s manual u19201ej3v0ud 671 12.3 registers rto is controlled using the following two registers. ? real-time output port mode register n (rtpmn) ? real-time output port control register n (rtpcn) (1) real-time output port mode register n (rtpmn) the rtpmn register selects t he real-time output port mode or port mode in 1-bit units. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 rtpmnm 0 1 real-time output disabled real-time output enabled control of real-time output port (m = 0 to 5) rtpmn (n = 0, 1) 0 rtpmn5 rtpmn4 rtpmn3 rtpmn2 rtpmn1 rtpmn0 after reset: 00h r/w address: rtpm0 fffff6e4h, rtpm1 fffff6f4h cautions 1. by enabling the r eal-time output operation (rtpcn.rtpoen bit = 1), the bits enabled to real-time output among the rt pn0 to rtpn5 signals perform real- time output, and the bits set to port mode output 0. 2. if real-time output is disabled (r tpoen bit = 0), the real-time output pins (rtpn0 to rtpn5) all output 0, rega rdless of the rtpmn register setting. 3. in order to use this register as the real-time output pins (rtpn0 to rtpn5), set these pins as real-time output port pins using the pmc and pfc registers. 4. be sure to set bits 6 and 7 to ?0?.
chapter 12 real-time output function (rto) user?s manual u19201ej3v0ud 672 (2) real-time output port control register n (rtpcn) the rtpcn register is a register that sets the operat ion mode and output trigger of the real-time output port. the relationship between the operation mo de and output trigger of the real -time output port is as shown in tables 12-3 and 12-4. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. rtpoen disables operation note 1 enables operation rtpoen 0 1 control of real-time output operation rtpcn (n = 0, 1) rtpegn byten extrn 0 0 0 0 falling edge note 2 rising edge rtpegn 0 1 valid edge of inttpacc0 (n = 0, a = 0, 4, 5) and inttpbcc0 (n = 1, b = 6 to 8) signals 4 bits 1 channel, 2 bits 1 channel 6 bits 1 channel byten 0 1 specification of channel configuration for real-time output after reset: 00h r/w address: rtpc0 fffff6e5h, rtpc1 fffff6f5h < > notes 1. when the real-time output oper ation is disabled (rtpoen bit = 0), all the bits of the real-time output signals (rtpn0 to rtpn5) output ?0?. 2. the inttp0cc0 and inttp6cc0 signals are output for 1 clock of the count clock selected by tmp0 or tmp6. caution set the rtpegn, byten, and ext rn bits only when rtpoen bit = 0. table 12-3. operation modes and output trig gers of real-time output port (n = 0) byte0 extr0 operation mode rtbh0 (rtp 04, rtp05) rtbl0 (rtp00 to rtp03) 0 inttp5cc0 inttp4cc0 0 1 4 bits 1 channel, 2 bits 1 channel inttp4cc0 inttp0cc0 0 inttp4cc0 1 1 6 bits 1 channel inttp0cc0 table 12-4. operation modes and output trig gers of real-time output port (n = 1) byte1 extr1 operation mode rtbh1 (rtp 14, rtp15) rtbl1 (rtp10 to rtp13) 0 inttp8cc0 inttp7cc0 0 1 4 bits 1 channel, 2 bits 1 channel inttp7cc0 inttp6cc0 0 inttp7cc0 1 1 6 bits 1 channel inttp6cc0
chapter 12 real-time output function (rto) user?s manual u19201ej3v0ud 673 12.4 operation if the real-time output operation is enabled by setting the rtpcn.rtpoen bi t to 1, the data of the rtbhn and rtbln registers is transferred to the real-time output latch in synchronizati on with the generation of the selected transfer trigger (set by the rtpcn.extrn and rtpcn.byten bits). of the trans ferred data, only the data of the bits for which real-time output is enabled by the rtpmn register is output from t he rtpn0 to rtpn5 bits. the bits for which real-time output is disabled by the rtpmn register output 0. if the real-time output operatio n is disabled by clearing the rtpoen bit to 0, the rtpn0 to rtpn5 signals output 0 regardless of the setting of the rtpmn register. figure 12-2. example of operation timing of rto0 (when extr0 bit = 0, byte0 bit = 0) abababab d01 d02 d03 d04 d11 d12 d13 d14 d11 d12 d13 d14 d01 d02 d03 d04 inttp5cc0 (internal) inttp4cc0 (internal) cpu operation rtbh0 rtbl0 rt output latch 0 (h) rt output latch 0 (l) a: software processing by inttp5cc0 interrupt request (rtbh0 write) b: software processing by inttp4cc0 interrupt request (rtbl0 write) remark for the operation during standby, see chapter 26 standby function .
chapter 12 real-time output function (rto) user?s manual u19201ej3v0ud 674 12.5 usage (1) disable real-time output. clear the rtpcn.rtpoen bit to 0. (2) perform initialization as follows. ? when n = 0, set the alternate-function pins of port 5 set the pfc5.pfc5m bit and pfce5.pfce5m bit to 1, and then set the pmc5.pmc5m bit to 1 (m = 0 to 5). when n = 1, set the alternate-function pins of port 6 set the pfc6.pfc6m bit and pfce6.pfce6m bit to 0, and then set the pmc6.pmc6m bit to 1. ? specify the real-time output port mode or port mode in 1-bit units. set the rtpmn register. ? channel configuration: select the trigger and valid edge. set the rtpcn.extrn, rtpcn. byten, and rtpcn.rtpegn bits. ? set the initial values to the rtbhn and rtbln registers note 1 . (3) enable real-time output. set the rtpoen bit = 1. (4) set the next output value to the rtbhn and rtbln registers by the time the selected transfer trigger is generated note 2 . (5) set the next real-time output value to the rtbhn and rt bln registers via interrupt servicing corresponding to the selected trigger. notes 1. if the rtbhn and rtbln registers are written when the rtpoen bit = 0, that value is transferred to real-time output latches nh and nl, respectively. 2. even if the rtbhn and rtbln r egisters are written when the rt poen bit = 1, data is not transferred to real-time output latches nh and nl. 12.6 cautions (1) prevent the following conflicts by software. ? conflict between real-time output disable/enable switching (rtpoen bi t) and selected real-time output trigger. ? conflict between writing to the rtbhn and rtbln regist ers in the real-time output enabled status and the selected real-time output trigger. (2) before performing initialization, disable real-time output (rtpoen bit = 0). (3) once real-time output has been disabled (rtpoen bit = 0), be sure to initialize the rtbhn and rtbln registers before enabling real-time output again (rtpoen bit = 0 1).
user?s manual u19201ej3v0ud 675 chapter 13 a/d converter 13.1 overview the a/d converter converts analog input signals into digital values, has a resolution of 10 bits, and can handle 16 analog input signal channels (ani0 to ani15). the a/d converter has the following features. 10-bit resolution 16 channels successive approximation method operating voltage: av ref0 = 3.0 to 3.6 v analog input voltage: 0 v to av ref0 the following functions are provided as operation modes. ? continuous select mode ? continuous scan mode ? one-shot select mode ? one-shot scan mode the following functions are provided as trigger modes. ? software trigger mode ? external trigger mode (external, 1) ? timer trigger mode power-fail monitor function (conversion result compare function) 13.2 functions (1) 10-bit resolution a/d conversion an analog input channel is selected from ani0 to an i15, and an a/d conversion op eration is repeated at a resolution of 10 bits. each time a/d conversion has been completed, an interrupt request signal (intad) is generated. (2) power-fail detection function this function is used to detect a drop in the battery volt age. the result of a/d conversion (the value of the ada0crnh register) is compared with the value of t he ada0pft register, and the intad signal is generated only when a specified comparison condition is satisfied (n = 0 to 15).
chapter 13 a/d converter user?s manual u19201ej3v0ud 676 13.3 configuration the block diagram of the a/d converter is shown below. figure 13-1. block diagram of a/d converter ani0 : : ani1 ani2 ani13 ani14 ani15 ada0m2 ada0m1 ada0m0 ada0s ada0pft controller voltage comparator ada0pfm ada0cr0 ada0cr1 : : ada0cr2 ada0cr14 ada0cr15 internal bus av ref0 ada0ce bit av ss intad edge detection adtrg controller sample & hold circuit ada0ets0 bit inttp2cc0 inttp2cc1 ada0ets1 bit ada0ce bit ada0tmd1 bit ada0tmd0 bit selector selector ada0pfe bit ada0pfc bit sar voltage comparator & compare voltage generation dac the a/d converter includes the following hardware. table 13-1. configuration of a/d converter item configuration analog inputs 16 channels (ani0 to ani15 pins) registers successive approximation register (sar) a/d conversion result registers 0 to 15 (ada0cr0 to ada0cr15) a/d conversion result registers 0h to 15h (adcr0h to adcr15h): only higher 8 bits can be read control registers a/d converter mode registers 0 to 2 (ada0m0 to ada0m2) a/d converter channel specification register (ada0s) power fail compare mode register (ada0pfm) power fail compare threshold value register (ada0pft)
chapter 13 a/d converter user?s manual u19201ej3v0ud 677 (1) successive approximation register (sar) the sar register compares the voltage value of the analog input sign al with the output vo ltage of the compare voltage generation dac (compare voltage), and holds the co mparison result starting fr om the most significant bit (msb). when the comparison result has been held down to the le ast significant bit (lsb) (i.e., when a/d conversion is complete), the contents of the sar register are transferred to the ada0crn register. remark n = 0 to 15 (2) a/d conversion result register n (ada0crn), a/d conversion result register nh (ada0crnh) the ada0crn register is a 16-bit regi ster that stores the a/d conversi on result. ada0arn consist of 16 registers and the a/d conversion result is stored in the 10 higher bits of the ad0crn register corresponding to analog input. (the lower 6 bits are fixed to 0.) (3) a/d converter mode register 0 (ada0m0) this register specifies the operation mode and cont rols the conversion operation by the a/d converter. (4) a/d converter mode register 1 (ada0m1) this register sets the conversion time of the analog input signal to be converted. (5) a/d converter mode register 2 (ada0m2) this register sets the hardware trigger mode. (6) a/d converter channel specification register (ada0s) this register sets the input port that inputs the analog voltage to be converted. (7) power-fail compare m ode register (ada0pfm) this register sets the power-fail monitor mode. (8) power-fail compare threshol d value register (ada0pft) the ada0pft register sets a threshold value that is co mpared with the value of a/d conversion result register nh (ada0crnh). the 8-bit data set to the ada0pft regi ster is compared with the hi gher 8 bits of the a/d conversion result register (ada0crnh). (9) controller the controller compares the result of the a/d conversion (the value of the ada0crnh register) with the value of the ada0pft register when a/d conversion is comp leted or when the power-fail detection function is used, and generates the intad signal only when a spec ified comparison condition is satisfied. (10) sample & hold circuit the sample & hold circuit samples each of the analog input signals selected by the input circuit and sends the sampled data to the voltage comparator. this circuit also holds the sampled analog input signal voltage during a/d conversion. (11) voltage comparator the voltage comparator compares a voltage value that has been sample d and held with the voltage value of the compare voltag e generation dac.
chapter 13 a/d converter user?s manual u19201ej3v0ud 678 (12) compare voltage generation dac this compare voltage generation dac is connected between av ref0 and av ss and generates a voltage for comparison with the analog input signal. (13) ani0 to ani15 pins these are analog input pins for the 16 a/d converter channels and are used to input analog signals to be converted into digital signals. pins other than the one selected as the analog input by the ada0s register can be used as input port pins. caution make sure that the voltag es input to the ani0 to ani15 pins do not exceed the rated values. in particular if a voltage of av ref0 or higher is input to a channel, the conversion value of that channel becomes undefined, and the conver sion values of the other channels may also be affected. (14) av ref0 pin this is the pin used to input the reference voltage of t he a/d converter. always make the potential at this pin the same as that at the v dd pin even when the a/d converter is not us ed. the signals input to the ani0 to ani15 pins are converted to digital signal s based on the voltage applied between the av ref0 and av ss pins. (15) av ss pin this is the ground pin of t he a/d converter. always make the potential at this pin the same as that at the v ss pin even when the a/d converter is not used.
chapter 13 a/d converter user?s manual u19201ej3v0ud 679 13.4 registers the a/d converter is controlled by the following registers. ? a/d converter mode registers 0, 1, 2 (ada0m0, ada0m1, ada0m2) ? a/d converter channel specification register 0 (ada0s) ? power-fail compare mode register (ada0pfm) the following registers are also used. ? a/d conversion result register n (ada0crn) ? a/d conversion result register nh (ada0crnh) ? power-fail compare threshold value register (ada0pft) (1) a/d converter mode register 0 (ada0m0) the ada0m0 register is an 8-bit register that specif ies the operation mode and controls conversion operations. this register can be read or written in 8-bit or 1-bit units. however, ada0ef bit is read-only. reset sets this register to 00h. caution accessing the ada0m0 register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock (1/2) ada0ce ada0ce 0 1 stops a/d conversion enables a/d conversion a/d conversion control ada0m0 0 ada0md1 ada0md0 ada0ets1 ada0ets0 ada0tmd ada0ef ada0md1 0 0 1 1 ada0md0 0 1 0 1 continuous select mode continuous scan mode one-shot select mode one-shot scan mode specification of a/d converter operation mode after reset: 00h r/w address: fffff200h < > < >
chapter 13 a/d converter user?s manual u19201ej3v0ud 680 (2/2) ada0tmd 0 1 software trigger mode external trigger mode/timer trigger mode trigger mode specification ada0ef 0 1 a/d conversion stopped a/d conversion in progress a/d converter status display ada0ets1 0 0 1 1 ada0ets0 0 1 0 1 no edge detection falling edge detection rising edge detection detection of both rising and falling edges specification of external trigger (adtrg pin) input valid edge cautions 1. if bit 0 is wr itten, this is ignored. 2. changing the ada0m1 register is prohib ited while a/d conversion is enabled (ada0ce bit = 1). 3. in the following modes, write data to the ada0m0, ada0m2, ada0s, ada0pfm, and ada0pft registers while a/d conversion is stopped (ada0ce bit = 0), and then enable the a/d conversion operation (ada0ce bit = 1). ? normal conversion mode ? one-shot select mode/one-shot scan mode of high-speed conversion mode if data is written to the ada0m0, ada0 m2, ada0s, ada0pfm, and ada0pft registers in any other modes during a/d conversion (a da0ef bit = 1), the operation is performed as follows, depending on the mode. ? in software trigger mode a/d conversion is stopped and started again from the beginning. ? in hardware trigger mode a/d conversion is stopped, and the trigger standby state is set. 4. to select the external trigger mode/timer trigger mode (ada0tmd bit = 1), set the high- speed conversion mode (ada0m1.ada0hs1 bi t = 1). do not input a trigger during stabilization time that is inserted once af ter the a/d conversion operation is enabled (ada0ce bit = 1). 5. when not using the a/d converter, stop the operation by setting the ada0ce bit to 0 to reduce the power consumption.
chapter 13 a/d converter user?s manual u19201ej3v0ud 681 (2) a/d converter mode register 1 (ada0m1) the ada0m1 register is an 8-bit regist er that specifies the conversion time. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. ada0hs1 ada0m1 0 00 ada0fr3 ada0fr2 ada0fr1 ada0fr0 after reset: 00h r/w address: fffff201h ada0hs1 0 1 normal conversion mode high-speed conversion mode specification of normal conversion mode/high-speed mode (a/d conversion time) cautions 1. changing the ada0m1 register is prohibited while a/d conversion is enabled (ada0m0.ada0ce bit = 1). 2. to select the external trigger mode/timer trigger mode (ada0m0.ada0tmd bit = 1), set the high-speed conversion mode (ada0m1.ada0 hs1 bit = 1). do not input a trigger during stabilization time that is inserted only once after the a/d conversion operation is enabled (ada0ce bit = 1). 3. be sure to clear bits 6 to 4 to ?0?. remark for a/d conversion time setting examples, see tables 13-2 and 13-3 .
chapter 13 a/d converter user?s manual u19201ej3v0ud 682 table 13-2. conversion time selection in normal conversion mode (ada0hs1 bit = 0) a/d conversion time ada0fr3 to ada0fr0 bits stabilization time + conversion time + wait time f xp = 32 mhz f xp = 24 mhz f xp = 20 mhz f xp = 16 mhz f xp = 4 mhz trigger response time 0000 66/f xp (13/f xp + 26/f xp + 27/f xp ) setting prohibited setting prohibited setting prohibited setting prohibited 16.5 s 3/f xp 0001 131/f xp (26/f xp + 52/f xp + 53/f xp ) setting prohibited setting prohibited 6.55 s 8.19 s setting prohibited 3/f xp 0010 196/f xp (39/f xp + 78/f xp + 79/f xp ) setting prohibited 8.17 s 9.80 s 12.25 s setting prohibited 3/f xp 0011 259/f xp (50/f xp + 104/f xp + 105/f xp ) 8.09 s 10.79 s 12.95 s 16.19 s setting prohibited 3/f xp 0100 311/f xp (50/f xp + 130/f xp + 131/f xp ) 9.72 s 12.96 s 15.55 s 19.44 s setting prohibited 3/f xp 0101 363/f xp (50/f xp + 156/f xp + 157/f xp ) 11.34 s 15.13 s 18.15 s 22.69 s setting prohibited 3/f xp 0110 415/f xp (50/f xp + 182/f xp + 183/f xp ) 12.97 s 17.29 s 20.75 s setting prohibited setting prohibited 3/f xp 0111 467/f xp (50/f xp + 208/f xp + 209/f xp ) 14.59 s 19.46 s 23.35 s setting prohibited setting prohibited 3/f xp 1000 519/f xp (50/f xp + 234/f xp + 235/f xp ) 16.22 s 21.63 s setting prohibited setting prohibited setting prohibited 3/f xp 1001 571/f xp (50/f xp + 260/f xp + 261/f xp ) 17.84 s setting prohibited setting prohibited setting prohibited setting prohibited 3/f xp 1010 623/f xp (50/f xp + 286/f xp + 287/f xp ) 19.47 s setting prohibited setting prohibited setting prohibited setting prohibited 3/f xp 1011 675/f xp (50/f xp + 312/f xp + 313/f xp ) 21.09 s setting prohibited setting prohibited setting prohibited setting prohibited 3/f xp others setting prohibited remarks 1. stabilization time: a/d converter setup time (1 s or longer) conversion time: actual conversion time (2.6 to 10.4 s) wait time: wait time inserted before the next conversion trigger response time: if a software trigger, extern al trigger, or timer trigger is generated after the stabilization time, it is inserted before the conversion time. 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency). in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clocks in the normal conversion mode, the conversion is st arted after the stabilization time elapsed from the ada0m0.ada0ce bit is set to 1, and a/d conversion is performed only during the conversion time (2.6 to 10.4 s). operation is stopped after the conversi on ends and the a/d conversion end interrupt request signal (intad) is generated after the wait time is elapsed. because the conversion operation is stopped duri ng the wait time, operation current can be reduced. caution set as 2.6 s conversion time 10.4 s.
chapter 13 a/d converter user?s manual u19201ej3v0ud 683 table 13-3. conversion time selection in hi gh-speed conversion mode (ada0hs1 bit = 1) a/d conversion time ada0fr3 to ada0fr0 bits conversion time (+ stabilization time) f xp = 32 mhz f xp = 24 mhz f xp = 20 mhz f xp = 16 mhz f xp = 4 mhz trigger response time 0000 26/f xp (+ 13/f xp ) setting prohibited setting prohibited setting prohibited setting prohibited 6.5 s (+ 3.25 s) 3/f xp 0001 52/f xp (+ 26/f xp ) setting prohibited setting prohibited 2.6 s (+ 1.3 s) 3.25 s (+ 1.625 s) setting prohibited 3/f xp 0010 78/f xp (+ 39/f xp ) setting prohibited 3.25 s (+ 1.625 s) 3.9 s (+ 1.95 s) 4.875 s (+ 2.4375 s) setting prohibited 3/f xp 0011 104/f xp (+ 50/f xp ) 3.25 s (+ 1.5625 s) 4.33 s (+ 2.083 s) 5.2 s (+ 2.5 s) 6.5 s (+ 3.125 s) setting prohibited 3/f xp 0100 130/f xp (+ 50/f xp ) 4.0625 s (+ 1.5625 s) 5.42 s (+ 2.083 s) 6.5 s (+ 2.5 s) 8.125 s (+ 3.125 s) setting prohibited 3/f xp 0101 156/f xp (+ 50/f xp ) 4.875 s (+ 1.5625 s) 6.50 s (+ 2.083 s) 7.8 s (+ 2.5 s) 9.75 s (+ 3.125 s) setting prohibited 3/f xp 0110 182/f xp (+ 50/f xp ) 5.6875 s (+ 1.5625 s) 7.58 s (+ 2.083 s) 9.1 s (+ 2.5 s) setting prohibited setting prohibited 3/f xp 0111 208/f xp (+ 50/f xp ) 6.5 s (+ 1.5625 s) 8.67 s (+ 2.083 s) 10.4 s (+ 2.5 s) setting prohibited setting prohibited 3/f xp 1000 234/f xp (+ 50/f xp ) 7.3125 s (+ 1.5625 s) 9.75 s (+ 2.083 s) setting prohibited setting prohibited setting prohibited 3/f xp 1001 260/f xp (+ 50/f xp ) 8.125 s (+ 1.5625 s) setting prohibited setting prohibited setting prohibited setting prohibited 3/f xp 1010 286/f xp (+ 50/f xp ) 8.9375 s (+ 1.5625 s) setting prohibited setting prohibited setting prohibited setting prohibited 3/f xp 1011 312/f xp (+ 50/f xp ) 9.75 s (+ 1.5625 s) setting prohibited setting prohibited setting prohibited setting prohibited 3/f xp others setting prohibited remarks 1. stabilization time: a/d converter setup time (1 s or longer) conversion time: actual conversion time (2.6 to 10.4 s) trigger response time: if a software trigger, extern al trigger, or timer trigger is generated after the stabilization time, it is inserted before the conversion time. 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency). in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clocks in the high-speed conversion mode, the conversion is started after the stabilization time elapsed from the ada0m0.ada0ce bit is set to 1, and a/d conversion is performed only during the conversion time (2.6 to 10.4 s). the a/d conversion end interrupt request sig nal (intad) is generated immediately after the conversion ends. in continuous conversion mode, the stabilization time is inserted only before the first conversion, and not inserted after the second conversion (the a/d converter remains running). caution set as 2.6 s conversion time 10.4 s.
chapter 13 a/d converter user?s manual u19201ej3v0ud 684 (3) a/d converter mode register 2 (ada0m2) the ada0m2 register specifies the hardware trigger mode. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 ada0m2 0 0 0 00 ada0tmd1 ada0tmd0 ada0tmd1 0 0 1 1 ada0tmd0 0 1 0 1 specification of hardware trigger mode external trigger mode (when adtrg pin valid edge detected) timer trigger mode 0 (when inttp2cc0 interrupt request generated) timer trigger mode 1 (when inttp2cc1 interrupt request generated) setting prohibited after reset: 00h r/w address: fffff203h 6543210 7 cautions 1. in the following modes, write data to the ada0m2 register while a/d conversion is stopped (ada0m0.ada0ce bit = 0), and th en enable the a/d conversion operation (ada0ce bit = 1). ? normal conversion mode ? one-shot select mode/one-shot scan mo de of the high-speed conversion mode 2. be sure to clear bits 7 to 2 to ?0?.
chapter 13 a/d converter user?s manual u19201ej3v0ud 685 (4) a/d converter channel specification register (ada0s) the ada0s register specifies the pin that inputs the analog voltage to be converted into a digital signal. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 ada0s 0 0 0 ada0s3 ada0s2 ada0s1 ada0s0 after reset: 00h r/w address: fffff202h ani0 ani1 ani2 ani3 ani4 ani5 ani6 ani7 ani8 ani9 ani10 ani11 ani12 ani13 ani14 ani15 ani0 ani0, ani1 ani0 to ani2 ani0 to ani3 ani0 to ani4 ani0 to ani5 ani0 to ani6 ani0 to ani7 ani0 to ani8 ani0 to ani9 ani0 to ani10 ani0 to ani11 ani0 to ani12 ani0 to ani13 ani0 to ani14 ani0 to ani15 ada0s3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 ada0s2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 ada0s1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 ada0s0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 select mode scan mode cautions 1. in the following modes, write data to the ada0s register while a/d conversion is stopped (ada0m0.ada0ce bit = 0), and th en enable the a/d conversion operation (ada0ce bit = 1). ? normal conversion mode ? one-shot select mode/one-shot scan mo de of the high-speed conversion mode 2. be sure to clear bits 7 to 4 to ?0?.
chapter 13 a/d converter user?s manual u19201ej3v0ud 686 (5) a/d conversion result regist ers n, nh (ada0crn, ada0crnh) the ada0crn and ada0crnh registers st ore the a/d conversion results. these registers are read-only, in 16-bit or 8-bit units. however, specify the ada0crn register for 16-bit access and the ada0crnh register for 8-bit access. the 10 bits of the conversion result are read from the higher 10 bits of the ada0crn register, and 0 is read from the lower 6 bits. the higher 8 bits of the conversion result are read from the ada0crnh register. caution accessing the ada0crn and ada0crnh register s is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-chip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock after reset: undefined r address: ada0cr0 fffff210h, ada0cr1 fffff212h, ada0cr2 fffff214h, ada0cr3 fffff216h, ada0cr4 fffff218h, ada0cr5 fffff21ah, ada0cr6 fffff21ch, ada0cr7 fffff21eh, ada0cr8 fffff220h, ada0cr9 fffff222h, ada0cr10 fffff224h, ada0cr11 fffff226h, ada0cr12 fffff228h, ada0cr13 fffff22ah, ada0cr14 fffff22ch, ada0cr15 fffff22eh ada0crn (n = 0 to 15) ad9 ad8 ad7 ad6 ad0000000 ad1 ad2 ad3 ad4 ad5 ad9 ada0crnh (n = 0 to 15) ad8 ad7 ad6 ad5 ad4 ad3 ad2 76 54 32 1 0 after reset: undefined r address: ada0cr0h fffff211h, ada0cr1h fffff213h, ada0cr2h fffff215h, ada0cr3h fffff217h, ada0cr4h fffff219h, ada0cr5h fffff21bh, ada0cr6h fffff21dh, ada0cr7h fffff21fh, ada0cr8h fffff221h, ada0cr9h fffff223h, ada0cr10h fffff225h, ada0cr11h fffff227h, ada0cr12h fffff229h, ada0cr13h fffff22bh, ada0cr14h fffff22dh, ada0cr15h fffff22fh caution a write operation to the ada0m0 and ad a0s registers may cause the contents of the ada0crn register to become undefined. afte r the conversion, read the conversion result before writing to the ada0m0 and ada0s regi sters. correct conversion results may not be read if a sequence othe r than the above is used.
chapter 13 a/d converter user?s manual u19201ej3v0ud 687 the relationship between the analog volt age input to the analog input pins (a ni0 to ani15) and the a/d conversion result (ada0crn register) is as follows. v in sar = int ( av ref0 1,024 + 0.5) ada0cr note = sar 64 or, av ref0 av ref0 (sar ? 0.5) 1,024 v in < (sar + 0.5) 1,024 int( ): function that returns the integer of the value in ( ) v in : analog input voltage av ref0 : av ref0 pin voltage ada0cr: value of ada0crn register note the lower 6 bits of the ada0crn register are fixed to 0. the following shows the relationship between the analo g input voltage and the a/d conversion results. figure 13-2. relationship between analog input voltage and a/d conversion results 1,023 1,022 1,021 3 2 1 0 input voltage/av ref0 1 2,048 1 1,024 3 2,048 2 1,024 5 2,048 3 1,024 2,043 2,048 1,022 1,024 2,045 2,048 1,023 1,024 2,047 2,048 1 a/d conversion results ada0crn sar ffc0h ff80h ff40h 00c0h 0080h 0040h 0000h
chapter 13 a/d converter user?s manual u19201ej3v0ud 688 (6) power-fail compare m ode register (ada0pfm) the ada0pfm register is an 8-bit register that sets the power-fail compare mode. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. ada0pfe power-fail compare disabled power-fail compare enabled ada0pfe 0 1 selection of power-fail compare enable/disable ada0pfm ada0pfc 00 00 0 0 generates an interrupt request signal (intad) when ada0crnh ada0pft generates an interrupt request signal (intad) when ada0crnh < ada0pft ada0pfc 0 1 selection of power-fail compare mode after reset: 00h r/w address: fffff204h <7>6543210 cautions 1. in the select mode, the 8-bit data set to the ada0pft regist er is compared with the value of the ada0crnh register specified by the ada0s register. if the result matches the condition specified by th e ada0pfc bit, the conversion result is stored in the ada0crn register and the intad signal is ge nerated. if it does not match, however, the interrupt signal is not generated. 2. in the scan mode, the 8-bit data set to the ada0pft register is compared with the contents of the ada0cr0h register. if th e result matches the c ondition specified by the ada0pfc bit, the conversion result is stored in the ada0cr0 register and the intad signal is generated. if it does not match, however, the intad signal is not generated. regardless of the comparison r esult, the scan operati on is continued and the conversion result is st ored in the ada0crn register until the scan operation is completed. however, the intad signal is not generated after th e scan operation has been completed. 3. in the following modes, write data to the ada0pfm register while a/d conversion is stopped (ada0m0.ada0ce bit = 0), and th en enable the a/d conversion operation (ada0ce bit = 1). ? normal conversion mode ? one-shot select mode/one-shot scan mo de of the high-speed conversion mode 4. be sure to set bits 0 to 5 to ?0?.
chapter 13 a/d converter user?s manual u19201ej3v0ud 689 (7) power-fail compare threshol d value register (ada0pft) the ada0pft register sets the compare value in the power-fail compare mode. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. ada0pft after reset: 00h r/w address: fffff205h 76 54 321 0 caution in the following modes, write data to the ada0pft register while a/d conversion is stopped (ada0m0.ada0ce bit = 0), and then enable the a/d conversion operation (ada0ce bit = 1). ? normal conversion mode ? one-shot select mode/one-shot scan mo de of the high-speed conversion mode
chapter 13 a/d converter user?s manual u19201ej3v0ud 690 13.5 operation 13.5.1 basic operation <1> set the operation mode, trigger mode, and conversion time for executing a/d conversion by using the ada0m0, ada0m1, ada0m2, and ada0s registers. w hen the ada0m0.ada0ce bit is set, conversion is started in the software trigger mode an d the a/d converter waits for a trigger in the external or timer trigger mode. <2> when a/d conversion is started, the voltage input to the selected anal og input channel is sampled by the sample & hold circuit. <3> when the sample & hold circuit samples the input cha nnel for a specific time, it enters the hold status, and holds the input analog voltage until a/d conversion is complete. <4> set bit 9 of the successive approximation register (sar) to set the compare voltage generation dac to (1/2) av ref0 . <5> the voltage difference between the compare volt age generation dac and the analog input voltage is compared by the voltage comparator. if th e analog input voltage is higher than (1/2) av ref0 , the msb of the sar register remains set. if it is lower than (1/2) av ref0 , the msb is reset. <6> next, bit 8 of the sar register is automatically set and the next comparison is started. depending on the value of bit 9, to which a result has been already set, the compare voltage generation dac is selected as follows. ? bit 9 = 1: (3/4) av ref0 ? bit 9 = 0: (1/4) av ref0 this compare voltage and the analog input voltage are compared and, depending on the result, bit 8 is manipulated as follows. analog input voltage compare voltage: bit 8 = 1 analog input voltage compare voltage: bit 8 = 0 <7> this comparison is continued to bit 0 of the sar register. <8> when comparison of the 10 bits is complete, the valid di gital result is stored in t he sar register, which is then transferred to and stored in the ada0crn register. after that, an a/d conversion end interrupt request signal (intad) is generated. <9> in one-shot select mode, conversion is stopped note . in one-shot scan mode, conversion is stopped after scanning once note . in continuous select mode, repeat steps <2> to <8> until the ada0m0.ada0ce bit is cleared to 0. in continuous scan mode, repeat steps <2> to <8> for each channel. note in the external trigger mode, timer trigger mode 0, or timer trigger mode 1, the trigger standby status is entered. remark the trigger standby status me ans the status after the st abilization time has elapsed.
chapter 13 a/d converter user?s manual u19201ej3v0ud 691 13.5.2 conversion op eration timing figure 13-3. conversion operation timing (continuous conversion) (1) operation in normal conversion mode (ada0hs1 bit = 0) ada0m0.ada0ce bit processing state setup stabilization time conversion time wait time sampling first conversion second conversion setup sampling wait a/d conversion intad signal 2/f xp (max.) 0.5/f xp sampling time (2) operation in high-speed con version mode (ada0hs1 bit = 1) ada0m0.ada0ce bit processing state setup conversion time sampling first conversion second conversion sampling a/d conversion a/d conversion intad signal 0.5/f xp stabilization time 2/f xp (max.) sampling time ada0fr3 to ada0fr0 bits stabilization time conversion time (sampling time) wait time trigger response time 0000 13/f xp 26/f xp (8/f xp ) 27/f xp 3/f xp 0001 26/f xp 52/f xp (16/f xp ) 53/f xp 3/f xp 0010 39/f xp 78/f xp (24/f xp ) 79/f xp 3/f xp 0011 50/f xp 104/f xp (32/f xp ) 105/f xp 3/f xp 0100 50/f xp 130/f xp (40/f xp ) 131/f xp 3/f xp 0101 50/f xp 156/f xp (48/f xp ) 157/f xp 3/f xp 0110 50/f xp 182/f xp (56/f xp ) 183/f xp 3/f xx 0111 50/f xp 208/f xp (64/f xp ) 209/f xp 3/f xp 1000 50/f xp 234/f xp (72/f xp ) 235/f xp 3/f xp 1001 50/f xp 260/f xp (80/f xp ) 261/f xp 3/f xp 1010 50/f xp 286/f xp (88/f xp ) 287/f xp 3/f xp 1011 50/f xp 312/f xp (96/f xp ) 313/f xp 3/f xp others setting prohibited remarks 1. the above timings are when a trigger generates withi n the stabilization time. if the trigger generates after the stabilization time, the tri gger response time is inserted. 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency). see remark 2 in table 13-3 for details.
chapter 13 a/d converter user?s manual u19201ej3v0ud 692 13.5.3 trigger mode the timing of starting the conversion oper ation is specified by setting a trigger mode. the trigger mode includes a software trigger mode and hardware trigger modes. the hardware trigger modes include timer trigger modes 0 and 1, and external trigger mode. the ada0m0.ada0tmd bit is us ed to set the trigger mode. the hardware trigger modes are set by the ada0m2.ada0tmd1 and ada0m2.ada0tmd0 bits. (1) software trigger mode when the ada0m0.ada0ce bit is set to 1, the signal of the analog input pin (ani0 to ani15 pin) specified by the ada0s register is converted. when conversion is co mplete, the result is stored in the ada0crn register. at the same time, the a/d conversion end in terrupt request signal (intad) is generated. if the operation mode specified by the ada0m0.ada0md1 and ada0m0.ada0md0 bits is the continuous select/scan mode, the next conversion is started, unless the ada0ce bit is cleared to 0 after completion of the first conversion. conversion is performed once and ends if the operation mode is the one-shot select/scan mode. when conversion is started, the ada0m0.ada0ef bit is set to 1 (indicating that conversion is in progress). if the ada0m0, ada0m2, ada0s, ada0pfm, or ada0 pft register is written during conversion, the conversion is aborted and started agai n from the beginning. however, writing these registers is prohibited in the normal conversion mode and one-shot select m ode/one-shot scan mode of the high-speed conversion mode. (2) external trigger mode in this mode, converting the signal of the analog input pin (ani0 to ani15) specified by the ada0s register is started when an external trigger is input (to the adtrg pin). which edge of the external trigger is to be detected (i.e., the rising edge, falling edge, or both ri sing and falling edges) can be specified by using the ada0m0.ada0ets1 and ada0m0.ata0ets0 bits. when the ad a0ce bit is set to 1, the a/d converter waits for the trigger, and starts conversion after the external trigger has been input. when conversion is completed, the re sult of conversion is stored in t he ada0crn register, regardless of whether the continuous select, c ontinuous scan, one-shot select, or one-shot scan mode is set as the operation mode by the ada0md1 and ada0md0 bits. at the same time, the intad signal is generated, and the a/d converter waits for the trigger again. when conversion is started, the ada0ef bit is set to 1 (indicating that conversion is in progress). while the a/d converter is waiting for the trigger, however, the ada0ef bit is cleared to 0 (indicating that conversion is stopped). if the valid trigger is input during the conver sion operation, the conversion is aborted and started again from the beginning. if the ada0m0, ada0m2, ada0s, ada0pfm, or ada0pft r egister is written during the conversion operation, the conversion is not aborted, and the a/d converter waits for the trigger again. however, writing these registers is prohibited in the one- shot select mode/one-shot scan mode. caution to select the external trigger mode, set the high-speed conversion mode. do not input a trigger during stabilization time that is inser ted once after the a/d conversion operation is enabled (ada0m0.ada0ce bit = 1). remark the trigger standby status me ans the status after the st abilization time has elapsed.
chapter 13 a/d converter user?s manual u19201ej3v0ud 693 (3) timer trigger mode in this mode, converting the signal of the analog input pin (ani0 to ani15) specified by the ada0s register is started by the compare match interrupt request signal (inttp2cc0 or inttp2cc1) of the capture/compare register connected to the timer. the inttp2cc0 or inttp2cc1 signal is selected by the ada0tmd1 and ada0tmd0 bits, and conversion is started at the rising edge of the specified compare match interrupt request signal. when the ada0ce bit is set to 1, the a/d co nverter waits for a trigger, and starts conversion when the compare match interrupt request signal of the timer is input. when conversion is completed, regardless of whether the continuous select, continuous scan, one-shot select, or one-shot scan mode is set as t he operation mode by the ada0md1 and ada0md0 bits, the result of the conversion is stored in the ada0crn register. at the same time, the intad signal is generated, and the a/d converter waits for the trigger again. when conversion is started, the ada0ef bit is set to 1 (indicating that conversion is in progress). while the a/d converter is waiting for the trigger, however, the ada0ef bit is cleared to 0 (indicating that conversion is stopped). if the valid trigger is input during the conver sion operation, the conversion is aborted and started again from the beginning. if the ada0m0, ada0m2, ada0s, ada0pfm, or ada0 pft register is written during conversion, the conversion is stopped and the a/d converter waits for the trigger again. however, writing these registers is prohibited in the one-shot select mode/one-shot scan mode. caution to select the timer trigger mode, set the hi gh-speed conversion mode. do not input a trigger during stabilization time that is inserted once after the a/d co nversion operation is enabled (ada0m0.ada0ce bit = 1). remark the trigger standby status me ans the status after the st abilization time has elapsed.
chapter 13 a/d converter user?s manual u19201ej3v0ud 694 13.5.4 operation mode four operation modes are available as t he modes in which to set the ani0 to ani15 pins: continuous select mode, continuous scan mode, one-shot sele ct mode, and one-shot scan mode. the operation mode is selected by the ad a0m0.ada0md1 and ada0m0.ada0md0 bits. (1) continuous select mode in this mode, the voltage of one analog input pin selected by the ada0s register is continuously converted into a digital value. the conversion result is stored in the ada0crn register corresponding to the analog input pin. in this mode, an analog input pin corresponds to an ada0crn register on a one-to-one basis. each time a/d conversion is completed, the a/d conversion end interrupt reques t signal (intad) is generated. after completion of conversion, the next conversion is started, unless the ada0m0.ada0ce bit is cleared to 0 (n = 0 to 15). figure 13-4. timing example of continuous se lect mode operation (ada0s register = 01h) ani1 a/d conversion data 1 (ani1) data 2 (ani1) data 3 (ani1) data 4 (ani1) data 5 ( ani1) data 6 (ani1) data 7 (ani1) data 1 data 2 data 3 data 4 data 5 data 6 data 7 data 1 (ani1) data 2 (ani1) data 3 (ani1) data 4 (ani1) data 6 (ani1) ada0cr1 intad conversion start set ada0ce bit = 1 conversion start set ada0ce bit = 1 (2) continuous scan mode in this mode, analog input pins are sequentially selected, from the ani0 pin to the pin specified by the ada0s register, and their values are converted into digital values. the result of each conversion is stored in the ada0cr n register corresponding to the analog input pin. when conversion of the analog input pin specified by the ada0 s register is complete, the intad signal is generated, and a/d conversion is started again from the ani0 pin, unless the ada0ce bit is cleared to 0 (n = 0 to 15).
chapter 13 a/d converter user?s manual u19201ej3v0ud 695 figure 13-5. timing example of continuous s can mode operation (ada0s register = 03h) (a) timing example a/d conversion data 1 (ani0) data 2 (ani1) data 3 (ani2) data 4 (ani3) data 5 (ani0) data 6 (ani1) data 7 (ani2) data 1 (ani0) data 2 (ani1) data 3 (ani2) data 4 (ani3) data 5 (ani0) data 6 (ani1) ada0crn intad conversion start set ada0ce bit = 1 ani3 ani0 ani1 ani2 data 1 data 2 data 3 data 4 data 6 data 5 data 7 (b) block diagram a/d converter ada0crn register analog input pin ani0 ani1 ani2 ani3 ani4 ani5 ani13 ani14 ani15 . . . . ada0cr0 ada0cr1 ada0cr2 ada0cr3 ada0cr4 ada0cr5 ada0cr13 ada0cr14 ada0cr15 . . .
chapter 13 a/d converter user?s manual u19201ej3v0ud 696 (3) one-shot select mode in this mode, the voltage on the analog input pin specifie d by the ada0s register is converted into a digital value only once. the conversion result is stored in the ada0crn register corresponding to the analog input pin. in this mode, an analog input pin and an ada0crn register correspond on a one-to-one basis. when a/d conversion has been completed once, the intad signal is generated. the a/d conversion operation is stopped after it has been completed (n = 0 to 15). figure 13-6. timing example of one-shot sel ect mode operation (ada0s register = 01h) ani1 a/d conversion data 1 (ani1) data 6 (ani1) data 1 data 2 data 3 data 4 data 5 data 6 data 7 data 1 (ani1) data 6 (ani1) ada0cr1 intad conversion start set ada0ce bit = 1 conversion start set ada0ce bit = 1 conversion end conversion end (4) one-shot scan mode in this mode, analog input pins are sequentially selected, from the ani0 pin to the pin specified by the ada0s register, and their values are converted into digital values . each conversion result is stored in the ada0crn regi ster corresponding to the analog input pin. when conversion of the analog input pin specified by the ada0s register is complete, the intad signal is generated. a/d conversion is stopped after it has been completed (n = 0 to 15).
chapter 13 a/d converter user?s manual u19201ej3v0ud 697 figure 13-7. timing example of one-shot s can mode operation (ada0s register = 03h) (a) timing example a/d conversion data 1 ( ani0) data 2 ( ani1) data 3 (ani2) data 4 ( ani3) data 1 ( ani0) data 2 (ani1) data 3 (ani2) data 4 (ani3) ada0crn intad conversion start set ada0ce bit = 1 conversion end ani3 ani0 ani1 ani2 data 1 data 2 data 3 data 4 data 6 data 5 data 7 (b) block diagram a/d converter ada0crn register analog input pin ani0 ani1 ani2 ani3 ani4 ani5 ani13 ani14 ani15 . . . . ada0cr0 ada0cr1 ada0cr2 ada0cr3 ada0cr4 ada0cr5 ada0cr13 ada0cr14 ada0cr15 . . .
chapter 13 a/d converter user?s manual u19201ej3v0ud 698 13.5.5 power-fail compare mode the a/d conversion end interrupt re quest signal (intad) c an be controlled as foll ows by the ada0pfm and ada0pft registers. ? when the ada0pfm.ada0pfe bit = 0, the intad signal is generated each time conversion is completed (normal use of the a/d converter). ? when the ada0pfe bit = 1 and when t he ada0pfm.ada0pfc bit = 0, the va lue of the ada0crnh register is compared with the value of the ada0pft register wh en conversion is completed, and the intad signal is generated only if ada0crnh ada0pft. ? when the ada0pfe bit = 1 and when the ada0pfc bit = 1, the value of the ada0cr nh register is compared with the value of the ada0pft register when conversion is completed, and the intad signal is generated only if ada0crnh < ada0pft. remark n = 0 to 15 in the power-fail compare mode, four modes are availabl e as modes in which to set the ani0 to ani15 pins: continuous select mode, continuous scan mode, one-shot select mode, and one-shot scan mode.
chapter 13 a/d converter user?s manual u19201ej3v0ud 699 (1) continuous select mode in this mode, the result of converting the voltage of t he analog input pin specified by the ada0s register is compared with the set value of the ada0pft register. if the result of power-fail compare matches the condition set by the ada0pfc bit, the conversion result is stored in the ada0crn register, and the intad signal is generated. if it does not match, the conver sion result is stored in the ada0crn register, and the intad signal is not generated. after completion of the fi rst conversion, the next conversion is started, unless the ada0m0.ada0ce bit is cleared to 0 (n = 0 to 15). figure 13-8. timing example of continuous select mode operation (when power-fail comparison is made: ada0s register = 01h) ani1 a/d conversion data 1 (ani1) data 2 (ani1) data 3 (ani1) data 4 (ani1) data 5 ( ani1) data 6 (ani1) data 7 (ani1) data 1 data 2 data 3 data 4 data 5 data 6 data 7 data 1 (ani1) data 2 (ani1) data 3 (ani1) data 4 (ani1) data 6 (ani1) ada0cr1 intad conversion start set ada0ce bit = 1 ada0pft unmatch ada0pft unmatch ada0pft match ada0pft match ada0pft match conversion start set ada0ce bit = 1 (2) continuous scan mode in this mode, the results of converting the voltages of the analog input pins sequentially selected from the ani0 pin to the pin specified by the ada0s register are st ored, and the set value of the ada0cr0h register of channel 0 is compared with the value of the ada0pft regi ster. if the result of power-fail compare matches the condition set by the ada0pfc bit, the conversion result is stored in the ada0cr0 register, and the intad signal is generated. if it does not match, the conver sion result is stored in the ada0cr0 register, and the intad signal is not generated. after the result of the first conversion has been stored in the ada0cr0 register, the results of sequentially converting the voltages on the analog input pins up to t he pin specified by the ada0 s register are continuously stored. after completion of conversion, the next conv ersion is started from the ani0 pin again, unless the ada0ce bit is cleared to 0.
chapter 13 a/d converter user?s manual u19201ej3v0ud 700 figure 13-9. timing example of continuous scan mode operation (when power-fail comparison is made: ada0s register = 03h) (a) timing example a/d conversion data 1 (ani0) data 2 (ani1) data 3 (ani2) data 4 (ani3) data 5 (ani0) data 6 (ani1) data 7 (ani2) data 1 (ani0) data 2 (ani1) data 3 (ani2) data 4 (ani3) data 5 (ani0) data 6 (ani1) ada0crn intad conversion start set ada0ce bit = 1 ada0pft match ada0pft unmatch ani3 ani0 ani1 ani2 data 1 data 2 data 3 data 4 data 6 data 5 data 7 (b) block diagram a/d converter ada0crn register analog input pin ani0 ani1 ani2 ani3 ani4 ani5 ani13 ani14 ani15 . . . . ada0cr0 ada0cr1 ada0cr2 ada0cr3 ada0cr4 ada0cr5 ada0cr13 ada0cr14 ada0cr15 . . .
chapter 13 a/d converter user?s manual u19201ej3v0ud 701 (3) one-shot select mode in this mode, the result of converting the voltage of t he analog input pin specified by the ada0s register is compared with the set value of the ada0pft register. if the result of power-fail compare matches the condition set by the ada0pfc bit, the conversion result is stored in the ada0crn register, and the intad signal is generated. if it does not match, the conver sion result is stored in the ada0crn register, and the intad signal is not generated. conversion is stopped after it has been completed. figure 13-10. timing example of on e-shot select mode operation (when power-fail comparison is made: ada0s register = 01h) ani1 a/d conversion data 1 (ani1) data 6 (ani1) data 1 data 2 data 3 data 4 data 5 data 6 data 7 data 1 (ani1) data 6 (ani1) ada0cr1 intad conversion start set ada0ce bit = 1 conversion start set ada0ce bit = 1 ada0pft match conversion end ada0pft unmatch conversion end (4) one-shot scan mode in this mode, the results of converting the voltages of the analog input pins sequentially selected from the ani0 pin to the pin specified by the ada0s register are st ored, and the set value of the ada0cr0h register of channel 0 is compared with the set value of the ada0pft register. if the result of power-fail compare matches the condition set by the ada0pfc bit, the conversion resu lt is stored in the ada0cr0 register and the intad signal is generated. if it does not match, the conver sion result is stored in the ada0cr0 register, and the intad0 signal is not generated. after the result of the first conversion has been stored in the ada0cr0 register, the results of converting t he signals on the analog input pins s pecified by the ada0s register are sequentially stored. the conversion is stopped after it has been completed.
chapter 13 a/d converter user?s manual u19201ej3v0ud 702 figure 13-11. timing example of one-shot scan mode operation (when power-fail comparison is made: ada0s register = 03h) (a) timing example a/d conversion data 1 (ani0) data 2 (ani1) data 3 (ani2) data 4 (ani3) data 1 (ani0) data 2 (ani1) data 3 (ani2) data 4 (ani3) ada0crn intad conversion start set ada0ce bit = 1 conversion end ada0pft match ani3 ani0 ani1 ani2 data 1 data 2 data 3 data 4 data 6 data 5 data 7 (b) block diagram a/d converter ada0crn register analog input pin ani0 ani1 ani2 ani3 ani4 ani5 ani13 ani14 ani15 . . . . ada0cr0 ada0cr1 ada0cr2 ada0cr3 ada0cr4 ada0cr5 ada0cr13 ada0cr14 ada0cr15 . . .
chapter 13 a/d converter user?s manual u19201ej3v0ud 703 13.6 cautions (1) when a/d converter is not used when the a/d converter is not used, the power consumption can be reduced by clearing the ada0m0.ada0ce bit to 0. (2) input range of ani0 to ani15 pins input the voltage within the specified range to the ani0 to ani15 pi ns. if a voltage equal to or higher than av ref0 or equal to or lower than av ss (even within the range of the absolute maximum ratings) is input to any of these pins, the conversion valu e of that channel is u ndefined, and the conversi on value of the other channels may also be affected. (3) countermeasures against noise to maintain the 10-bit resolution, the ani0 to ani15 pins must be effectively protected from noise. the influence of noise increases as the output impedance of the analog input sour ce becomes higher. to lower the noise, connecting an external capacitor as shown in figure 13-12 is recommended. figure 13-12. processing of analog input pin av ref0 v dd v ss av ss clamp with a diode with a low v f (0.3 v or less) if noise equal to or higher than av ref0 or equal to or lower than av ss may be generated. ani0 to ani15
chapter 13 a/d converter user?s manual u19201ej3v0ud 704 (4) alternate i/o the analog input (ani0 to ani15) pins are multiplexed with port pins. the av ref0 power pin is multiplexed with the reference power supply to the a/d converter and the i/o buffer power supply of port 7. if any of the following processings is performed during a/d conversion, therefore, the expected a/d conversion value may not be obtained. (a) if a digital pulse is applied to a pin adjacent to a pin whose input analog signal is converted into a digital signal (for example, p72 and p74 pins during ani3 conversion) (cause: influence of coupling noise) (b) if av ref0 power supply fluctuates as a result of executing an instruction to read the p7h or p7l register to the input port during a/d conversion or an instruction to write data to the output port (cause: influence on the av ref0 power supply) (c) if a current flows through a pin of port 7 (p70 to p 715) that is set in the output mode because of the influence of the external circuit connect ed to the port pin and, as a result, the av ref0 power supply fluctuates (cause: influence on the av ref0 power supply) if there is a possibility that any of the above processings may be executed during a/d conversion, be sure to execute a/d conversion more than once, check the a/d conversion value, and eliminate any abnormal value by program.
chapter 13 a/d converter user?s manual u19201ej3v0ud 705 (5) interrupt request flag (adif) the interrupt request flag (adif) is not cleared even if the contents of the ada0s regi ster are changed. if the analog input pin is changed during a/d co nversion, therefore, the result of converting the previously selected analog input signal may be stored and the conversion end interrupt request flag may be set immediately before the ada0s register is rewritten. if the adif flag is read immediately after the ada0s register is rewritten, the adif flag may be set even though the a/d conversion of the newly selected analog input pin has not been completed. when a/d conversion is stopped, cl ear the adif flag before resuming conversion. figure 13-13. generation timing of a/d conversion end interrupt request ada0s rewriting (anin conversion start) ada0s rewriting (anim conversion start) adif is set, but anim conversion does not end a/d conversion ada0crn intad anin anin anim anim anim anin anin anim remark n = 0 to 15 m = 0 to 15 (6) internal equivalent circuit the following shows the equivalent circuit of the analog input block. figure 13-14. internal equi valent circuit of anin pin anin c in r in r in c in 14 k 8.4 pf remarks 1. the above values are reference values. 2. n = 0 to 15
chapter 13 a/d converter user?s manual u19201ej3v0ud 706 (7) av ref0 pin (a) the av ref0 pin is used as the power supply pin of the a/d converter and also supplies power to the alternate-function ports. in an application where a backup power supply is used, be sure to supply the same voltage as v dd to the av ref0 pin as shown in figure 13-15. (b) the av ref0 pin is also used as the reference voltage pin of the a/d converter. if the source supplying power to the av ref0 pin has a high impedance or if the power supply has a low current supply capability, the reference voltage may fluctuate due to the current that flows during conversion (especially, immediately after the conversion operation enable bit ada0ce has been set to 1). as a result, the conversion accuracy may drop. to avoid this, it is recommended to connect a capacitor across the av ref0 and av ss pins to suppress the reference voltage fluctuation as shown in figure 13-15. (c) if the source supplying power to the av ref0 pin has a high dc resistance (for example, because of insertion of a diode), the voltage when conversion is enabled may be lower than the voltage when conversion is stopped, because of a voltage drop caused by the a/d conversion current. figure 13-15. av ref0 pin processing example av ref0 note av ss main power supply note parasitic inductance (8) reading ada0crn register when the ada0m0 to ada0m2, ada0s, ada0pfm, or ad a0pft register is written, the contents of the ada0crn register may be undefined. read the conversi on result after completion of conversion and before writing to the ada0m0 to ada0m2, ada0s, ada0pfm, or ada0pft register. also, when an external/timer trigger is acknowledged, the content s of the ada0crn register may be undef ined. read the conversion result after completion of conversion and before the next external/timer trigger is acknowledged. the correct conversion result may not be read at a timing different from the above. (9) standby mode because the a/d converter stops oper ating in the stop mode, conversion results are invalid, so power consumption can be reduced. operations are resu med after the stop mode is released, but the a/d conversion results after the stop mode is released are invalid. when using the a/d converter after the stop mode is released, before setting the stop mode or rele asing the stop mode, clear the ada0m0.ada0ce bit to 0 then set the ada0ce bit to 1 after releasing the stop mode. in the idle1, idle2, or subclock operation mode, oper ation continues. to lower the power consumption, therefore, clear the ada0m0.ada0ce bit to 0. in the idle1 and idle2 modes, since the analog input voltage value cannot be retained, the a/d conversion results a fter the idle1 and idle2 modes are released are invalid. the results of conversions before the id le1 and idle2 modes were set are valid.
chapter 13 a/d converter user?s manual u19201ej3v0ud 707 (10) restriction for each mode (a) to select the external trigger mode/timer trigger mode, set the high-speed conversion mode. do not input a trigger during stabilization time that is insert ed once after the a/d conversion operation is enabled (ada0m0.ada0ce bit = 1). (b) in the following modes, write data to the a/d cont rol register while a/d conversion is stopped (ada0ce bit = 0), and then enable the a/d conversion operation (ada0ce bit = 1). ? normal conversion mode ? one-shot select mode/one-shot sc an mode of high-speed conversion mode remark a/d control registers: ada0m0, ada0m2, ada0s, ada0pfm, and ada0pft registers (11) variation of a/d conversion results the results of the a/d conversion may vary depending on the fluctuation of the supply voltage, or may be affected by noise. to reduce the vari ation, take counteractive measures with the program such as averaging the a/d conversion results. (12) a/d conversion result hysteresis characteristics the successive comparison type a/d converter holds t he analog input voltage in the internal sample & hold capacitor and then performs a/d conversi on. after the a/d conversion ha s finished, the analog input voltage remains in the internal sample & hold capacitor. as a result, the following phenomena may occur. ? when the same channel is used for a/d conversions, if th e voltage is higher or lower than the previous a/d conversion, then hysteresis characteristics may appear where the conversion result is affected by the previous value. thus, even if t he conversion is performed at the same potential, the result may vary. ? when switching the analog input channel, hysteres is characteristics may appear where the conversion result is affected by the previous channel value. this is because one a/d converter is used for the a/d conversions. thus, even if the conversion is perfo rmed at the same potential, the result may vary.
chapter 13 a/d converter user?s manual u19201ej3v0ud 708 13.7 how to read a/d converter characteristics table this section describes the terms related to the a/d converter. (1) resolution the minimum analog input voltage that c an be recognized, i.e., the ratio of an analog input voltage to 1 bit of digital output is called 1 lsb (least significant bit). the ratio of 1 lsb to the full scale is expressed as %fsr (full-scale range). %fsr is the ratio of a range of convertible analog input voltages expressed as a percentage, and can be expressed as follows, independently of the resolution. 1%fsr = (maximum value of convertible analog input voltage ? minimum value of convertible analog input voltage)/100 = (av ref0 ? 0)/100 = av ref0 /100 when the resolution is 10 bits, 1 lsb is as follows: 1 lsb = 1/2 10 = 1/1,024 = 0.098%fsr the accuracy is determined by the overall error, independently of the resolution. (2) overall error this is the maximum value of the difference between an actually measured value and a theoretical value. it is a total of zero-scale error, full-scale error, linearity error, and a combination of these errors. the overall error in the characteristics ta ble does not include the quantization error. figure 13-16. overall error ideal line overall error 1 ...... 1 0 ...... 0 0av ref0 analog input digital output
chapter 13 a/d converter user?s manual u19201ej3v0ud 709 (3) quantization error this is an error of 1/2 lsb that inevitably occurs when an analog value is converted into a digital value. because the a/d converter converts analog input voltages in a range of 1/2 lsb into the same digital codes, a quantization error is unavoidable. this error is not included in the overall error, zero-scale error, full-scale error, integral linearity error, or differential linearity error in the characteristics table. figure 13-17. quantization error quantization error 1 ...... 1 0 ...... 0 0av ref0 analog input digital output 1/2 lsb 1/2 lsb (4) zero-scale error this is the difference between the actually measured analog input voltage and its theoretical value when the digital output changes from 0?000 to 0?001 (1/2 lsb). figure 13-18. zero-scale error av ref0 analog input (lsb) digital output (lower 3 bits) ideal line 111 ? 10 1 2 3 100 011 010 001 000 zero-scale error
chapter 13 a/d converter user?s manual u19201ej3v0ud 710 (5) full-scale error this is the difference between the actually measured analog input voltage and its theoretical value when the digital output changes from 1?110 to 1?111 (full scale ? 3/2 lsb). figure 13-19. full-scale error av ref0 analog input (lsb) digital output (lower 3 bits) 111 av ref0 ? 3 0 av ref0 ? 2av ref0 ? 1 100 011 010 000 full-scale error (6) differential linearity error ideally, the width to output a specific code is 1 lsb. this error indicates the difference between the actually measured value and its theoretical value when a sp ecific code is output. this indicates the basic characteristics of the a/d conversion when the voltage applied to the analog input pins of the same channel is consistently increased bit by bit from av ss to av ref0 . when the input voltage is increased or decreased, or when two or more channels are used, refer to 13.7 (2) overall error . figure 13-20. differential linearity error ideal width of 1 lsb differential linearity error 1 ...... 1 0 ...... 0 av ref0 analog input digital output
chapter 13 a/d converter user?s manual u19201ej3v0ud 711 (7) integral linearity error this error indicates the extent to which the conversion char acteristics differ from the ideal linear relationship. it indicates the maximum value of the difference between t he actually measured value and its theoretical value where the zero-scale error and full-scale error are 0. figure 13-21. integral linearity error 1 ...... 1 0 ...... 0 0av ref0 analog input digital output ideal line integral linearity error (8) conversion time this is the time required to obtain a digital output after each trigger has been generated. the conversion time in the characteristics table includes the sampling time. (9) sampling time this is the time for which the analog switch is on to load an analog voltage to the sample & hold circuit. figure 13-22. sampling time sampling time conversion time
user?s manual u19201ej3v0ud 712 chapter 14 d/a converter 14.1 functions the d/a converter has the following functions. 8-bit resolution 2 channels (da0cs0, da0cs1) r-2r ladder method settling time: 3 s max. (when av ref1 is 3.0 to 3.6 v and external load is 20 pf) analog output voltage: av ref1 m/256 (m = 0 to 255; value set to da0csn register) operation modes: normal mo de, real-time output mode remark n = 0, 1 14.2 configuration the d/a converter configur ation is shown below. figure 14-1. block diagram of d/a converter da0cs0 register selector selector da0cs1 register ano0 pin ano1 pin da0m.da0ce0 bit da0m.da0ce1 bit da0cs0 register write da0m.da0md0 bit inttp2cc0 signal da0cs1 register write da0m.da0md1 bit inttp3cc0 signal av ref1 pin av ss pin cautions 1. d/a converters 0 and 1 share the av ref1 pin. 2. d/a converters 0 and 1 share the av ss pin. the av ss pin is also shared by the a/d converter.
chapter 14 d/a converter user?s manual u19201ej3v0ud 713 the d/a converter consists of the following hardware. table 14-1. configuration of d/a converter item configuration control registers d/a converter mode register (da0m) d/a converter conversion value setting registers 0, 1 (da0cs0, da0cs1) 14.3 registers the registers that control the d/ a converter are as follows. ? d/a converter mode register (da0m) ? d/a converter conversion value setting registers 0, 1 (da0cs0, da0cs1) (1) d/a converter mode register (da0m) the da0m register controls the operation of the d/a converter. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 normal mode real-time output mode note da0mdn 0 1 selection of d/a converter operation mode (n = 0, 1) da0m 0 da0ce1 da0ce0 0 0 da0md1 da0md0 after reset: 00h r/w address: fffff282h disables operation enables operation da0cen 0 1 control of d/a converter operation enable/disable (n = 0, 1) < > < > note the output trigger in the real-time outpu t mode (da0mdn bit = 1) is as follows. ? when n = 0: inttp2cc0 signal (see chapter 7 16-bit timer/event counter p (tmp) ) ? when n = 1: inttp3cc0 signal (see chapter 7 16-bit timer/event counter p (tmp) ) caution be sure to set bits 2, 3, 6, and 7 to ?0?.
chapter 14 d/a converter user?s manual u19201ej3v0ud 714 (2) d/a converter conversion value setti ng registers 0, 1 (da0cs0, da0cs1) the da0cs0 and da0cs1 registers set the analog volt age value output to the ano0 and ano1 pins. these registers can be read or written in 8-bit units. reset sets these registers to 00h. da0csn7 da0csn da0csn6 da0csn5 da0csn4 da0csn3 da0csn2 da0csn1 da0csn0 after reset: 00h r/w address: da0cs0 fffff280h, da0cs1 fffff281h caution in the real-time output mode (da0m.da0mdn bit = 1), set the da0csn register before the inttp2cc0/inttp3cc0 signals are generate d. d/a conversion starts when the inttp2cc0/inttp3cc0 signa ls are generated. remark n = 0, 1
chapter 14 d/a converter user?s manual u19201ej3v0ud 715 14.4 operation 14.4.1 operation in normal mode d/a conversion is performed using a write operation to the da0csn register as the trigger. the setting method is described below. <1> set the da0m.da0mdn bit to 0 (normal mode). <2> set the analog voltage value to be output to the anon pin to the da0csn register. steps <1> and <2> above constitute the initial settings. <3> set the da0m.da0cen bit to 1 (d/a conversion enable). d/a conversion starts when this setting is performed. <4> to perform subsequent d/a conversions, write to the da0csn register. the previous d/a conversion result is held un til the next d/a conversion is performed. remarks 1. for the alternate-function pin settings, see table 4-25 using port pin as alternate-function pin . 2. n = 0, 1 14.4.2 operation in real-time output mode d/a conversion is performed using the interrupt reques t signals (inttp2cc0 and inttp3cc0) of tmp2 and tmp3 as triggers. the setting method is described below. <1> set the da0m.da0mdn bit to 1 (real-time output mode). <2> set the analog voltage value to be output to the anon pin to the da0csn register. <3> set the da0m.da0cen bit to 1 (d/a conversion enable). steps <1> to <3> above consti tute the initial settings. <4> operate tmp2 and tmp3. <5> d/a conversion starts when the inttp2cc0 and inttp3cc0 signals are generated. <6> after that, the value set in da0csn register is out put every time the inttp2cc0 and inttp3cc0 signals are generated. remarks 1. the output values of the ano0 and ano1 pins up to <5> above are undefined. 2. for the output values of the ano0 and ano1 pi ns in the halt, idle1, idle2, and stop modes, see chapter 26 standby function . 3. for the alternate-function pin settings, see table 4-25 using port pin as alternate-function pin .
chapter 14 d/a converter user?s manual u19201ej3v0ud 716 14.4.3 cautions observe the following cautions when using the d/a converter of the v850e/sj3-h or v850e/sk3-h. (1) do not change the set value of the da0csn register while the trigger signal is being issued in the real-time output mode. (2) before changing the operation mode, be sure to clear the da0m.da0cen bit to 0. (3) when using one of the p10/an00 and p11/an01 pins as an i/o port and the other as a d/a output pin, do so in an application where the port i/o level does not change during d/a output. (4) make sure that av ref0 = v dd = av ref1 = 3.0 to 3.6 v. if this range is e xceeded, the operation is not guaranteed. (5) apply and cut power to av ref1 at the same timing as av ref0 . (6) no current can be output from the anon pin (n = 0, 1) because the output impedance of the d/a converter is high. when connecting a resistor of 2 m or less, insert a jfet input operational amplifier between the resistor and the anon pin. figure 14-2. external pin connection example av ref1 v dd output 10 f 0.1 f 10 f 0.1 f av ref0 anon av ss ? + jfet input operational amplifier (7) because the d/a converter stops operation in the stop mode, the ano0 and ano1 pins go into a high- impedance state, and the power consumption can be reduced. in the idle1, idle2, or subclock operation mode, however, the operation continues. to lower the power consumption, therefore, clear the da0m.da0cen bit to 0.
user?s manual u19201ej3v0ud 717 chapter 15 asynchronous ser ial interface a (uarta) 15.1 port settings of uarta0 to uarta5 15.1.1 for v850e/sj3-h table 15-1. pin configuration alternate-function pin port <1> port <2> mode pin name pin no. port alternate function pin no. port alternate function txda0 25 p30 sob4 ? ? ? uarta0 rxda0 26 p31 intp7/sib4 ? ? ? txda1 61 p90 a0/kr6/sda02 ? ? ? uarta1 rxda1 62 p91 a1/kr7/kr7/scl02 ? ? ? txda2 35 p38 sda00/sib2 ? ? ? uarta2 rxda2 36 p39 scl00/sckb2 ? ? ? txda3 60 p81 rc1cko/rc1ckdiv ? ? ? uarta3 rxda3 59 p80 intp8/rc1ck1hz ? ? ? txda4 44 p61 rtp11/soe0 note ? ? ? uarta4 rxda4 43 p60 rtp10/sie0 note ? ? ? txda5 51 p68 sckb5/scl05 note ? ? ? uarta5 rxda5 50 p67 sob5/sda05 note ? ? ? note not available in the pd70f3931, 70f3932, and 70f3933. (1) uarta0 the transmission/reception pins (txda0 and rxda0) of uarta0 are assigned to p30 and p31, respectively. when using uarta0, specify p30 and p31 as the txda0 and rxda0/intp7 pins in advance, using the pmc3 and pfc3 registers. furthermore, disable the edge detec tion of the intp7 pin at p31 (intf3.intf31 bit = 0, intr3.intr31 bit = 0). the txda0 and rxda0 pins and the transmission/recepti on pins (sob4 and sib4) of csib4 are alternate functions of the same pin, and ther efore cannot be used simultaneously. in addition, the rxda0 pin also functions alternately as the intp7 pin (external interrup t input), so use the intp7 pin assigned to another port pin (p51) when using the rxda0 and intp7 pins simultaneously. (2) uarta1 the transmission/reception pins (txda1 and rxda1) of uarta1 are assigned to p90 and p91, respectively. when using uarta1, specify p90 and p91 as the txda 1 and rxda1/kr7 pins in advance, using the pmc9, pfc9, and pfce9 registers. furthermore, disable the e dge detection of the kr7 pin at p91 (krm.krm7 bit = 0). the txda1 and rxda1 pins, the serial transmission/rece ption data/serial clock pins (sda02 and scl02) of i 2 c02, the address bus pins (a0 and a1), and the key in terrupt input pins (kr6 and kr7) are alternate functions of the same pin, and t herefore cannot be used simultaneously.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 718 (3) uarta2 the transmission/reception pins (txda2 and rxda2) of uarta2 are assigned to p38 and p39, respectively. when using uarta2, specify p38 and p39 as the txda 2 and rxda2 pins in advance, using the pmc3, pfc3, and pfce3 registers. the txda2 and rxda2 pins and the serial clock/serial transmission/reception data pins (sda00 and scl00) of i 2 c00 are alternate functions of the same pin, and ther efore cannot be used simultaneously. in addition, the txda2 and rxda2 pins also function alternately as t he serial reception data/serial clock pin (sib2 and sckb2) of csib2, so use the sib2 and sckb2 pins assi gned to other port pins (p53 and p55) when using the txda2 and rxda2 pins and the sib2 and sckb2 pins simultaneously. (4) uarta3 the transmission/reception pins (txda3 and rxda3) of uarta3 are assigned to p81 and p80, respectively. when using uarta3, specify p81 and p80 as the txda3 and rxda3/intp8 pins in advance, using the pmc8, pfc8, and pfce8 registers. furthermore, disable the e dge detection of the intp8 pin at p80 (intf8.intf80 bit = 0, intr3.intr80 bit = 0). the txda3 and rxda3 pins and the clock output pins (rc1cko, rc1ckdiv, and rc1ck1hz) of rtc are alternate functions of the same pin, and therefore cannot be used simultaneously. in addition, the rxda3 pin also functions alternately as the intp8 pin (external in terrupt input), so use the intp8 pin assigned to another port pin (p93) when using the rxda3 and intp8 pins simultaneously. (5) uarta4 the transmission/reception pins (txda4 and rxda4) of uarta4 are assigned to p61 and p60, respectively. when using uarta4, specify p61 and p60 as the txda 4 and rxda4 pins in advance, using the pmc6, pfc6, and pfce6 registers. the txda4 and rxda4 pins, the transmi ssion/reception pins (soe0 and sie0) note , and the real-time output pins (rtp11 and rtp10) are alternate functions of the same pi n, and therefore cannot be used simultaneously. (6) uarta5 the transmission/reception pins (txda5 and rxda5) of uarta5 are assigned to p68 and p67, respectively. when using uarta5, specify p68 and p67 as the txda 5 and rxda5 pins in advance, using the pmc6, pfc6, and pfce6 registers. the txda5 and rxda5 pins, the serial clock/serial transmission data pins (sckb5 and sob5) of csib5 and the serial clock/serial transmission/ reception data pins (scl05 and sda05) note of i 2 c05 are alternate functions of the same pin, and therefore c annot be used simultaneously. note not available in the pd70f3931, 70f3932, and 70f3933. caution do not switch port settings during operation. also, be sure to disable operation of unused units for which port settings are not made.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 719 15.1.2 for v850e/sk3-h table 15-2. pin configuration alternate-function pin port <1> port <2> mode pin name pin no. port alternate function pin no. port alternate function txda0 30 p30 sob4 ? ? ? uarta0 rxda0 31 p31 intp7/sib4 ? ? ? txda1 77 p90 a0/kr6/sda02 94 p151 uarta1 rxda1 78 p91 a1/kr7/kr7/scl02 93 p150 kr7 txda2 40 p38 sda00/sib2 43 p311 ? uarta2 rxda2 41 p39 scl00/sckb2 44 p312 ? txda3 72 p81 rc1cko/rc1ckdiv ? ? ? uarta3 rxda3 71 p80 intp8/rc1ck1hz ? ? ? txda4 54 p61 rtp11/soe0 52 p57 ? uarta4 rxda4 53 p60 rtp10/sie0 51 p56 ? txda5 61 p68 sckb5/scl05 76 p85 ? uarta5 rxda5 60 p67 sob5/sda05 75 p84 ? (1) uarta0 the transmission/reception pins (txda0 and rxda0) of uarta0 are assigned to p30 and p31, respectively. when using uarta0, specify p30 and p31 as the txda0 and rxda0/intp7 pins in advance, using the pmc3 and pfc3 registers. furthermore, disable the edge detec tion of the intp7 pin at p31 (intf3.intf31 bit = 0, intr3.intr31 bit = 0). the txda0 and rxda0 pins and the transmission/recepti on pins (sob4 and sib4) of csib4 are alternate functions of the same pin, and ther efore cannot be used simultaneously. in addition, the rxda0 pin also functions alternately as the intp7 pin (external interrup t input), so use the intp7 pin assigned to another port pin (p51) when using the rxda0 and intp7 pins simultaneously. (2) uarta1 the transmission/reception pi ns (txda1 and rxda1) of uarta1 are assigned to two port pins p90, p91 and p151, p150, respectively, and can be used at either one of the two port pins only. when using uarta1 at p90 and p91, specify p90 and p91 as the txda1 and rxda1/kr 7 pins in advance, using the pmc9, pfc9, and pfce9 registers. furthermore, disable the edge detection of the kr7 pin at p91 (krm.krm7 bit = 0). when using uarta1 at p151 and p150, specify p151 and p 150 as the txda1 and rxda1/kr7 pins in advance, using the pmc15 register. furthermore, disable the edg e detection of the kr7 pin at p150 (krm.krm7 bit = 0). rxda1 and kr7 (key interrupt input) are alternate functions of both p91 and p 150, and therefore cannot be used simultaneously. p90 and p91 also function as the serial transmission/reception data/serial clock pins (sda02 and scl02), address bus pins (a0 and a1), and key interrupt input pin (kr6) of i 2 c02. by using uarta1 at p150 and p151, these alternate func tions can be used simultaneously with uarta1.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 720 (3) uarta2 the transmission/reception pi ns (txda2 and rxda2) of uarta2 are assigned to two port pins p38, p39 and p311, p312, respectively, and can be used at either one of the two port pins only. when using uarta2 at p38 and p39, specify p38 and p39 as the txda2 and rxda 2 pins in advance, using the pmc3, pfc3, and pfce3 registers. when using uarta2 at p311 and p312, specify p311 and p312 as the txda2 and rxda2 pins in advance, using the pmc3 register. sda00 and scl00 (serial transmission/rec eption data/serial clock pins) of i 2 c00 and sie2 and sckb2 (serial reception data/serial clock pins) of csib2 are alternat e functions of both p38 and p39. by using uarta2 at p311 and p312, these alternate functions can be used simultaneously with uarta2. (4) uarta3 the transmission/reception pins (txda3 and rxda3) of uarta3 are assigned to p81 and p80, respectively. when using uarta3, specify p81 and p80 as the txda3 and rxda3/intp8 pins in advance, using the pmc8, pfc8, and pfce8 registers. furthermore, disable the e dge detection of the intp8 pin at p80 (intf8.intf80 bit = 0, intr8.intr80 bit = 0). the txda3 and rxda3 pins and the clock output pins (rc1cko, rc1ckdiv, and rc1ck1hz) of rtc are alternate functions of the same pin, and therefore cannot be used simulta neously. in addition, the txda3 and rxda3 pins also function alternately as the intp8 pin (external interrupt input), so use the intp8 pin assigned to another port pin (p93) when using the rxda3, txda pins and the intp8 pin simultaneously. (5) uarta4 the transmission/reception pi ns (txda4 and rxda4) of uarta4 are assigned to two port pins p61, p60 and p57, p56, respectively, and can be used at either one of the two port pins only. when using uarta4 at p61 and p60, specify p61 and p60 as the txda4 and rxda 4 pins in advance, using the pmc6, pfc6, and pfce6 registers. when using uarta4 at p57 and p56, specify p57 and p56 as the txda4 and rxda4 pins in advance, using the pmc5 register. soe0 and sie0 (transmission/reception pins) and rtp1 1 and rtp10 (real-time output pins) are alternate functions of both p61 and p60. by using uarta4 at p57 and p56, these alte rnate functions can be used simultaneously with uarta4. (6) uarta5 the transmission/reception pi ns (txda5 and rxda5) of uarta5 are assigned to two port pins p68, p67 and p85, p84, respectively, and can be used at either one of the two port pins only. when using uarta5 at p68 and p67, specify p68 and p67 as the txda5 and rxda 5 pins in advance, using the pmc6, pfc6, and pfce6 registers. when using uarta5 at p85 and p84, specify p85 and p84 as the txda5 and rxda5 pins in advance, using the pmc8 register. sckb5 and sob5 (serial clock/serial transmission data pins) of csib5 and scl05 and sda05 (serial clock/serial transmission/reception data pins) of i 2 c05 are alternate functions of both p68 and p67. by using uarta5 at p85 and p84, these alternate functions can be used simultaneously with uarta5. caution do not switch port settings during operation. also, be sure to disable operation of unused units for which port settings are not made.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 721 15.2 features transfer rate: 300 bps to 625 kbps (using dedicated baud rate generator) full-duplex communication: internal uartan receive data register (uanrx) internal uartan transmit data register (uantx) 2-pin configuration: txdan: transmit data output pin rxdan: receive data input pin reception error output function ? parity error ? framing error ? overrun error interrupt sources: 2 ? reception completion interrupt (intuanr): this in terrupt occurs upon transfer of receive data from the receive shift register to uanrx register after serial transfer completion, in the reception enabled status. ? transmission enable interrupt (intuant): this interr upt occurs upon transfer of transmit data from the uantx register to the transmit shift register in the transmission enabled status. character length: 7 or 8 bits parity function: odd, even, 0, none transmission stop bit: 1 or 2 bits on-chip dedicated baud rate generator msb-/lsb-first transfer selectable transmit/receive data inverted input/output possible sbf (sync break field) transmission/reception in the li n (local interconnect network) communication format possible ? 13 to 20 bits selectable for sbf transmission ? recognition of 11 bits or more possible for sbf reception ? sbf reception flag provided remark n = 0 to 5
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 722 15.3 configuration the block diagram of the uartan is shown below. figure 15-1. block diagram of a synchronous serial interface an internal bus internal bus uanopt0 uanctl0 uanstr uanctl1 uanctl2 receive shift register uanrx filter selector uantx transmit shift register transmission controller reception controller selector baud rate generator baud rate generator intuanr intuant txdan rxdan f xp to f xp /2 10 ascka0 note reception unit transmission unit clock selector note uarta0 only remarks 1. n = 0 to 5 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock 3. for the configuration of the baud rate generator, see figure 15-13 .
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 723 uartan consists of the following hardware units. table 15-3. configuration of uartan item configuration registers uartan control register 0 (uanctl0) uartan control register 1 (uanctl1) uartan control register 2 (uanctl2) uartan option control register 0 (uanopt0) uartan status register (uanstr) uartan receive shift register uartan receive data register (uanrx) uartan transmit shift register uartan transmit data register (uantx) (1) uartan control register 0 (uanctl0) the uanctl0 register is an 8-bit register used to specify the uartan operation. (2) uartan control register 1 (uanctl1) the uanctl1 register is an 8-bit register used to select the input clock for the uartan. (3) uartan control register 2 (uanctl2) the uanctl2 register is an 8-bit register us ed to control the baud rate for the uartan. (4) uartan option control register 0 (uanopt0) the uanopt0 register is an 8-bit register used to control serial transfer for the uartan. (5) uartan status register (uanstr) the uanstrn register consists of fl ags indicating the error contents when a reception error occurs. each one of the reception error flags is set (to 1) upon occurrence of a reception error. (6) uartan receive shift register this is a shift register used to convert the serial data input to the rxdan pin into parallel data. upon reception of 1 byte of data and detection of the stop bit, the receive data is transferred to the uanrx register. this register cannot be manipulated directly. (7) uartan receive data register (uanrx) the uanrx register is an 8-bit register that holds receiv e data. when 7 characters are received, 0 is stored in the highest bit (when data is received lsb first). in the reception enabled status, receive data is transfe rred from the uartan receive shift register to the uanrx register in synchronization with the comple tion of shift-in processing of 1 frame. transfer to the uanrx register also causes the recept ion completion interrupt request signal (intuanr) to be output.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 724 (8) uartan transmit shift register the transmit shift register is a shift register used to convert the parallel data transferred from the uantx register into serial data. when 1 byte of data is transferred from the uantx register, the shift register data is output from the txdan pin. this register cannot be manipulated directly. (9) uartan transmit data register (uantx) the uantx register is an 8-bit transmit data buffer. tr ansmission starts when transmit data is written to the uantx register. when data can be wri tten to the uantx register (when dat a of one frame is transferred from the uantx register to the uartan transmit shift regi ster), the transmission enable interrupt request signal (intuant) is generated.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 725 15.4 registers (1) uartan control register 0 (uanctl0) the uanctl0 register is an 8-bit register that c ontrols the uartan serial transfer operation. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 10h. (1/2) uanpwr disable uartan operation (uartan reset asynchronously) enable uartan operation uanpwr 0 1 uartan operation control uanctl0 (n = 0 to 5) uantxe uanrxe uandir uanps1 uanps0 uancl uansl <6> <5> <4> 3 2 1 after reset: 10h r/w address: ua0ctl0 fffffa00h, ua1ctl0 fffffa10h, ua2ctl0 fffffa20h, ua3ctl0 fffffa30h, ua4ctl0 fffffa40h, ua5ctl0 fffffa50h the uartan operation is controlled by the uanpwr bit. the txdan pin output is fixed to high level by clearing the uanpwr bit to 0 (fixed to low level if uanopt0.uantdl bit = 1). <7> 0 disable transmission operation enable transmission operation uantxe 0 1 transmission operation enable ? to start transmission, set the uanpwr bit to 1 and then set the uantxe bit to 1. ? to initialize the transmission unit, clear the uantxe bit to 0, wait for two cycles of the base clock (f uclk ), and then set the uantxe bit to 1 again. otherwise, initialization may not be executed (for the base clock, see 15.7 (1) (a) base clock ). ? when the operation is enabled (uanpwr bit = 1), the transmission operation is enabled after two or more cycles of the base clock (f uclk ) have elapsed since uantxe = 1. ? when the uanpwr bit is cleared to 0, the status of the internal circuit becomes the same status as uantxe bit = 0 by the uanpwr bit even if the uantxe bit is 1. the transmission operation is enabled when the uanpwr bit is set to 1 again.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 726 (2/2) 7 bits 8 bits uancl note 0 1 specification of data character length of 1 frame of transmit/receive data 1 bit 2 bits uansl note 0 1 specification of length of stop bit for transmit data only the first bit of the receive data stop bits is checked, regardless of the value of the uansl bit. ? if ?reception with 0 parity? is selected during reception, a parity check is not performed. therefore, the uanstr.uanpe bit is not set. ? when transmission and reception are performed in the lin format, clear the uanps1 and uanps0 bits to 00. no parity output 0 parity output odd parity output even parity output reception with no parity reception with 0 parity odd parity check even parity check uanps1 note 0 0 1 1 parity selection during transmission parity selection during reception uanps0 note 0 1 0 1 msb-first transfer lsb-first transfer uandir note 0 1 transfer direction selection disable reception operation enable reception operation uanrxe 0 1 reception operation enable ? to start reception, set the uanpwr bit to 1 and then set the uanrxe bit to 1. ? to initialize the reception unit, clear the uanrxe bit to 0, wait for two cycles of the base clock, and then set the uanrxe bit to 1 again. otherwise, initialization may not be executed (for the base clock, see 15.7 (1) (a) base clock ). ? when the operation is enabled (uanpwr bit = 1), the reception operation is enabled after two or more cycles of the base clock (f uclk ) have elapsed since uanrxe = 1. if the start bit is received before the reception operation is enabled, the start bit is ignored. ? when the uanpwr bit is cleared to 0, the status of the internal circuit becomes the same status as uanrxe bit = 0 by the uanpwr bit even if the uanrxe bit is 1. the reception operation is enabled when the uanpwr bit is set to 1 again. note this register can be rewritten only when the uanpwr bit = 0 or the uantxe bit = uanrxe bit = 0. however, setting any or all of the uanpwr, uantxe, and uanrxe bits to 1 at the same time is possible. remark for details of parity, see 15.6.9 parity types and operations .
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 727 (2) uartan control register 1 (uanctl1) for details, see 15.7 (2) uartan control register 1 (uanctl1) . (3) uartan control register 2 (uanctl2) for details, see 15.7 (3) uartan control register 2 (uanctl2) . (4) uartan option control register 0 (uanopt0) the uanopt0 register is an 8-bit regist er that controls the serial transfer operation of the uartan register. this register can be read or written in 8-bit or 1-bit units. the uansrf bit is a read-only bit. reset sets this register to 14h. caution do not set the uansrt and uanstt bits (to 1) during sbf reception (uansrf bit = 1). (1/2) uansrf uanopt0 (n = 0 to 5) uansrt uanstt uansls2 uansls1 uansls0 uantdl uanrdl 654321 after reset: 14h r/w address: ua0opt0 fffffa03h, ua1opt0 fffffa13h, ua2opt0 fffffa23h, ua3opt0 fffffa33h, ua4opt0 fffffa43h, ua5opt0 fffffa53h <7> 0 when the uanctl0.uanpwr bit = uanctl0.uanrxe bit = 0 are set. also upon normal end of sbf reception. during sbf reception uansrf 0 1 sbf reception flag sbf reception trigger uansrt 0 1 sbf reception trigger ? sbf (sync brake field) reception is judged during lin communication. ? the uansrf bit is held at 1 when an sbf reception error occurs, and then sbf reception is started again. ? this is the sbf reception trigger bit during lin communication, and when read, ?0? is always read. for sbf reception, set the uansrt bit (to 1) to enable sbf reception. ? set the uansrt bit after setting both the uanpwr bit and uanrxe bit to 1. ? set the uansrt bit (to 1) during a period of 1 bit after the reception end interrupt request signal (intuanr) has been generated. (if this bit is set (to 1) during reception operation, the uansrf bit is cleared when reception of the current data is completed, even if sbf is not received.) ? writing 0 to the uansrt bit is valid. if 0 is written to the uansrt bit before sbf reception is started, therefore, sbf is not received but normal uart reception is executed. if 0 is written to the uanopt0 register during sbf reception, data that has already been received is received as sbf. if the data being received is not sbf, however, the following data operate as the receive data of uart, starting from the next receive data. the uansrf bit is cleared when 0 is written to the uansrt bit. ?
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 728 (2/2) uansls2 1 1 1 0 0 0 0 1 uansls1 0 1 1 0 0 1 1 0 uansls0 1 0 1 0 1 0 1 0 13-bit output (reset value) 14-bit output 15-bit output 16-bit output 17-bit output 18-bit output 19-bit output 20-bit output sbf transmit length selection ? the output level of the txdan pin can be inverted using the uantdl bit. ? this register can be set when the uanpwr bit = 0 or when the uantxe bit = 0. this register can be set when the uanpwr bit = 0 or when the uantxe bit = 0. normal output of transfer data inverted output of transfer data uantdl 0 1 transmit data level bit ? the input level of the rxdan pin can be inverted using the uanrdl bit. ? this register can be set when the uanpwr bit = 0 or the uanrxe bit = 0. ? when the uanrdl bit is set to 1 (inverted input of receive data), reception must be enabled (uanctl0.uanrxe bit = 1) after setting the data reception pin to the uart reception pin (rxdan) when reception is started. when the pin mode is changed after reception is enabled, the start bit will be mistakenly detected if the pin level is high. normal input of transfer data inverted input of transfer data uanrdl 0 1 receive data level bit ? this is the sbf transmission trigger bit during lin communication, and when read, ?0? is always read. ? set the uanstt bit after setting the uanpwr bit = uantxe bit = 1. ? writing 0 to the uanstt bit is valid. if 0 is written to this bit after 1 has been written to it and before it is sampled with the base clock, sbf transmission is therefore not executed. if 0 is written to the uanstt bit during sbf transmission, the uanstr.uantsf bit is cleared to 0 even though sbf transmission is executed. sbf transmission trigger uanstt 0 1 sbf transmission trigger ?
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 729 (5) uartan status register (uanstr) the uanstr register is an 8-bit register that displays t he uartan transfer status and reception error contents. this register can be read or written in 8-bit or 1-bi t units, but the uantsf bit is a read-only bit, while the uanpe, uanfe, and uanove bits can both be read and written. however, these bits can only be cleared by writing 0; they cannot be set by writing 1 (even if 1 is written to them, the value is retained). the initialization conditions are shown below. register/bit initialization conditions uanstr register ? reset ? uanctl0.uanpwr = 0 uantsf bit ? uanctl0.uantxe = 0 uanpe, uanfe, uanove bits ? 0 write ? uanctl0.uanrxe = 0 caution be sure to read the er ror flags of the uanpe, uanfe, an d uanove bits to check the flag status, and then clear the flags by writing ?0? to them.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 730 uantsf ? when the uanpwr bit = 0 or the uantxe bit = 0 has been set. ? when, following transfer completion, there was no next data transfer from uantx register write to uantx register uantsf 0 1 transfer status flag uanstr (n = 0 to 5) 0 0 0 0 uanpe uanfe uanove 6 5 4 3 <2> <1> after reset: 00h r/w address: ua0str fffffa04h, ua1str fffffa14h, ua2str fffffa24h, ua3str fffffa34h, ua4str fffffa44h, ua5str fffffa54h the uantsf bit is always 1 when performing continuous transmission. when initializing the transmission unit, check that the uantsf bit = 0 before performing initialization. the transmit data is not guaranteed when initialization is performed while the uantsf bit = 1. ? when the uanpwr bit = 0 or the uanrxe bit = 0 has been set. ? when 0 has been written when parity of data and parity bit do not match during reception. uanpe 0 1 parity error flag ? the operation of the uanpe bit is controlled by the settings of the uanctl0.uanps1 and uanctl0.uanps0 bits. ? the uanpe bit can be read and written, but it can only be cleared by writing 0 to it, and it cannot be set by writing 1 to it. when 1 is written to this bit, the value is retained. ? when the uanpwr bit = 0 or the uanrxe bit = 0 has been set ? when 0 has been written when no stop bit is detected during reception uanfe 0 1 framing error flag ? only the first bit of the receive data stop bits is checked, regardless of the value of the uanctl0.uansl bit. ? the uanfe bit can be both read and written, but it can only be cleared by writing 0 to it, and it cannot be set by writing 1 to it. when 1 is written to this bit, the value is retained . ? when the uanpwr bit = 0 or the uanrxe bit = 0 has been set. ? when 0 has been written when receive data has been set to the uanrx register and the next receive operation is completed before that receive data has been read uanove 0 1 overrun error flag ? when an overrun error occurs, the data is discarded without the next receive data being written to the uanrx register. ? the uanove bit can be both read and written, but it can only be cleared by writing 0 to it. when 1 is written to this bit, the value is retained . <7> <0> caution be sure to set bits 3 to 6 to ?0?.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 731 (6) uartan receive data register (uanrx) the uanrx register is an 8-bit buffer r egister that stores parallel data conver ted by the receive shift register. the data stored in the receive shift register is transfe rred to the uanrx register upon completion of reception of 1 byte of data. the reception end interrupt r equest signal (intuanr) is generated in this timing. during lsb-first reception when the data length has been s pecified as 7 bits, the receive data is transferred to bits 6 to 0 of the uanrx register and the msb always becomes 0. during msb-first reception, the receive data is transferred to bits 7 to 1 of the uanrx register and the lsb always becomes 0. when an overrun error (uanove) occurs, the receive data at this time is not transferred to the uanrx register and is discarded. this register is read-only, in 8-bit units. in addition to reset input, the uanrx register can be set to ffh by clearing the uanctl0.uanpwr bit to 0. uanrx (n = 0 to 5) 654321 after reset: ffh r address: ua0rx fffffa06h, ua1rx fffffa16h, ua2rx fffffa26h, ua3rx fffffa36h, ua4rx fffffa46h, ua5rx fffffa56h 7 0 (7) uartan transmit data register (uantx) the uantx register is an 8-bit register used to set transmit data. transmission starts when transmit data is written to t he uantx register in the transmission enabled status (uanctl0.uantxe bit = 1). when the data of the uantx register has been transferred to the transmit shift register, the transmission enable interr upt request signal (intuant) is generated. this register can be read or written in 8-bit units. reset sets this register to ffh. uantx (n = 0 to 5) 654321 after reset: ffh r/w address: ua0tx fffffa07h, ua1tx fffffa17h, ua2tx fffffa27h, ua3tx fffffa37h, ua4tx fffffa47h, ua5tx fffffa57h 7 0
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 732 15.5 interrupt request signals the following two interrupt request signals are generated from uartan. ? reception completion interrupt request signal (intuanr) ? transmission enable interrupt request signal (intuant) the default priority for these two interrupt request signals is reception completion interrupt request signal then transmission enable interrupt request signal. table 15-4. interrupts and their default priorities interrupt priority reception complete high transmission enable low (1) reception completion interrupt request signal (intuanr) a reception completion interrupt request signal is output when data is shifted into the receive shift register and transferred to the uanrx register in the reception enabled status. when a reception completion interrupt request signal is received and the data is read, read the uanstr register and check that the rec eption result is not an error. no reception completion interrupt request signal is generated in the reception disabled status. (2) transmission enable interr upt request signal (intuant) if transmit data is transferred from the uantx register to the uartan transmit shift register with transmission enabled, the transmission enable interrupt request signal is generated.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 733 15.6 operation 15.6.1 data format full-duplex serial data reception and transmission is performed. as shown in figure 15-2, one data frame of transmit/receive data consists of a start bit, character bits, parity bit, and stop bit(s). specification of the character bit length within 1 data frame, parity selection, s pecification of the stop bit length, and specification of msb/lsb-first transfer ar e performed using the uanctl0 register. moreover, control of uart output/inverted output for the txdan bit is performed using the uanopt0.uantdl bit. ? start bit ................. 1 bit ? character bits........ 7 bits/8 bits ? parity bit ................ even parity/odd parity/0 parity/no parity ? stop bit .................. 1 bit/2 bits
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 734 figure 15-2. uarta transmit/receive data format (a) 8-bit data length, lsb first, even parity, 1 stop bit, transfer data: 55h 1 data frame start bit d0 d1 d2 d3 d4 d5 d6 d7 parity bit stop bit (b) 8-bit data length, msb first, even parity, 1 stop bit, transfer data: 55h 1 data frame start bit d7 d6 d5 d4 d3 d2 d1 d0 parity bit stop bit (c) 8-bit data length, msb first, even parity, 1 stop bit, transfer data: 55h, txdan inversion 1 data frame start bit d7 d6 d5 d4 d3 d2 d1 d0 parity bit stop bit (d) 7-bit data length, lsb first, odd pa rity, 2 stop bits, transfer data: 36h 1 data frame start bit d0 d1 d2 d3 d4 d5 d6 parity bit stop bit stop bit (e) 8-bit data length, lsb first, no pa rity, 1 stop bit, transfer data: 87h 1 data frame start bit d0 d1 d2 d3 d4 d5 d6 d7 stop bit
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 735 15.6.2 sbf transmission/reception format the v850e/sj3-h and v850e/sk3-h have an sbf (sync break field) transmission/reception control function to enable use of the lin function. remark lin stands for local interconnect network and is a low-speed (1 to 20 kbps) serial communication protocol intended to aid the cost reduction of an automotive network. lin communication is single-master communicat ion, and up to 15 slaves can be connected to one master. the lin slaves are used to contro l the switches, actuators, and sensor s, and these are connected to the lin master via the lin network. normally, the lin master is connected to a network such as can (controller area network). in addition, the lin bus uses a single-wire method and is connected to the nodes via a transceiver that complies with iso9141. in the lin protocol, the master transmits a frame wit h baud rate information and the slave receives it and corrects the baud rate error. therefore, communicat ion is possible when the baud rate error in the slave is 15% or less. figures 15-3 and 15-4 outline the transmissi on and reception manipulations of lin. figure 15-3. lin transmissi on manipulation outline lin bus wake-up signal frame sync break field sync field identifier field data field data field check sum field intuant interrupt txdan (output) note 3 8 bits note 1 note 2 13 bits sbf transmission note 4 55h transmission data transmission data transmission data transmission data transmission notes 1. the interval between each field is controlled by software. 2. sbf output is performed by har dware. the output width is the bit length set by the uanopt0.uanslsl2 to uanopt0.uansls0 bits. if even finer output width adjustments are required, such adjustments can be performed us ing the uanctln.uanbrs7 to uanctln.uanbrs0 bits. 3. 80h transfer in the 8-bit mode is substituted for the wakeup signal frame. 4. a transmission enable interrupt request signal (intua nt) is output at the star t of each transmission. the intuant signal is also output at the start of each sbf transmission.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 736 figure 15-4. lin recepti on manipulation outline reception interrupt (intuanr) edge detection capture timer disable disable enable rxdan (input) enable note 2 13 bits sbf reception note 3 note 4 note 1 sf reception id reception data transmission data transmission note 5 data transmission lin bus wake-up signal frame sync break field sync field identifier field data field data field check sum field notes 1. the wakeup signal is sent by the pin edge detec tor, uartan is enabled, and the sbf reception mode is set. 2. the receive operation is performed until detection of the stop bit. upon detection of sbf reception of 11 or more bits, normal sbf reception end is judged, and an interrupt signal is output. upon detection of sbf reception of less than 11 bits, an sbf reception error is judged, no interrupt signal is output, and the mode returns to the sbf reception mode. 3. if sbf reception ends normally, an interrupt request signal is output. the timer is enabled by an sbf reception completion interrupt. moreover, error detection for the uanstr.uanove, uanstr.uanpe, and uanstr.uanfe bits is suppressed and uart communication error detection processing and uartan receive shift register and data transfer of the uanrx register are not performed. the uartan receive shift register holds the initial value, ffh. 4. the rxdan pin is connected to ti (capture input) of the timer, the tran sfer rate is calculated, and the baud rate error is calculated. the value of the uanctl2 register obtained by correcting the baud rate error after dropping uarta enable is set again, causing the status to become the reception status. 5. check-sum field distinctions are made by softwar e. uartan is initialized following csf reception, and the processing for setting the sbf reception mode again is performed by software.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 737 15.6.3 sbf transmission when the uanctl0.uanpwr bit = uanctl0.uantxe bit = 1, the transmission enabled status is entered, and sbf transmission is started by setting (to 1) the sbf transmission trigger (uanopt0.uanstt bit). thereafter, a low level the width of bits 13 to 20 specif ied by the uanopt0.uansls2 to uanopt0.uansls0 bits is output. a transmission enable interrupt request signal (intuant) is generated upon sbf transmission start. following the end of sbf transmission, the uanstt bit is autom atically cleared. thereafter, the uart transmission mode is restored. transmission is suspended until the data to be transmitted next is written to the uantx register, or until the sbf transmission trigger (uanstt bit) is set. figure 15-5. sbf transmission intuant interrupt txdan 12345678910111213 stop bit setting of uanstt bit
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 738 15.6.4 sbf reception the reception enabled status is achieved by setting the uanctl0.uanpwr bit to 1 and then setting the uanctl0.uanrxe bit to 1. the sbf reception wait status is set by setting the sbf reception trigger (uanopt0.uanstr bit) to 1. in the sbf reception wait status, sim ilarly to the uart reception wait stat us, the rxdan pin is monitored and start bit detection is performed. following detection of the start bit, rec eption is started and the in ternal counter counts up according to the set baud rate. when a stop bit is received, if the sbf width is 11 or more bits, normal processing is judged and a reception completion interrupt request signal (intuanr) is output. th e uanopt0.uansrf bit is aut omatically cleared and sbf reception ends. error detection for the uanstr.uanove, uanstr.uanpe, and uanstr.uanfe bits is suppressed and uart communication error detection processing is not performed. moreover, data transfer of the uartan reception shift register and uanrx regist er is not performed and ffh, the initial valu e, is held. if the sbf width is 10 or fewer bits, reception is terminated as error processi ng without outputting an interrupt, and the sbf reception mode is returned to. the uansrf bit is not cleared at this time. caution the lin function does not assume that sbf is transmitted while da ta is being received. consequently, if sbf is transm itted while data is being r eceived, a framing error occurs (uanstr.uanfe bit = 1). figure 15-6. sbf reception (a) normal sbf reception (detection of stop bit in more than 10.5 bits) uansrf rxdan 123456 11.5 7 8 9 10 11 intuanr interrupt (b) sbf reception error (detection of stop bit in 10.5 or fewer bits) uansrf rxdan 123456 10.5 78910 intuanr interrupt
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 739 15.6.5 uart transmission a high level is output to the txdan pin by setting the uanctl0.uanpwr bit to 1. next, the transmission enabled status is set by setting t he uanctl0.uantxe bit to 1, and transmission is started by writing transmit data to the uantx register. the st art bit, parity bit, and stop bit are automatically added. since the cts (transmit enable signal) input pin is not pr ovided in uartan, use a port to check that reception is enabled at the transmit destination. the data in the uantx register is tr ansferred to the uartan transmit shift register upon the start of the transmit operation. a transmission enable interrupt request signal (intuant) is generated upon completion of transmission of the data of the uantx register to the uartan transmit shift register , and thereafter the contents of the uartan transmit shift register are output to the txdan pin. write of the next transmit data to the uantx register is enabled after the intuant signal is generated. figure 15-7. uart transmission start bit d0 d1 d2 d3 d4 d5 d6 d7 parity bit stop bit intuant txdan remark lsb first
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 740 15.6.6 continuous transmission procedure uartan can write the next transmit data to the uantx regist er when the uartan transmit shift register starts the shift operation. the transmit timing of the uartan transmi t shift register can be judged from the transmission enable interrupt request signal (intuant). an efficient communication rate is realized by writing t he data to be transmitted next to the uantx register during transfer. caution when initializing transmis sions during the execution of contin uous transmissions, make sure that the uanstr.uantsf bit is 0, then perform the in itialization. transmit data that is initialized when the uantsf bit is 1 cannot be guaranteed. figure 15-8. continuous transmission processing flow start register settings uantx write yes yes no no occurrence of transmission interrupt? required number of writes performed? end
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 741 figure 15-9. continuous transmission operation timing (a) transmission start start data (1) data (1) txdan uantx transmission shift register intuant uantsf data (2) data (2) data (1) data (3) parity stop start data (2) parity stop start (b) transmission end start data (n ? 1) data (n ? 1) data (n ? 1) data (n) ff data (n) txdan uantx transmission shift register intuant uantsf uanpwr or uantxe bit parity stop stop start data (n) parity parity stop
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 742 15.6.7 uart reception the reception wait status is set by setting the uanctl0.uanpwr bit to 1 and then setting the uanctl0.uanrxe bit to 1. in the reception wait status, the rxdan pin is monitored and start bit detection is performed. start bit detection is performed using a two-step detection routine. first the rising edge of the rxdan pin is detected and sampling is started at the falling edge. the start bit is recognized if the rxdan pin is low level at the start bit sampling point. after a start bit has been recognized, the receive operation starts, and serial data is saved to the uart an receive shift register according to the set baud rate. when the reception completion interrupt request signal (i ntuanr) is output upon receptio n of the stop bit, the data of the uartan receive shift register is written to t he uanrx register. however, if an overrun error occurs (uanstr.uanove bit = 1), the receive data at this time is not written to the uanrx register and is discarded. even if a parity error (uanstr.uanpe bit = 1) or a framin g error (uanstr.uanfe bit = 1) occurs during reception, reception continues until the recepti on position of the first stop bit, and in tuanr is output following reception completion. figure 15-10. uart reception start bit d0 d1 d2 d3 d4 d5 d6 d7 parity bit stop bit intuanr rxdan uanrx remark v : sampling point of start bit cautions 1. be sure to read the uanrx register even when a reception error occurs. if the uanrx register is not read, an overrun error occurs during r eception of the next data, and reception errors continue occurring indefinitely. 2. the operation during recepti on is performed assuming that th ere is only one stop bit. a second stop bit is ignored. 3. when reception is completed, read the ua nrx register after the reception completion interrupt request signal (intuanr) has been ge nerated, and clear the uanpwr or uanrxe bit to 0. if the uanpwr or uanrxe bit is cleared to 0 before the intuan r signal is generated, the read value of the uanrx re gister cannot be guaranteed. 4. if receive completion processing (intuanr signal generation) of uartan and the uanpwr bit = 0 or uanrxe bit = 0 conflict, the intuan r signal may be generated in spite of these being no data stored in the uanrx register. to complete reception without waiting intuanr signal generati on, be sure to clear (0) the interrupt request flag (uanrif) of the uanric register, after se tting (1) the interrupt mask flag (uanrmk) of the interrupt control register (uan ric) and then set (1) the uanpwr bit = 0 or uanrxe bit = 0.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 743 15.6.8 reception errors errors during a receive operation are of three types: parity errors, framing errors, and overrun errors. data reception result error flags are set in the uanstr r egister and a reception completion interrupt request signal (intuanr) is output when an error occurs. it is possible to ascertain which error occurred during reception by reading the contents of the uanstr register. clear the reception error flag by writing 0 to it after reading it. ? receive data read flow start no intuanr signal generated? error occurs? end yes no yes error processing read uanrx register read uanstr register caution when an intuanr signal is generated, the ua nstr register must be read to check for errors. ? reception error causes error flag reception error cause uanpe parity error received parity bit does not match the setting uanfe framing error stop bit not detected uanove overrun error reception of next data completed before data was read from uanrx register
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 744 when reception errors occur, perform the followin g procedures depending upon the kind of error. ? parity error if false data is received due to problems such as noi se in the reception line, discard the received data and retransmit. ? framing error a baud rate error may have occurred between the recept ion side and transmission side or the start bit may have been erroneously detected. since this is a fatal error for the communication format, check the operation stop in the transmission side, perform initialization processing each other, and then start the communication again. ? overrun error since the next reception is completed before reading receiv e data, 1 frame of data is discarded. if this data was needed, do a retransmission. caution if a receive error interrupt occurs during cont inuous reception, read the contents of the uanstr register must be read before the next recepti on is completed, then pe rform error processing.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 745 15.6.9 parity types and operations caution when using the lin function, fix the uanps1 a nd uanps0 bits of the uanctl0 register to 00. the parity bit is used to detect bit errors in the comm unication data. normally the same parity is used on the transmission side and the reception side. in the case of even parity and odd parity, it is possible to detect odd-count bit errors. in the case of 0 parity and no parity, errors cannot be detected. (a) even parity (i) during transmission the number of bits whose value is ?1? among the transmi t data, including the parity bit, is controlled so as to be an even number. the parity bit values are as follows. ? odd number of bits whose value is ?1? among transmit data: 1 ? even number of bits whose value is ?1? among transmit data: 0 (ii) during reception the number of bits whose value is ?1? among the rec eption data, including the parit y bit, is counted, and if it is an odd number, a parity error is output. (b) odd parity (i) during transmission opposite to even parity, the number of bits whose value is ?1? among t he transmit data, including the parity bit, is controlled so that it is an odd number . the parity bit values are as follows. ? odd number of bits whose value is ?1? among transmit data: 0 ? even number of bits whose value is ?1? among transmit data: 1 (ii) during reception the number of bits whose value is ?1? among the receiv e data, including the parity bit, is counted, and if it is an even number, a parity error is output. (c) 0 parity during transmission, the parity bit is always made 0, regardless of the transmit data. during reception, parity bit check is not performed. therefore, no parity e rror occurs, regardless of whether the parity bit is 0 or 1. (d) no parity no parity bit is added to the transmit data. reception is performed assuming that ther e is no parity bit. no parity error occurs since there is no parity bit.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 746 15.6.10 receive data noise filter this filter samples signals received via the rxdan pi n using the base clock supplied by the dedicated baud rate generator. when the same sampling value is read twice, the match det ector output changes and the rxdan signal is sampled as the input data. therefore, data not exceeding 1 clock cy cle width is judged to be noise and is not delivered to the internal circuit (see figure 15-12 ). see 15.7 (1) (a) base clock for details of the base clock. moreover, since the circuit is as shown in figure 15-11, the processing that goes on wit hin the receive operation is delayed by 3 clocks in relation to the external signal status. figure 15-11. noise filter circuit match detector in base clock (f uclk ) rxdan qin ld_en q internal signal c internal signal b in q internal signal a figure 15-12. timing of rxdan signal judged as noise internal signal b base clock (f uclk ) rxdan (input) internal signal c mismatch (judged as noise) internal signal a mismatch (judged as noise) match match
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 747 15.7 dedicated baud rate generator the dedicated baud rate generator consists of a source clock selector block and an 8-bit programmable counter, and generates a serial clock during transmission and reception with uartan. regarding the serial clock, a dedicated baud rate generator output can be selected for each channel. there is an 8-bit counter for transmission and another one for reception. (1) baud rate generator configuration figure 15-13. configuration of baud rate generator f uclk selector uanpwr 8-bit counter match detector baud rate uanctl2: uanbrs7 to uanbrs0 1/2 uanpwr, uantxe bits (or uanrxe bit) uanctl1: uancks3 to uancks0 f xp f xp /2 f xp /4 f xp /8 f xp /16 f xp /32 f xp /64 f xp /128 f xp /256 f xp /512 f xp /1024 ascka0 note output clock note only uarta0 is valid; setting uart a1 to uarta5 is prohibited. caution uartan cannot be used if the cpu clock (f cpu ) is slower than f uclk . remarks 1. n = 0 to 5 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock f uclk : base clock frequency
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 748 (a) base clock when the uanctl0.uanpwr bit is 1, the cl ock selected by the uanctl1.uancks3 to uanctl1.uancks0 bits is supplied to the 8-bit counter. this clock is called the base clock (f uclk ). the base clock f uclk is fixed to the low level when the uanpwr bit is 0. (b) serial clock generation a serial clock can be generated by setting the uanctl1 register and the uanctl2 register (n = 0 to 5). the base clock (f uclk ) is selected by uanctl1.uancks3 to uanctl1.uancks0 bits. the frequency division value for the 8-bit count er can be set using the uanctl2.uanbrs7 to uanctl2.uanbrs0 bits.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 749 (2) uartan control register 1 (uanctl1) the uanctl1 register is an 8-bit register that selects the uartan base clock. this register can be read or written in 8-bit units. reset sets this register to 00h. caution clear the uanctl0.uanpwr bit to 0 before rewriting the uanctl1 register. 0 uanctl1 (n = 0 to 5) 0 0 0 uancks3 uancks2 uancks1 uancks0 654321 after reset: 00h r/w address: ua0ctl1 fffffa01h, ua1ctl1 fffffa11h, ua2ctl1 fffffa21h, ua3ctl1 fffffa31h, ua4ctl1 fffffa41h, ua5ctl1 fffffa51h 7 0 f xp f xp /2 f xp /4 f xp /8 f xp /16 f xp /32 f xp /64 f xp /128 f xp /256 f xp /512 f xp /1,024 external clock note (ascka0 pin) setting prohibited uancks2 0 0 0 0 1 1 1 1 0 0 0 0 uancks3 0 0 0 0 0 0 0 0 1 1 1 1 base clock (f uclk ) selection uancks1 0 0 1 1 0 0 1 1 0 0 1 1 uancks0 0 1 0 1 0 1 0 1 0 1 0 1 other than above note only uarta0 is valid; setting uart a1 to uarta5 is prohibited. remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 750 (3) uartan control register 2 (uanctl2) the uanctl2 register is an 8-bit register that selects the baud rate (serial transfer speed) clock of uartan. this register can be read or written in 8-bit units. reset sets this register to ffh. caution clear the uanctl0.uanpwr bit to 0 or clear the uantxe and uanrxe bits to 00 before rewriting the uanctl2 register. uanbrs7 uanctl2 (n = 0 to 5) uanbrs6 uanbrs5 uanbrs4 uanbrs3 uanbrs2 uanbrs1 uanbrs0 654321 after reset ffh r/w address: ua0ctl2 fffffa02h, ua1ctl2 fffffa12h, ua2ctl2 fffffa22h, ua3ctl2 fffffa32h, ua4ctl2 fffffa42h, ua5ctl2 fffffa52h 7 0 uan brs7 0 0 0 0 : 1 1 1 1 uan brs6 0 0 0 0 : 1 1 1 1 uan brs5 0 0 0 0 : 1 1 1 1 uan brs4 0 0 0 0 : 1 1 1 1 uan brs3 0 0 0 0 : 1 1 1 1 uan brs2 0 1 1 1 : 1 1 1 1 uan brs1 0 0 1 : 0 0 1 1 uan brs0 0 1 0 : 0 1 0 1 default (k) ? 4 5 6 : 252 253 254 255 serial clock f uclk /4 f uclk /5 f uclk /6 : f uclk /252 f uclk /253 f uclk /254 f uclk /255 setting prohibited remark f uclk : frequency of base clock frequency selected by the uanctl1.uancks3 to uanctl1.uancks0 bits
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 751 (4) baud rate the baud rate is obtained by the following equation. baud rate = [bps] when using the internal clock, the equation will be as follows (when using the ascka0 pin as clock at uarta0, calculate using the above equation). baud rate = [bps] remark f uclk = frequency of base clock selected by the uanctl1.uancks3 to uanctl1.uancks0 bits f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock m = value set using the uanctl1.uancks3 to uanctl1.uancks0 bits (m = 0 to 10) k = value set using the uanctl2.uanbrs7 to uanctl2.uanbrs0 bits (k = 4 to 255) f uclk 2 k f xp 2 m+1 k
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 752 the baud rate error is obtained by the following equation. error (%) = ? 1 100 [%] = ? 1 100 [%] when using the internal clock, the equation will be as follows (when using the ascka0 pin as clock at uarta0, calculate the baud rate error using the above equation). error (%) = ? 1 100 [%] cautions 1. the baud rate erro r during transmission must be wit hin the error tolerance on the receiving side. 2. the baud rate error during reception must satisfy the range indicated in (5) allowable baud rate range dur ing reception. remark f uclk = frequency of base clock selected by the uanctl1.uancks3 to uanctl1.uancks0 bits f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock m = value set using the uanctl1.uancks3 to uanctl1.uancks0 bits (m = 0 to 10) k = value set using the uanctl2.uanbrs7 to uanctl2.uanbrs0 bits (k = 4 to 255) actual baud rate (baud rate with error) target baud rate (correct baud rate) f uclk 2 k target baud rate f xp 2 m+1 k target baud rate
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 753 to set the baud rate, perform the following calculatio n and set the uanctl1 and uanctl2 registers (when using internal clock). <1> set k = f xp /(2 target baud rate). set m = 0. <2> set k = k/2 and m = m + 1 where k 256. <3> repeat <2> until k < 256. <4> roundup the first decimal place of k. if k = 256 by the roundup, perform <2> again (k will become 128). <5> set m to the uanctl1 register and k to the uanctl2 register. example: when f xp = 32 mhz and target baud rate = 153,600 bps <1> k = 32,000,000/(2 153,600) = 104.16?, m = 0 <2>, <3> k = 104.16? < 256, m = 0 <4> set value of uanctl2 register: k = 104 = 68h, set value of uanctl1 register: m = 0 actual baud rate = 32,000,000/(2 104) = 153,846 [bps] baud rate error = {32,000,000/(2 104 153,600) ? 1} 100 = 0.160 [%] the representative examples of baud rate settings are shown below. table 15-5. baud rate generator setting data f xp = 32 mhz f xp = 24 mhz f xp = 16 mhz baud rate (bps) uanctl1 uanctl2 err (%) uanctl1 uanctl2 err (%) uanctl1 uanctl2 err (%) 300 08h d0h 0.16 08h 9ch 0.16 07h d0h 0.16 600 07h d0h 0.16 07h 9ch 0.16 06h d0h 0.16 1200 06h d0h 0.16 06h 9ch 0.16 05h d0h 0.16 2400 05h d0h 0.16 05h 9ch 0.16 04h d0h 0.16 4800 04h d0h 0.16 04h 9ch 0.16 03h d0h 0.16 9600 03h d0h 0.16 03h 9ch 0.16 02h d0h 0.16 19200 02h d0h 0.16 02h 9ch 0.16 01h d0h 0.16 31250 02h 80h 0.00 01h c0h 0.00 01h 80h 0.00 38400 01h d0h 0.16 01h 9ch 0.16 00h d0h 0.16 76800 00h d0h 0.16 00h 9ch 0.16 00h 68h 0.16 153600 00h 68h 0.16 00h 4eh 0.16 00h 34h 0.16 312500 00h 33h 0.39 00h 26h 1.05 00h 1ah ? 1.54 625000 00h 1ah ? 1.54 00h 13h 1.05 00h 0dh ? 1.54 remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock err: baud rate error (%)
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 754 (5) allowable baud rate range during reception the baud rate error range at the destination that is allowable during reception is shown below. caution the baud rate error during reception must be set within the allowable error range using the following equation. figure 15-14. allowable baud rate range during reception fl 1 data frame (11 fl) flmin flmax uartan transfer rate start bit bit 0 bit 1 bit 7 parity bit minimum allowable transfer rate maximum allowable transfer rate stop bit start bit bit 0 bit 1 bit 7 parity bit latch timing stop bit start bit bit 0 bit 1 bit 7 parity bit stop bit remark n = 0 to 5 as shown in figure 15-14, the receive data latch timing is determined by the counter set using the uanctl2 register following start bit detection. the transmit data can be normally received if up to the last data (stop bit) can be received in time for this latch timing. when this is applied to 11-bit reception, t he following is the theoretical result. fl = (brate) ? 1 brate: uartan baud rate (n = 0 to 5) k: setting value of uanctl2.uanbrs7 to uanctl2.uanbrs0 bits (n = 0 to 5) fl: 1-bit data length latch timing margin: 2 clocks minimum allowable transfer rate: flmin = 11 fl ? fl = fl k ? 2 2k 21k + 2 2k
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 755 therefore, the maximum baud rate that can be re ceived by the destination is as follows. brmax = (flmin/11) ? 1 = brate similarly, obtaining the following maximum allowable transfer rate yields the following. flmax = 11 fl ? fl = fl flmax = fl 11 therefore, the minimum baud rate that can be received by the destination is as follows. brmin = (flmax/11) ? 1 = brate obtaining the allowable baud rate error for uartan and the destination from the above-described equations for obtaining the minimum and maximum baud rate values yields the following. table 15-6. maximum/minimum allowable baud rate error division ratio (k) maximum allowable baud rate error minimum allowable baud rate error 4 +2.32% ? 2.43% 8 +3.52% ? 3.61% 20 +4.26% ? 4.30% 50 +4.56% ? 4.58% 100 +4.66% ? 4.67% 255 +4.72% ? 4.72% remarks 1. the reception accuracy depends on the bit count in 1 frame, the input clock frequency, and the division ratio (k). the higher the input clock frequency and the larger the division ratio (k), the higher the accuracy. 2. k: setting value of uanctl2.uanbrs7 to uanctl2.uanbrs0 bits (n = 0 to 5) 10 11 k + 2 2 k 21k ? 2 2 k 21k ? 2 20 k 22k 21k + 2 20k 21k ? 2
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 756 (6) baud rate during cont inuous transmission during continuous transmission, the transfer rate from the stop bit to the next start bit is usually 2 base clocks longer. however, timing initialization is performed via st art bit detection by the receiving side, so this has no influence on the transfer result. figure 15-15. transfer rate during continuous transfer start bit bit 0 bit 1 bit 7 parity bit stop bit fl 1 data frame fl fl fl fl fl fl flstp start bit of 2nd byte start bit bit 0 assuming 1 bit data length: fl; stop bit length: flstp; and base clock frequency: f uclk , we obtain the following equation. flstp = fl + 2/f uclk therefore, the transfer rate during continuous transmission is as follows. transfer rate = 11 fl + (2/f uclk )
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 757 15.8 cautions (1) when clock supply to uartan is stopped when the clock supply to uartan is stopped (for exampl e, in idle1, idle2, or stop mode), the operation stops with each register retaining the value it had i mmediately before the clock supply was stopped. the txdan pin output also holds and outputs the value it had immediately before the clock supply was stopped. however, the operation is not guarant eed after the clock supply is resumed. therefore, after the clock supply is resumed, the circuits should be initialized by setting the uanctl0.uanpwr, uanctl0.uanrxen, and uanctl0.uantxen bits to 000. (2) use of the rxda1 and kr7 pins at the same time the rxda1 and kr7 pins must not be used at the same time. in the v850e/sk3-h, the rxda1 and kr7 pins are assigned to two ports each, and cannot be used at the same time at different ports. to use the rxda1 pin, set the krm.krm7 bit of the kr7 pin to 0. to use the kr7 pin, set the ua1ctl0.ua1rxe bit to 0 (it is recommended to set the pfc91 bit to 1 and pfce91 bit to 0 when using the kr7 pin at p91). (3) error during dma transfer in uartan, the interrupt caused by a communication error does not occur. when performing the transfer of transmit data and receive data using dma transfer, error processing cannot be performed even if errors (parity, overrun, framing) occur during transfer. either read the uanstr register after dma transfer has been completed to make sure that there are no errors, or read the uanstr register during communication to check for errors. (4) uartan startup sequence start up the uartan in the following sequence. <1> set the uanctl0.uanpwr bit to 1. <2> set the ports. <3> set the uanctl0.uantxe bit to 1, uanctl0.uanrxe bit to 1. (5) uartan stop sequence stop the uartan in the following sequence. <1> set the uanctl0.uantxe bit to 0, uanctl0.uanrxe bit to 0. <2> set the ports and set the uanctl0.uanpwr bit to 0 (it is not a problem if port setting is not changed). (6) writing the same value to the ua ntx register in transmit mode in transmit mode (uanctl0.uanpwr bit = 1 and uanctl0.uantxe bit = 1), do not overwrite the same value to the uantx register by software because transmission starts by writing to this register. to transmit the same value continuously, overwrite the same value. (7) continuous transmission in continuous transmission, the communication rate from the stop bit to the next start bit is extended 2 base clocks more than usual. however, the reception side init ializes the timing by detecting the start bit, so the reception result is not affected.
chapter 15 asynchronous serial interface a (uarta) user?s manual u19201ej3v0ud 758 (8) switching dma transfer start factor (a) switching dma transfer start factor between intua1r and intiic2 signals setting the dma transfer start factor to other than the following combinations is prohibited. <1> when using uarta1 and i 2 c02 simultaneously, and the intu a1r signal is specified as the dma transfer start factor (v850e/sk3-h only) when the dtfrn.ifcn5 to ifcn0 bits = 28h, set the dtfrob1 bit of the option byte 0000007ah (see chapter 33 option byte function ) to 1. this disables the dma transfer start factor for the intiic2 signal. therefore, a dma transfer st arts only when the intua1r signal is generated. even if the intiic2 signal is generated, dma transfer does not start. <2> when not using uarta1 and using only i 2 c02, and the intiic2 signal is specified as the dma transfer start factor when the dtfrn.ifcn5 to ifcn0 bits = 28h, set the dtfrob1 bit of the option byte 0000007ah to 0. a dma transfer starts when the intua1r or intiic2 signal is generated. <3> when not using i 2 c02 and using only uarta1, and the intu a1r signal is sp ecified as the dma transfer start factor when the dtfrn.ifcn5 to ifcn0 bits = 28h, set the dtfrob1 bit of the option byte 0000007ah to 0. a dma transfer starts when the intua1r or intiic2 signal is generated. remark for details, see table 22-1 dma transfer start factors . (b) switching dma transfer start factor between intua2r and intiic0 signals setting the dma transfer start factor to other than the following combinations is prohibited. <1> when using uarta2 and i 2 c00 simultaneously, and the intu a2r signal is specified as the dma transfer start factor (v850e/sk3-h only) when the dtfrn.ifcn5 to ifcn0 bits = 2ah, set the dtfrob1 bit of the option byte 0000007ah (see chapter 33 option byte function ) to 1. this disables the dma transfer start factor for the intiic0 signal. therefore, a dma transfer st arts only when the intua2r signal is generated. even if the intiic0 signal is generated, dma transfer does not start. <2> when not using uarta2 and using only i 2 c00, and the intiic0 signal is specified as the dma transfer start factor when the dtfrn.ifcn5 to ifcn0 bits = 2ah, set the dtfrob1 bit of the option byte 0000007ah to 0. a dma transfer starts when the intua2r or intiic0 signal is generated. <3> when not using i 2 c00 and using only uarta2, and the intu a2r signal is sp ecified as the dma transfer start factor when the dtfrn.ifcn5 to ifcn0 bits = 2ah, set the dtfrob1 bit of the option byte 0000007ah to 0. a dma transfer starts when the intua2r or intiic0 signal is generated. remark for details, see table 22-1. dma transfer start factors .
user?s manual u19201ej3v0ud 759 chapter 16 asynchronous serial interface b (uartb) 16.1 features ? transfer rate: maximum 1.5 mbps (using a dedicated baud rate generator) ? full-duplex communications ? single mode and fifo mode selectable ? single mode: 8-bit 1-stage data register (ubntx register or ubnrx register) is used for each of transmission and reception. ? fifo mode transmit fifon: ubntx register (8 bits 16 stages). receive fifon: ubnr xap register (16 bits 16 stages) the error information of a received data is stored in the higher 8 bits of the ub nrxap register. ? two-pin configuration txdbn: transmit data output pin rxdbn: receive data input pin ? reception error detection function ? overflow error (fifo mode only) ? parity error ? framing error ? overrun error (single mode only) ? interrupt sources: 5 types ? reception error interrupt request signal (intubntire) ? reception completion interrupt request signal (intubntir) ? transmission enable interrupt request signal (intubntit) ? fifo transmission completion interrupt r equest signal (intubnt if) (fifo mode only) ? reception timeout interrupt request si gnal (intubntito) (fifo mode only) ? the character length of transmit/receive data is specified according to the ubnctl0 register ? character length: 7 or 8 bits ? parity functions: odd, even, 0, or none ? transmission stop bits: 1 or 2 bits ? msb first/lsb first selectable for transfer data ? on-chip dedicated baud rate generator
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 760 16.2 configuration the block diagram of the uartbn is shown below. figure 16-1. block diagram of uartbn rxdbn internal bus receive shift register n uartbn control register 0 (ubnctl0) uartbn control register 2 (ubnctl2) uartbn status register (ubnstr) uartbnfifo control register 0 (ubnfic0) uartbnfifo control register 1 (ubnfic1) uartbnfifo control register 2 (ubnfic2) uartbnfifo status register 0 (ubnfis0) uartbnfifo status register 1 (ubnfis1) ubnrx receive fifon timeout counter sampling block receive controller transmit controller baud rate generator n reception unit transmission unit baud rate generator n transmit shift register n ubntx transmit fifon intubntito txdbn intubntif intubntit intubntir intubntire f xp remarks 1. f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock 2. for the configuration of the baud rate generator, see figure 16-8 .
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 761 uartbn consists of the following hardware units. table 16-1. configuration of uartbn item configuration registers uartbn control register 0 (ubnctl0) uartbn control register 2 (ubnctl2) uartbn status register (ubnstr) uartbn fifo control register 0 (ubnfic0) uartbn fifo control register 1 (ubnfic1) uartbn fifo control register 2 (ubnfic2) uartbn fifo status register 0 (ubnfis0) uartbn fifo status register 1 (ubnfis1) uartbn receive shift register uartbn receive data register ap (ubnrxap) uartbn receive data register (ubnrx) uartbn transmit shift register uartbn transmit data register (ubntx) (1) uartbn control register 0 (ubnctl0) this register controls the transfer operation of uartbn. (2) uartbn status register (ubnstr) this register indicates the transfer status during tr ansmission and the contents of a reception error. the status flag of this register, which indicates the transfe r status during transmission, indicates the data retention status of the transmit shift register n and the transmit data register n (the ubntx register in the single mode or transmit fifon in the fifo mode). each reception error flag is set to 1 when a reception error occurs, and cleared to 0 when 0 is written to the ubnstr register. (3) uartbn control register 2 (ubnctl2) this register is used to specify the division ratio by which to control the baud rate (serial transfer speed) of uartbn. (4) uartbn fifo contro l register 0 (ubnfic0) this register is used to select the operation mode of uartbn, clear t he transmit fifon/receive fifon that becomes valid in the fifo mode, an d specify the timing mode in whic h the transmission enable interrupt request signal (intubntit)/rec eption completion interrupt request signal (intubntir) occurs. (5) uartbn fifo contro l register 1 (ubnfic1) this register is valid in the fifo mode. it gener ates a reception timeout interrupt request signal (intubntito) if data is st ored in the receive fifon when the next da ta does not come (start bit is not detected) even after the reception wait time of the next data has elapsed after the stop bit has been received. (6) uartbn fifo contro l register 2 (ubnfic2) this register is valid in the fifo mode. it is used to set the timing to generate the transmission completion interrupt request signal (intubntit)/ reception completion interrupt request signal (intubntir), using the number of data transmitted or received as a trigger.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 762 (7) uartbn fifo status register 0 (ubnfis0) this register is valid in the fifo mode. the number of bytes of data stored in the receive fifon can be read from this register. (8) uartbn fifo status register 1 (ubnfis1) this register is valid in the fifo mode. the number of empty bytes of the transmit fifon can be read from this register. (9) uartbn receive shift register this is a shift register that conver ts the serial data that was input to the rxdbn pin into parallel data. one byte of data is received, and if a st op bit is detected, the received data is transferred to the receive data register n. this register cannot be directly manipulated. (10) uartbn receive data register ap (ubnrx ap), uartbn receive data register (ubnrx) the receive data register n holds receive data. in the single mode, the 8-bit 1-stage ubnrx register is used. the 16-bit 16-stage receive fifon (ubnrxap regist er) is used in the fifo mode. the receive data is stored in the lower 8 bits of the receive fifon (ubnrxap register) and the error information of the received data is stored in the higher 8 bi ts (bit 8 and bit 9). if a reception error (such as a parity error or a framing error) occurs in the fifo mode, the error data can be identified by reading the ubnrxap register in 16-bit (halfword) units (error in formation is appended as ub npef bit = 1 or ubnfef bit = 1). when the lower 8 bits of the ubnrxap register are read in 8-bit (byte) units, the higher 8 bits are discarded. therefore, if no error has occurred, only the receive data of the ubnrxap register can be read successively by being read in 8-bit (byte) units in the same way as the ubnrx register. when 7-bit length data is received with the lsb first, t he received data is transferred to bits 6 to 0 of the receive data register n from the lsb (bit 0), with the msb (bit 7) always being 0. when data is received with the msb first, the received data is transferred to bits 7 to 1 of the receive data regi ster n from the msb (bit 7), with the lsb (bit 0) always being 0. if an overrun error occurs, the receive data at that time is not transferred to the receive data register n. while reception is enabled, the received data is transfe rred from the receive shift register n to the receive data register n, in synchronization with the shift-in processing of one frame. a reception completion interrupt request signal (int ubntir) is generated by transferring the data to the ubnrx register in the single mode, or transferring the number of receive data set as the trigger by the ubnfic2.ubnrt3 to ubnfic2.ubnrt0 bits to receive fi fon in the fifo mode. if data is stored in receive fifon when the next data does not come (start bit is not detected) afte r the next data reception wait time specified by the ubnfic1.ubntc4 to ubnfic1.ubntc0 bits has elapsed in the fifon mode, a reception timeout interrupt request signal (intubntito) is generated. (11) uartbn transmit shift register this is a shift register that conver ts the parallel data that was transferre d from the transmit data register n into serial data. when one byte of data is transferred from the transmit dat a register n, the transmit shift register data is output from the txdbn pin. this register cannot be directly manipulated.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 763 (12) uartbn transmit data register (ubntx) the transmit data register n is a buffer for transmit data. the 8-bit 1-stage ubntx register is used as this buffer in the single mode. in the fifo mode, the 8-bit 16-stage transmit fifon is used. when 7-bit length data is transmitted with the lsb firs t, bits 6 to 0 of the transmit data register n are transmitted as the transmit data from the lsb (bit 0) with the msb (bit 7) always being 0. when data is transmitted with the msb first, bits 7 to 1 of the trans mit data register n are trans mitted as the transmit data from the msb (bit 7) with the lsb (bit 0) always being 0. in the single mode, transmission is st arted by writing transmit data to t he ubntx register while transmission is enabled (ubnctl0.ubntxe bit = 1). when writing t he transmit data to the ubntx register is enabled (when 1-byte data is transferred from the ubntx regist er to the transmit shift register n), a transmission enable interrupt request signal (intubntit) is generated. in the fifo mode, transmission is star ted by writing at least the number of transmit data set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits and 16 bytes or less to transmit fifon and then enabling transmission (ubntxe bit = 1). when the number of transmit data set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits have been tr ansferred from transmit fifon to the transmit shift register n (transmit data of the number set as the tr igger can be written), a transmission enable interrupt request signal (intubntit) is generated. in the fi fo mode, a fifo transmission completion interrupt request signal (intubntif) is gener ated when there is no more data in transmit fifon and the transmit shift register n (when fifo and the register become empty). (13) timeout counter this counter is used to recognize that data exists (remains) in receive fifon when the number of received data does not reach the number set as the trigger by the ubnfic2.ubnrt3 to ubnfic2.ubnrt0 bits, and is valid only in the fifo mode. if data is stored in receive fifo when the next data does not come (start bit is not detected) after the next data reception wait time specified by the ubnfic1.ub ntc4 to ubnfic1.ubntc0 bits has elapsed after the stop bit has been received, a reception timeout in terrupt request signal (intubntito) is generated. (14) sampling block this block samples the rxdbn signal at the rising edge of f xp . if the same sampling value is detected two times, output of the match detector changes, and the valu e is sampled as input data. data of less than one clock width is judged as noise and is not transmitted to the internal circuitry. remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 764 16.3 control registers (1) uartbn control register 0 (ubnctl0) the ubnctl0 register controls t he transfer operations of uartbn. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 10h. cautions 1. when using uartbn, set the external pins related to the uartbn function in the alternate-function mode, set uartbn control register 2 (ubnctl2). then set the ubnpwr bit to 1 before setting the other bits. 2. be sure to input a high level to the rxdbn pi n when setting the exter nal pins related to the uartbn function in the alternate-function m ode. if a low level is input, it is judged that a falling edge is input after the ubnrxe bit has been set to 1, and reception may be started. remark when reception is disabled, the receive shift register n does not detect a start bit. no shift-in processing or transfer processing to the receive da ta register n is performed, and the contents of the receive data register are retained. when reception is enabled, the receive shift oper ation starts, in synchronization with the detection of the start bit, and when the reception of one fram e is completed, the contents of the receive shift register n are transferred to t he receive data register n. a reception completion interrupt request signal (i ntubntir) is also generated, in synchronization with the transfer to the receive data register n (in fifo mode, transfer triggered by reaching set number of receive data). if data is stored in receive fifon when the next data does not come (s tart bit is not detected) after the next data reception wait time specified by the ubnfic1.ubntc4 to ubnfic1.ubntc0 bits has elapsed in the fifo mode, a reception timeout interrupt request signal (intubntito) is generated.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 765 (1/2) ubnpwr ubnctl0 (n = 0, 1) ubntxe ubnrxe ubndir ubnps1 ubnps0 ubncl ubnsl 32 1 after reset: 10h r/w address: ub0ctl0 fffffa80h, ub1ctl0 fffffaa0h 0 <4> <5> <6> <7> transmission is disabled transmission is enabled ubntxe 0 1 transmission enable ? on startup, set the ubnpwr bit to 1 and then set the ubntxe bit to 1. to stop transmission, clear the ubntxe bit to 0 and then the ubnpwr bit to 0. ? when the transmission unit status is to be initialized, the transmission status may not be able to be initialized unless the ubntxe bit is set to 1 again after an interval of two cycles of f xp has elapsed since the ubntxe bit was cleared to 0. stops supply of clocks to uartbn supplies clocks to uartbn ubnpwr 0 1 operation clock control to uartbn ? when the ubnpwr bit is cleared to 0, the uartbn can be asynchronously reset. ? when the ubnpwr bit = 0, uartbn is in a reset state. therefore, to operate uartbn, the ubnpwr bit must be set to 1. ? when the ubnpwr bit is changed from 1 to 0, all registers of uartbn are initialized. when the ubnpwr bit is set to 1 again, the uartbn registers must be set again. ? the txdbn pin output is high level when the ubpwr bit is cleared to 0. reception is disabled reception is enabled ubnrxe 0 1 reception enable ? on startup, set the ubnpwr bit to 1 and then set the ubnrxe bit to 1. to stop reception, clear the ubnrxe bit to 0 and then the ubnpwr bit to 0. ? when the reception unit status is to be initialized, the reception status may not be able to be initialized unless the ubnrxe bit is set to 1 again after an interval of two cycles of f xp has elapsed since the ubnrxe bit was cleared to 0. remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 766 (2/2) msb transfer first lsb transfer first ubndir 0 1 specification of transfer direction mode (msb/lsb) ? clear the ubnpwr bit or ubntxe and ubnrxe bits to 0 before changing the setting of the ubndir bit. do not output a parity bit output 0 parity output odd parity output even parity receive with no parity receive as 0 parity judge as odd parity judge as even parity ubnps1 0 0 1 1 parity selection during transmission parity selection during reception ubnps0 0 1 0 1 ? clear the ubntxe and ubnrxe bits to 0 before overwriting the ubnps1 and ubnps0 bits. ? if ?0 parity? is selected for reception, no parity judgment is made. therefore, no error interrupt is generated because the ubnstr.ubnpe bit is not set to 1. 7 bits 8 bits ubncl 0 1 specification of data character length of 1-frame transmit/receive data clear the ubntxe and ubnrxe bits to 0 before overwriting the ubncl bit. 1 bit 2 bits ubnsl 0 1 specification of stop bit length of transmit data ? clear the ubntxe and ubnrxe bits to 0 before overwriting the ubnsl bit. ? since reception always operates by using a single stop bit length, the ubnsl bit setting does not affect receive operations. remark for details of parity, see 16.6.6 parity types and corresponding operation .
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 767 (2) uartbn status register (ubnstr) the ubnstr register indicates the transfer status and reception error contents while uartbn is transmitting data. the status flag that indicates the tran sfer status during transmission indica tes the data retention status of the transmit shift register n and transmit data register n (t he ubntx register in the single mode or transmit fifon in the fifo mode). the status flag t hat indicates a reception error holds it s status until it is cleared to 0. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. caution when the ubnctl0.ubnpwr bi t or ubnctl0.ubnrxe bit is set to 0, or when 0 is written to the ubnstr register, th e ubnstr.ubnovf, ubnstr. ubnpe, ubnstr.ubnfe, and ubnstr.ubnove bits ar e cleared to 0.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 768 (1/2) ubntsf ubnstr ( n = 0, 1) 0 0 0 ubnovf ubnpe ubnfe ubnove <3> <2> <1> after reset: 00h r/w address: ub0str fffffa84h, ub1str fffffaa4h <0> 4 5 6 <7> overflow did not occur. overflow occurred (during reception). ? in single mode (ubnfic0.ubnmod bit = 0) data to be transferred to the transmit shift register n and ubntx register does not exist (cleared (0) when ubnctl0.ubnpwr bit = 0 or ubnctl0.ubntxe bit = 0). ? in fifo mode (ubnfic0.ubnmod bit = 1) data to be transferred to the transmit shift register n and transmit fifon does not exist (cleared (0) when ubnctl0.ubnpwr bit = 0 or ubnctl0.ubntxe bit = 0). ? in single mode (ubnfic0.ubnmod bit = 0) data to be transferred to the transmit shift register n or ubntx register exists (transmission in progress). ? in fifo mode (ubnfic0.ubnmod bit = 1) data to be transferred to the transmit shift register n and transmit fifon exists (transmission in progress). ubnovf 0 1 overflow flag ? the ubnovf bit is valid only in the fifo mode (when ubnfic0.ubnmod bit = 1), and invalid in the single mode (when ubnfic0.ubnmod bit = 0). ? if an overflow occurs, the received data is not written to receive fifon but discarded. the value of the ubntsf bit is reflected after two periods of f xp have elapsed, after the transmit data is written to the ubntx register. therefore, exercise care when referencing the ubntsf bit after transmit data has been written to the ubntx register. ubntsf 0 1 transfer status flag caution be sure to set bits 4 to 6 to ?0?. remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 769 (2/2) parity error did not occur. parity error occurred (during reception). ubnpe 0 1 parity error flag ? the ubnpe bit is valid only in the single mode (when ubnfic0.ubnmod bit = 0), and invalid in the fifo mode (when ubnfic0.ubnmod bit = 1). ? the operation of the ubnpe bit differs according to the settings of the ubnctl0.ubnps1 and ubnctl0.ubnps0 bits. framing error did not occur. framing error occurred (during reception). ubnfe 0 1 framing error flag ? the ubnfe bit is valid only in the single mode (when ubnfic0.ubnmod bit = 0), and invalid in the fifo mode (when ubnfic0.ubnmod bit = 1). ? only the first bit of the stop bits of the receive data is checked, regardless of the stop bit length. overrun error did not occur. overrun error occurred (during reception). ubnove 0 1 overrun error flag ? the ubnove bit is valid only in the single mode (when ubnfic0.ubnmod bit = 0), and invalid in the fifo mode (when ubnfic0.ubnmod bit = 1). ? when an overrun error occurs, the next receive data value is not written to the ubnrx register and the data is discarded.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 770 (3) uartbn control register 2 (ubnctl2) the ubnctl2 register is used to specify the division ra tio by which to control the baud rate (serial transfer speed) of uartbn. this register can be read or written in 16-bit units. reset sets this register to ffffh. caution when rewriting the ubnbrs 15 to ubnbrs0 bits of this re gister, set the ubnctl0.ubntxe and ubnctl0.ubnrxe bits to 0 or cl ear the ubnctl0.ubn pwr bit to 0. 14 ubn brs 14 13 ubn brs 13 12 ubn brs 12 2 ubn brs 2 3 ubn brs 3 4 ubn brs 4 5 ubn brs 5 6 ubn brs 6 7 ubn brs 7 8 ubn brs 8 9 ubn brs 9 10 ubn brs 10 11 ubn brs 11 15 ubn brs 15 1 ubn brs 1 0 ubn brs 0 ubnctl2 (n = 0, 1) after reset: ffffh r/w address: ub0ctl2 fffffa82h, ub1ctl2 fffffaa2h remark for the ubnbrs15 to ubnbrs0 bits, see table 16-2 division value of 16-bit counter . table 16-2. division value of 16-bit counter ubn brs 15 ubn brs 14 ubn brs 13 ubn brs 12 ubn brs 11 ubn brs 10 ubn brs 9 ubn brs 8 ubn brs 7 ubn brs 6 ubn brs 5 ubn brs 4 ubn brs 3 ubn brs 2 ubn brs 1 ubn brs 0 k output clock selected 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x x 4 f xp /k 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 4 f xp /k 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 5 f xp /k 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 6 f xp /k ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 65532 f xp /k 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 65533 f xp /k 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 65534 f xp /k 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 65535 f xp /k remarks 1. f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock 2. k: value set by the ubnctl2.ubnbrs15 to ub nctl2.ubnbrs0 bits (k = 4, 5, 6, ?, 65535) 3. x: don?t care
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 771 (4) uartbn transmit data register (ubntx) the ubntx register is used to set transmit data. it functions as the 8-bit 1-stage ubntx register, in the single mode (ubnfic0.ubnmod bit = 0), and as the 8-bit 16-stage transmit fifon in the fifo mode (ubnfic0.ubnmod bit = 1). in the single mode, transmission is started by writing transmit data to the ubntx register when transmission is enabled (ubnctl0.ubntxe bit = 1). when data can be written to the ubntx register (when 1 byte of data is transferred from the ubntx regi ster to the transmit shift register n), a transmission enable interrupt request signal (intub ntit) is generated. in the fifo mode, transmission is st arted by enabling transmission (ubntxe bi t = 1) after writing at least the number of transmit data set as the tr igger by the ubnfic2.ubntt3 to ub nfic2.ubntt0 bits and 16 bytes or less to transmit fifo. when the number of transmit dat a set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits have been transferred from transmi t fifon to the transmit shift register n (transmit data of the number set as the trigger can be written to transmit fifon), a transmission enable interrupt request signal (intubntit) is gener ated. in the fifo mode, a fifo transmission completion interrupt request signal (intubntif) is generat ed when there is no more data in transmit fifon and the transmit shift register n (when the fifo and register become empty). for the generation timing of the interrupt, see 16.4 interrupt request signals . when 7-bit length data is transmitted wit h the lsb first, bits 6 to 0 of the transmit data register n are transmitted as the transmit data from the lsb (bit 0) with the msb (bit 7) always being 0. when data is transmitted with the msb first, bits 7 to 1 of the trans mit data register n are transmitted as the transmit data from the msb (bit 7) with the lsb (bit 0) always being 0. this register is write-only in 8-bit units. da ta is written to the transmit data register n. reset sets this register to ffh. caution accessing the ubntx register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock a nd the main clock oscillation is stopped ? when the cpu operates with th e internal oscillation clock ubntd7 ubntx (n = 0, 1) ubntd6 5 ubntd5 ubntd4 3 ubntd3 2 ubntd2 1 ubntd1 ubntd0 0 4 6 7 after reset: ffh w address: ub0tx fffffa88h, ub1tx fffffaa8h
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 772 (5) uartbn receive data register ap (ubnrx ap), uartbn receive data register (ubnrx) these registers store parallel data converted by the rece ive shift register n. they function as the 8-bit 1- stage ubnrx register, in the single mode (ubnfic0.ubnmod bit = 0), and as the 16-bit 16-stage receive fifon (ubnrxap register) in the fifo mode (ubnfic0.ubnmod bit = 1). the receive data is stored in the lower 8 bits of the receive fifon (ubnrxap register) and the error information of the received data is stor ed in the higher 8 bits (bit 8 and bit 9). if a reception error (such as a parity error or a framing error) occurs in the fifo m ode, the ubnrxap register is read in 16-bit (halfword) units. in this way, the flag of the data stored in re ceive fifon can be checked (error information is appended as ubnpef bit = 1 or ubnfef bit = 1), so that the erro r data can be recognized (when the lower 8 bits of the ubnrxap register are read in 8-bit (byt e) units, the higher 8 bits are disc arded. therefore, if no error has occurred, the receive data of the ubnrxap register can be read successively by being read in 8-bit (byte) units in the same way as the ubnrx register). if reception is enabled (ubnctl0.ubnrxe bit = 1), the receive data is transferred from the receive shift register n to the receive data register n, in synchroni zation with the completion of the shift-in processing of one frame. by transferring the receive data to the ubnrx register in the single mode or by transferring the number of receive data set as the trigger by t he ubnfic2.ubnrt3 to ubnfic2.ubnrt0 bits to the receive fifon in the fifo mode, a reception completion interrupt request si gnal (intubntir) is generated. if data is stored in receive fifon when the next data does not come (start bit is not detected) even after the next data reception wait time specified by the ubnfic1.ubntc4 to ubnf ic1.ubntc0 bits has elapsed in the fifo mode, a reception timeout interrupt request signal (intubntito) is generated. for information about the timing for generating these interrupt requests, see 16.4 interrupt request signals . if data is received with the lsb first when the data l ength is specified as 7 bits, the received data is transferred to bits 6 to 0 of the receive data register n from the lsb (bit 0), with the msb (bit 7) always being 0. if data is received with the msb first, it is transferred to bits 7 to 1 of the receive data register n from the msb (bit 7) with the lsb (bit 0) always being 0. howeve r, if an overrun error occurs, the receive data at that time is not transferred to the receive data register n. the ubnrxap register is read-only in 16-bit units. however, the lower 8 bits of the ubnrxap register are read-only in 8-bit units. the ubnrx register is read-only in 8-bit units. in addition to reset input, the value of these registers can be set to ffh in the single mode or to 00ffh in the fifo mode, by clearing the ubnctl0.ubnpwr bit to 0. cautions 1. accessing the ubnrxap and ubnrx regi sters is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-chip peripheral i/o registers. ? when the cpu operates with the subclock a nd the main clock oscillation is stopped ? when the cpu operates with th e internal oscillation clock 2. the ubnpef and ubnfef bits cannot be read because these regist ers serve as 8-bit registers in the single mode. 3. when no reception error has occurred in the fifo mode , the receive data of the ubnrxap register can be re ad successively by reading the lower 8 bits of the ubnrxap register in 8-bit (byte) units. an 8- bit access to the higher 8 bits is prohibited. if they are accessed, the operation is not guaranteed.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 773 cautions 4. do not perform the following opera tions when debugging a system that uses the single mode. ? setting a break for an instruction immediat ely after the ubnrx register is read ? setting a break before dma transfer with the ubnrx register specifi ed as the transfer source is completed ? setting a break before completion of reception of the next data after reception of data and reading the ubnrx register, and checking the ubnrx register in the i/o register window of the debugger if any of these operations is performe d, an overrun error may occur during the subsequent reception. 14 0 13 0 12 0 2 ubn rd2 3 ubn rd3 4 ubn rd4 5 ubn rd5 6 ubn rd6 7 ubn rd7 8 ubn fef 9 ubn pef 10 0 11 0 15 0 1 ubn rd1 0 ubn rd0 ubnrxap (n = 0, 1) after reset: 00ffh r address: ub0rxap fffffa86h, ub1rxap fffffaa6h 2 ubnrd2 3 ubnrd3 4 ubnrd4 5 ubnrd5 6 ubnrd6 7 ubnrd7 1 ubnrd1 0 ubnrd0 ubnrx (n = 0, 1) after reset: ffh r address: ub0rx fffffa86h, ub1rx fffffaa6h no framing error framing error occurs (during reception). ubnfef 0 1 framing error flag ? the ubnfef bit is valid only in the fifo mode (ubnfic0.ubnmod bit = 1), and is invalid in the single mode (ubnfic0.ubnmod bit = 0). ? only the first bit of the stop bits of the receive data is checked, regardless of the stop bit length. no parity error parity error occurs (during reception). ubnpef 0 1 parity error flag ? the ubnpef bit is valid only in the fifo mode (ubnfic0.ubnmod bit = 1), and is invalid in the single mode (ubnfic0.ubnmod bit = 0). ? the operation of the ubnpef bit differs depending on the set values of the ubnctl0.ubnps1 and ubnctl0.ubnps0 bits. stores receive data. ubnrd7 to ubnrd0
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 774 (6) uartbn fifo contro l register 0 (ubnfic0) the ubnfic0 register is used to sele ct the operation mode of uartbn and the functions that become valid in the fifo mode (ubnmod bit = 1). in the fifo mode, it clears transmit fifon/ receive fifon and specifies the timing mode in which the transmission enable inte rrupt request signal (intub ntit)/reception completion interrupt request signal (i ntubntir) is generated. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 775 (1/3) ubnmod ubnfic0 (n = 0, 1) 0 0 0 ubntfc ubnrfc ubnitm ubnirm <3> <2> 1 after reset: 00h r/w address: ub0fic0 fffffa8ah, ub1fic0 fffffaaah 0 4 5 6 <7> normal status clear (this bit automatically returns to 0 after transmit fifo is cleared.) ubntfc 0 1 transmit fifon clear trigger bit ? the ubntfc bit is valid only in the fifo mode (ubnmod bit = 1), and is invalid in the single mode (ubnmod bit = 0). ? when 1 is written to the ubntfc bit, the pointer to transmit fifon is cleared to 0. in the pending mode (ubnitm bit = 0), the interrupt request signal (intubntit) held pending is cleared note . however, bit 7 (ubntitif) of the interrupt control register (ubntitic) is not cleared to 0. clear this bit to 0 as necessary. when 0 is written to the ubntfc bit, the status is retained. no operation, such as clearing or setting, is executed. ? when writing 1 to the ubntfc bit, be sure to clear the ubnctl0.ubntxe bit to 0 (disabling transmission). if 1 is written to the ubntfc bit when the ubntxe bit is 1 (transmission enabled), the operation is not guaranteed. single mode fifo mode ubnmod 0 1 specification of uartbn operation mode note after transmit fifon is cleared (ubntfc bit = 1), accessing the registers related to uartbn is prohibited for t he duration of f our cycles of f xp or until clearing the ubntfc bit (automatic recovery) is conf irmed by reading the ubnfic0 register. if these registers are accessed, the operation is not guaranteed. cautions 1. be sure to select the singl e mode when writing a transmit data or reading a received data by using th e dma control. in fifo mode, the use of the dma control is prohibited. 2. be sure to set bits 4 to 6 to ?0?. remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 776 (2/3) normal status clear (this bit automatically returns to 0 after receive fifon is cleared.) ubnrfc 0 1 receive fifon (ubnrxap) clear trigger bit in the fifo mode, the intubntit signal is generated as soon as transmit data of the number set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits have been transferred from transmit fifon to the transmit shift register n. after the intubntit signal request has been generated, specify the timing of actually generating the intubntit signal as the pending mode or pointer mode. for details, see 16.5 (2) pending mode/pointer mode . pending mode pointer mode ubnitm 0 1 specification of intubntit interrupt generation timing in fifo mode ? the ubnrfc bit is valid only in the fifo mode (ubnmod bit = 1), and is invalid in the single mode (ubnmod bit = 0). ? when 1 is written to the ubnrfc bit, the pointer to receive fifon is cleared to 0. in the pending mode (ubnirm bit = 0), the interrupt request signal (intubntir) held pending is cleared note . however, bit 7 (ubntirif) of the interrupt control register (ubntiric) is not cleared to 0. clear this bit to 0 as necessary. when 0 is written to the ubnrfc bit, the status is retained. no operation, such as clearing or setting, is executed. ? when writing 1 to the ubnrfc bit, be sure to clear the ubnctl0.ubnrxe bit to 0 (disabling reception). if 1 is written to the ubnrfc bit when the ubnrxe bit is 1 (reception enabled), the operation is not guaranteed. note after receive fifon (ubnrxap) is cleared (ubnrfc bit = 1), accessing the registers related to uartbn is prohibited fo r the duration of four cycles of f xp or until clearing the ubnrfc bit (automatic recovery) is confir med by reading the ubnfic0 register. if these registers are accessed, the operation is not guaranteed. remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 777 (3/3) pending mode pointer mode ubnirm 0 1 specification of intubntir interrupt generation timing in fifo mode in the fifo mode, the intubntir signal is generated as soon as receive data of the number set as the trigger by the ubnfic2.ubnrt3 to ubnfic2.ubnrt0 bits have been transferred from the receive shift register n to receive fifon. after the intubntir signal request has been generated, specify the timing of actually generating the intubntir signal as the pending mode or pointer mode. for details, see 16.5 (2) pending mode/pointer mode .
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 778 (7) uartbn fifo contro l register 1 (ubnfic1) the ubnfic1 register is valid in the fifo mode (ubnfic0.ubnmod bit = 1). it generates a reception timeout interrupt request signal (int ubntito) if data is stored in rece ive fifon when the next data does not come (start bit is not detected) after the lapse of t he time set by the ubntc4 to ubntc0 bits (next data reception wait time), after the stop bit has been received. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. ubntce ubnfic1 (n = 0, 1) 0 0 ubntc4 ubntc3 ubntc2 ubntc1 ubntc0 654321 after reset: 00h r/w address: ub0fic1 fffffa8bh, ub1fic1 fffffaabh <7> 0 32 bytes (32 8/baud rate) 31 bytes (31 8/baud rate) 30 bytes (30 8/baud rate) 29 bytes (29 8/baud rate) ? ? ? 4 bytes (4 8/baud rate) 3 bytes (3 8/baud rate) 2 bytes (2 8/baud rate) 1 byte (1 8/baud rate) ubntc3 0 0 0 0 ? ? ? 1 1 1 1 ubntc4 0 0 0 0 ? ? ? 1 1 1 1 next data reception wait time ubntc2 0 0 0 0 ? ? ? 1 1 1 1 ubntc1 0 0 1 1 ? ? ? 0 0 1 1 disable use of timeout counter function. enable use of timeout counter function. ubntce 0 1 specification of timeout counter function disable/enable when counting up of the reception wait time, set by the ubntc4 to ubntc0 bits, is complete, the count value of the timeout counter is cleared to 0, regardless of the status of the data stored in receive fifon. when the next start bit is later detected, counting is started again from the stop bit of that data. ubntc0 0 1 0 1 ? ? ? 0 1 0 1 caution be sure to set bits 5 and 6 to ?0?.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 779 (8) uartbn fifo contro l register 2 (ubnfic2) the ubnfic2 register is valid in t he fifo mode (ubnfic0.ubnmod bit = 1). it sets the timing of generating an interrupt, using the number of transmit/receive data as a trigger. when data is transmitted, the number of data transferred from transmit fifon is specified as t he condition of generating the interrupt. when data is received, the number of data stored in receive fifon is specified as the interrupt generation condition. this register can be read or written in 16-bit units. when the higher 8 bits of the ubnfic 2 register can be used as the ubnfic 2h register and the lower 8 bits, as the ubnfic2l register, these registers can be read or written in 8-bit units. reset sets the ubnfic2 register to 0000h and the ubnfic2h and ubnfic2l registers to 00h. caution be sure to set the ubnctl0.ubntxe bi t (to disable transmission) and ubnctl0.ubnrxe bit (to disable reception) to 0 be fore writing data to the ubnfic2 register. if data is written to the ubnfic2 register with the ubntxe or ubnrxe bit set to 1, the operation is not guaranteed. (1/2) ubntt2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 ubntt3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 ubntt1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 ubntt0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 14 0 13 0 12 0 2 ubn rt2 3 ubn rt3 4 0 5 0 6 0 7 0 8 ubn tt0 9 ubn tt1 10 ubn tt2 11 ubn tt3 15 0 1 ubn rt1 0 ubn rt0 ubnfic2 (n = 0, 1) after reset: 0000h r/w address: ub0fic2 fffffa8ch, ub1fic2 fffffaach 1 byte 2 bytes 3 bytes 4 bytes 5 bytes 6 bytes 7 bytes 8 bytes 9 bytes 10 bytes 11 bytes 12 bytes 13 bytes 14 bytes 15 bytes 16 bytes pointer mode pending mode ? set the number of transmit fifon transmit data to be the trigger. ? each time data of the specified number has shifted out from transmit fifon to the transmit shift register n, the intubntit signal is generated. in the pending mode (ubnfic0.ubnitm bit = 0), the intubntit signal is generated under the conditions of the pending mode. ? in the pointer mode (ubnfic0.ubnitm bit = 1), the number of transmit data set as the trigger can be only 1 byte (ubntt3 to ubntt0 bits = 0000), and other settings are prohibited. if a setting of other than 1 byte is made, the operation is not guaranteed. settable setting prohibited settable number of data of transmit fifon set as trigger caution be sure to set bits 4 to 7 and 12 to 15 to ?0?.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 780 (2/2) ubnrt2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 ubnrt3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 ubnrt1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 ubnrt0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 byte 2 bytes 3 bytes 4 bytes 5 bytes 6 bytes 7 bytes 8 bytes 9 bytes 10 bytes 11 bytes 12 bytes 13 bytes 14 bytes 15 bytes 16 bytes ? set the number of receive fifon receive data to be the trigger. ? each time data of the specified number has been stored from the receive shift register n to receive fifon, the intubntir interrupt is generated. in the pending mode (ubnfic0.ubnirm bit = 0), the intubntir signal is generated under the conditions of the pending mode. ? in the pointer mode (ubnfic0.ubnirm bit = 1), the number of receive data set as the trigger can be only 1 byte (ubnrt3 to ubnrt0 bits = 0000), and other settings are prohibited. if a setting of other than 1 byte is made, the operation is not guaranteed. pointer mode pending mode settable setting prohibited settable number of data of transmit fifon set as trigger
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 781 (9) uartbn fifo status register 0 (ubnfis0) the ubnfis0 register is valid in the fifo mode (ubnfic0 .ubnmod bit = 1). it is used to read the number of bytes of the data stored in receive fifon. this register is read-only in 8-bit units. reset sets this register to 00h. caution accessing the ubnfis0 register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock a nd the main clock oscillation is stopped ? when the cpu operates with th e internal oscillation clock 0 ubnfis0 (n = 0, 1) 0 0 ubnrb4 ubnrb3 ubnrb2 ubnrb1 ubnrb0 654321 after reset: 00h r address: ub0fis0 fffffa8eh, ub1fis0 fffffaaeh 7 0 0 bytes 1 byte 2 bytes 3 bytes 4 bytes 5 bytes 6 bytes 7 bytes 8 bytes 9 bytes 10 bytes 11 bytes 12 bytes 13 bytes 14 bytes 15 bytes 16 bytes invalid ubnrb3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 ubnrb4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 receive fifon pointer ubnrb2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 ubnrb1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 ubnrb0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 other than above indicates the number of bytes (readable bytes) of the data stored in receive fifon as a receive fifon pointer.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 782 (10) uartbn fifo status register 1 (ubnfis1) the ubnfis1 register is valid in the fifo mode (ubnfi c0.ubnmod bit = 1). this register can be used to read the number of empty bytes of transmit fifon. this register is read-only in 8-bit units. reset sets this register to 10h. cautions 1. accessing the ubnfis1 register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specifi c on-chip peripheral i/o registers. ? when the cpu operates with the subclock a nd the main clock oscillation is stopped ? when the cpu operates with th e internal oscillation clock 2. the values of the ubntb4 to ubntb0 bits are reflected after tran smit data has been written to the ubntx register a nd then time of two cycles of f xp has passed. therefore, care must be exercised when referencing the ubnfis1 regist er after transmit data has been written to the ubntx register. remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 783 0 ubnfis1 (n = 0, 1) 0 0 ubntb4 ubntb3 ubntb2 ubntb1 ubntb0 654321 after reset: 10h r address: ub0fis1 fffffa8fh, ub1fis1 fffffaafh 7 0 0 bytes 1 byte 2 bytes 3 bytes 4 bytes 5 bytes 6 bytes 7 bytes 8 bytes 9 bytes 10 bytes 11 bytes 12 bytes 13 bytes 14 bytes 15 bytes 16 bytes invalid ubntb3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 ubntb4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 transmit fifon pointer ubntb2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 ubntb1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 ubntb0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 setting prohibited indicates the number of empty bytes of transmit fifon (bytes that can be written) as a transmit fifon pointer.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 784 16.4 interrupt request signals the following five types of interrupt requests are generated from uartbn. ? reception completion interrupt request signal (intubntir) ? transmission enable interrupt request signal (intubntit) ? fifo transmission completion interrupt request signal (intubntif) ? reception error interrupt request signal (intubntire) ? reception timeout interrupt request signal (intubntito) the default priorities among these fi ve types of interrupt requests is, from high to low, reception completion interrupt request signal, transmission enable interrupt reques t signal, fifo transmission completion interrupt request signal, reception error interrupt request signal , and reception timeout interrupt request signal. table 16-3. generated inte rrupts and default priorities interrupt priority reception completion 1 transmission enable 2 fifo transmission completion 3 reception error 4 reception timeout 5 (1) reception error interrupt request signal (intubntire) (a) single mode when reception is enabled, a reception error interrupt request signal is generated according to the logical or of the three types of reception errors (parity error, framing error, overrun error) explained for the ubnstr register. when reception is disabled, no reception erro r interrupt request signal is generated. (b) fifo mode when reception is enabled, a reception error interrupt request signal is generated according to the logical or of the three types of reception errors (parity er ror, framing error, overflow error) explained for the ubnstr register. when reception is disabled, no reception erro r interrupt request signal is generated.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 785 (2) reception completion interrupt request signal (intubntir) (a) single mode when reception is enabled, a reception completion interr upt request signal is generated if data is shifted into the receive shift register n and stored in the ubnrx register (if the receive data can be read). when reception is disabled, no reception completion interrupt request signal is generated. (b) fifo mode when reception is enabled, a reception completion interr upt request signal is generated if data is shifted into the receive shift register n and receive da ta of the number set as the trigger by the ubnfic2.ubnrt3 to ubnfic2.ubnrt0 bits is trans ferred to receive fifon (if receive data of the specified number can be read). when reception is disabled, no reception completion interrupt request signal is generated. (3) transmission enable interrupt request signal (intubntit) (a) single mode the transmission enable interrupt request signal is gener ated if transmit data of one frame, including 7 or 8 bits of characters, is shifted out from the trans mit shift register n and the ubntx register becomes empty (if transmit data can be written). (b) fifo mode the transmission enable interrupt request signal is ge nerated if transmit data of the number set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bi ts is transferred to the transmit shift register n from transmit fifon (if transmit data of the specified number can be written). (4) fifo transmission completion in terrupt request signal (intubntif) (a) single mode cannot be used. (b) fifo mode the fifo transmission completion interrupt request sign al is generated when no more data is in transmit fifon and the transmit shift register n (when the fi fo and register become empty). after the fifo transmission completion interrupt request signal ha s occurred, clear the interrupt request signal (intubntit) held pending in the pending mode (ubnfi c0.ubnitm bit = 0) by clearing the fifo (ubnfic0.ubntfc bit = 1). caution if the fifo transmission completion inte rrupt request signal is generated (all transmit data are not transmitted) because writing the next transmit data to transmit fifon is delayed, do not clear the fifo.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 786 (5) reception timeout interrupt request signal (intubntito) (a) single mode cannot be used. (b) fifo mode the reception timeout interrupt request signal is ge nerated if data is stored in receive fifon when the next data does not come (start bit is not detected) ev en after the next data recept ion wait time specified by the ubnfic1.ubntc4 to ubnfic 1.ubntc0 bits has elapsed, when the timeout counter function is used (ubnfic1.ubntce bit = 1). the reception timeout interrupt request signal is not generated while reception is disabled. if receive data of the number set as the trigger by the ubnfic2.ubnrt3 to ubnfic2.ubnrt0 bits is not received, the timing of reading the number of rece ive data less than the specified number can be set by the reception timeout interrupt request signal. since the timeout counter starts counting at start bit detection, a receive timeout interrupt request signal does not occur if data of 1 character has not been received.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 787 16.5 control modes (1) single mode/fifo mode the single mode or fifo mode can be se lected by using the ubnfic0.ubnmod bit. caution be sure to select the singl e mode when writing a transmit da ta or reading a received data by using the dma control. in fifo mode, the use of the dma control is prohibited. (a) single mode ? each of the ubnrx and ubntx registers consists of 8 bits 1 stage. ? when 1 byte of data is received, the intubntir signal is generated. ? if the next reception operation of uartbn is co mpleted before the receive data of the ubnrx register is read after the intubntir signal has been generated, the intubntire signal is generated and an overrun error occurs. (b) fifo mode ? receive fifon (ubnrxap register) consists of 16 bits 16 stages and transmit fifon consists of 8 bits 16 stages. ? receive fifon can recognize error data by reading the 16-bit ubnrxap register only when a reception error (parity error or framing error) occurs. ? transmission is started when transmission is enabl ed (ubnctl0.ubntxe bit = 1) after transmit data of at least the number set as the trigger by the ub nfic2.ubntt3 to ubnfic2.ubntt0 bits and 16 bytes or less are written to transmit fifon. ? the pending mode or pointer mode can be select ed for the generation timing of the intubntit and intubntir signals.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 788 (2) pending mode/pointer mode the pending mode or pointer mode can be selected by using the ubnfic0.ubnitm and ubnfic0.ubnirm bits in the fifo mode (ubnfic0.ubnmod bit = 1). if transmission is started by writ ing data of more than double the amount set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits to transmi t fifon, the transmission enable interrupt request signal (intubntit) may occur more than once. th e reception completion interrupt request signal (intubntir) may also occur more than once if the number of receive data set as the trigger by the ubnfic2.ubnrt3 to ubnfic2.ubnrt0 bits is 8 bytes or less in receive fifon. in the pending or pointer mode, it can be specified how an interrupt is handled after it has been held pending. (a) pending mode (i) during transmission (wri ting to transmit fifon) ? if the data of the first transmission enable interr upt request signal (intubntit) is not written to transmit fifon after the interrupt has occurred, the second intubntit signal does not occur (is held pending) even if the generation condition of the second intubntit signal is satisfied (when transmit data of the number set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits is transferred from transmit fifon to the transmit shift register n). when data for the first intubntit signal is later written to transmit fifon, the pending intubntit signal is generated note . note the number of pending interrupts is as follows. when trigger is set to 1 byte (ubnfic2.ubntt3 to ubnfic2.ubntt0 bits = 0000): 15 times max. when trigger is set to 2 bytes (ubnfic2.ubntt 3 to ubnfic2.ubntt0 bits = 0001): 7 times max. : when trigger is set to 6 bytes (ubnfic2.ubntt 3 to ubnfic2.ubntt0 bits = 0101): 1 time max. when trigger is set to 7 bytes (ubnfic2.ubntt 3 to ubnfic2.ubntt0 bits = 0110): 1 time max. when trigger is set to 8 bytes (ubnfic2.ubntt 3 to ubnfic2.ubntt0 bits = 0111): 1 time max. ? in the pending mode, transmit data of the number set as the tr igger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits is always written to tr ansmit fifon when the transmission enable interrupt request signal (intubntit) occurs. writing data to transmit fifon is prohibited if the data is more or less than the specified number. if data more or less than the specified number is written, the operation is not guaranteed.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 789 (ii) during reception (reading from receive fifon) ? if data for the first reception completion inte rrupt request signal (intubntir) is not read from receive fifo, the second intubntir signal does not occur (is held pending) even if the generation condition of the second intubntir is sa tisfied (if receive data of the number set as the trigger by the ubnfic2.ubnrt3 to ubnfic2.ubnr t0 bits can be read from receive fifon). when data for the first intubntir signal is later read from the receive fifon, the pending intubntir signal is generated note . note the number of pending interrupts is as follows. when trigger is set to 1 byte (ubnfic2.ubnrt3 to ubnfic2.ubnrt0 bits = 0000): 15 times max. when trigger is set to 2 bytes (ubnfic2.ubnrt 3 to ubnfic2.ubnrt0 bits = 0001): 7 times max. : when trigger is set to 6 bytes (ubnfic2.ubnrt 3 to ubnfic2.ubnrt0 bits = 0101): 1 time max. when trigger is set to 7 bytes (ubnfic2.ubnrt 3 to ubnfic2.ubnrt0 bits = 0110): 1 time max. when trigger is set to 8 bytes (ubnfic2.ubnrt 3 to ubnfic2.ubnrt0 bits = 0111): 1 time max. ? in the pending mode, receive data of the number set as the tr igger by the ubnfic2.ubnrt3 to ubnfic2.ubnrt0 bits is always read from receiv e fifon when the reception completion interrupt request signal (intubntir) occurs. reading data from receive fifon is prohibited if the data is more or less than the specified number. if data more or less than the specified number is read, the operation is not guaranteed. (b) pointer mode (i) during transmission (wri ting to transmit fifon) ? each time the data of 1 byte is transferred to the transmit shift register n from transmit fifon, a transmission enable interrupt request signal (intubntit) occurs. ? in the pointer mode, be sure to fix the ubnfic 2.ubntt3 to ubnfic2.ubntt0 bits to 0000 (set number of transmit data: 1 byte) as the number of transmit data set as the trigger for transmit fifon when the transmission enable interrupt requ est signal (intubntit) occurs. if any other setting is made, the operation is not guaranteed. ? after the transmission enable interrupt reques t signal (intubntit) has been acknowledged, data of the number of empty bytes of transmit fifon c an be written to transmit fifon by referencing the ubnfis1 register.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 790 (ii) during reception (reading from receive fifon) ? each time the data of 1 byte is transferred to receive fifon from the receive shift register n, a reception completion interrupt request signal (intubntir) occurs. ? in the pointer mode, be sure to fix the ubnfic 2.ubnrt3 to ubnfic2.ubnrt0 bits to 0000 (set number of receive data: 1 byte) as the number of receive data set as the tr igger for receive fifo when the reception completion interrupt request signal (intubntir) occurs. if any other setting is made, the operation is not guaranteed. ? after the reception completion interrupt reque st signal (intubntir) has been acknowledged, data of the number of bytes stored in receive fifon can be read from receive fifon by referencing the ubnfis0 register. in some cases, however, dat a is not stored in receive fifon even though the intubntir signal is generated (ubnfis0.ubnrb4 to ubnfis0.ubnrb0 bits = 00000). in these cases, do not read data from receive fifon. always read data from receive fifon when the number of bytes stored in receive fifon is 1 byte or more (ubnrb4 to ubnrb0 bits = other than 00000).
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 791 16.6 operation 16.6.1 data format full-duplex serial data transmission and reception can be performed. the transmit/receive data format consis ts of one data frame containing a start bit, character bits, a parity bit, and stop bits as shown in figure 16-2. the character bit length within one data frame, the type of parity, and the stop bit length are specified by uartbn control register 0 (ubnctl0). also, data is transferred with lsb first/msb first. figure 16-2. asynchronous serial interface tran smit/receive data format (lsb-first transfer) 1 data frame start bit d0 d1 d2 d3 d4 d5 d6 d7 parity bit stop bits character bits ? start bit 1 bit ? character bits 7 bits or 8 bits ? parity bit even parity, odd parity, 0 parity, or no parity ? stop bits 1 bit or 2 bits
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 792 16.6.2 transmit operation in the single mode (ubnfic0.ubnmod bit = 0), transmission is enabled when the ubnctl0.ubntxe bit is set to 1, and transmission is started when transmit data is written to the ubntx register. in the fifo mode (ubnfic0.ubnmod bit = 1), transmission is started when transmit data of at least the number set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits and 16 bytes or less is written to transmit fifon and then the ubntxe bit is set to 1. caution setting the ubnctl0.ubntxe bit to 1 before writ ing transmit data to transmit fifon in the fifo mode is prohibited. the operation is not guaranteed if this setting is made. (1) transmission enabled state this state is set by the ubnctl0.ubntxe bit. ? ubntxe = 1: transmission enabled state ? ubntxe = 0: transmission disabled state since uartbn does not have a cts (transmission en abled signal) input pin, a port should be used to confirm whether the destination is in the reception enabled state. (2) starting a transmit operation ? in single mode (ubnfic0.ubnmod bit = 0) in the single mode, transmission is started when trans mit data is written to t he ubntx register while transmission is enabled. ? in fifo mode (ubnfic0.ubnmod bit = 1) in the fifo mode, transmission is star ted when transmit data of at leas t the number set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits and 16 by tes or less is written to transmit fifon and then transmission is enabled (ubntxe bit = 1). data in the transmit data register n (ubntx register in single mode or transmit fifon in the fifo mode) is transferred to the transmit shift register n when transmiss ion is started. then, the transmit shift register n outputs data to the txdbn pin sequentially beginn ing with the lsb (the transmit data is transferred sequentially starting with the start bit). the start bit, parity bit, and stop bits are added automatically.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 793 (3) transmission interrupt request signal (a) transmission enable interr upt request signal (intubntit) ? in single mode (ubnfic0.ubnmod bit = 0) in the single mode, the transmission enable interrupt request signal (intubntit) occurs when transmit data can be written to the ubntx r egister (when 1 byte of data is tr ansferred from the ubntx register to the transmit shift register n). ? in fifo mode (ubnfic0.ubnmod bit = 1) in the fifo mode, the intubntit si gnal occurs when transmit data of the number set as the trigger specified by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits is transferred from transmit fifon to the transmit shift register n (if transmit data of the number set as the trigger can be written). ? if pending mode is specified (ubnfic0.ubnitm bit = 0) in fifo mode if the pending mode is specified in the fifo mode, the second intubntit signal is held pending after the first intubntit signal has occurred, until as many transmit data as the number set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits are written to transmit fifon, even if the generation condition of the second intubntit signal is satisfied. when as many transmit data as the number set as the trigger are written to transmit fifon in re sponse to the first intubntit signal, the second pending intubntit signal is generated. ? if pointer mode is specified (ubnfic0.ubnitm bit = 1) in fifo mode if the pointer mode is specified in the fifo mode, the second intubntit signal occurs when the generation condition of the second intubntit signal is satisfied even if as many transmit data as the number set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits are not written to transmit fifon when the first intubntit signal occurs. (b) fifo transmission completion in terrupt request signal (intubntif) the fifo transmission completion interrupt request si gnal (intubntif) occurs when no more data is in transmit fifo and the transmit shift register n in the fifo mode (ubnfic0.ubnmod bit = 1). after the intubntif signal has occurred, clear the pending intubntit signal in the pending mode (ubnfic0.ubnitm bit = 0) by clearing the fifo (u bnfic0.ubntfc bit = 1). if the intubntif signal occurs because writing the next transmit data to tr ansmit fifon is delayed (if all transmit data have not been transmitted), do not clear the fifo. if the data to be transmitted next has not been written to the transmit data register n, the transmit operation is suspended. caution in the single mode, the transmission enable interrupt re quest signal (intubntit) occurs when the ubntx register becomes empty (when 1 byte of data is transferred from the ubntx register to the transmit shift register n). in the fifo mode, the fifo transmission completion interrupt request signal (intubntif) o ccurs when data is no longer in transmit fifon and the transmit shift re gister n (when the fifo and register are empty). however, the intubntit signal or intubntif signal is not generated if the tran smit data register n becomes empty due to reset input.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 794 figure 16-3. timing of asynchronous serial interf ace transmission enable in terrupt request signal (intubntit) start stop d0 d1 d2 d6 d7 parity txdbn (output) intubntit (output) remark in the fifo mode, the intubntit signal occurs at the above timing when as many transmit data as the number set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits are serially transferred. figure 16-4. timing of asynchronous serial interf ace fifo transmission comple tion interrupt request signal (intubntif) start stop d0 d1 d2 d6 d7 parity txdbn (output) intubntif (output) remark the intubntif signal occurs at the above timing when data is no longer in transmit fifon and the transmit shift register n (when t he fifo and register are empty).
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 795 16.6.3 continuous transmission operation cautions 1. be sure to check whether the transmission has been completed before performing initialization during the tran smission processing (ubnstr.ubnts f bit = 0, but it can be checked by the generation of the fifo tran smission completion interrupt request signal (intubntif) in the fifo mode.) 2. be sure to select the single mode when writing a transmit data or reading a received data by using the dma control. in fifo mode, th e use of the dma control is prohibited. ? in single mode (ubnfic0.ubnmod bit = 0) in the single mode, the next data can be written to the ub ntx register as soon as the transmit shift register n has started a shift operation. the timing of transfe r can be identified by the transmission enable interrupt request signal (intubntit). by wr iting the next transmit data to the ubntx register via the intubntit signal within one data frame transmission period, data can be transmitted without an interval and an efficient communication rate can be realized. ? if pending mode is specified (ubnfic0.ubnitm bit = 0) in fifo mode if transmit data of at least the number set as the tran smit trigger by ubnfic2.ubntt3 to ubnfic2.ubntt0 bits and 16 bytes or less is written to transmit fifon, transmission starts. if the pending mode is specified in the fifo mode, as many of the next tr ansmit data as the number set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits can be written to transmit fifon as soon as the transmit shift register n has started shifting the last data of the specified number of data. the timing of transfer can be identified by the intubntit signal. by writing as many of the next transmit data as the number set as the trigger to transmit fifon or writing the next trans mit data to the transmit fifon within the transmission period of the data in transmit fifo n via the intubntit signal, data can be transmitted without an interval and an efficient communication rate can be realized. ? if pointer mode is specified (ubnfic0.ubnitm bit = 1) in fifo mode if the pointer mode is specified in the fifo mode, a intubntit signal o ccurs and the next data can be written to transmit fifon as soon as the transmit shift register n has started shifting the number of transmit data set as the trigger. at this time, as many data as the numbe r of empty bytes of transmi t fifon can be written by referencing the ubnfis1 register. the timing of transfer can be identified by the intubntit signal. by writing as many of the next transmit data as the number specified as the trigger to transmit fi fon or writing the next transmit data to the transmit fifon within the transmiss ion period of the data in transmit fifon via the intubntit signal, data can be transmitted without an inte rval and an efficient communication rate can be realized.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 796 16.6.4 receive operation the awaiting reception state is set by setting th e ubnctl0.ubnpwr bit to 1 and then setting the ubnctl0.ubnrxe bit to 1. rxdbn pin sampling begins and a start bit is detected. when the start bit is detected, the receive operation begins, and data is stored sequentially in the receive shift register n according to the baud rate that was set. in the single mode (ubnfic0.ubnmod bit = 0), a recepti on completion interrupt request signal (intubntir) is generated each time the reception of one frame of data is completed. normally, the receive data is transferred from the ubnrx register to memory by this interrupt servicing. in the fifo mode (ubnfic0.ubnmod bi t = 1), the intubntir signal occurs when as many receive data as the number set as the trigger by the ubnfic2.ubnrt3 to ubnfic2.ubnrt0 bits are transferred to receive fifon. if the pending mode is specified (ubnfic0.ubnirm bit = 0) in the fifo mode, as many receive data as the number set as the trigger by the ubnfic2.ubnrt3 to ubnfic2.ubnrt0 bits can be read from receive fifo. if the pointer mode is specified (ubnfic0.ubnirm bit = 1) in the fifo mode, as many data as the number of bytes stored in receive fifon (0 bytes or more) can be read from receive fifon by referencing the number of receive data specified as the trigger by the ubnrt3 to ubnrt0 bits (1 byte) or the ubnfis0 register. cautions 1. if the pointer mode is specified in th e fifo mode and if as ma ny data as the number of bytes stored in receive fifon are read by refe rencing the ubnfis0 register, no data may be stored in receive fifon ( ubnfis0.ubnrb4 to ubnfis0.ubn rb0 bits = 00000) even though the reception completion interrupt request signa l (intubntir) has occu rred. in this case, do not read data from receive fifon. be su re to read data from receive fifon after confirming that the number of bytes stored in receive fifon = 1 byte or more (ubnrb4 to ubnrb0 bits = other than 00000). 2. be sure to select the singl e mode when reading a received data by using the dma control. in fifo mode, use of the dma control is prohibited. (1) reception enabled state this state is set by the ubnctl0.ubnrxe bit. ? ubnrxe = 1: reception enabled state ? ubnrxe = 0: reception disabled state in the reception disabled state, t he reception hardware stands by in the initial state. at this time, the reception completion interrupt request signal or recept ion error interrupt request signal does not occur, and the contents of the receive data regi ster n (ubnrx register in the single mode or receive fifon in the fifo mode (ubnrxap register)) are retained. (2) starting a receive operation a receive operation is started by the detection of a start bit. the rxdbn pin is sampled using the serial clo ck from uartbn control register 2 (ubnctl2).
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 797 (3) reception interrupt request signal (a) reception completion interrupt request signal (intubntir) ? in single mode (ubnfic0.ubnmod bit = 0) when ubnctl0.ubnrxe bit = 1 and the reception of on e frame of data is completed (the stop bit is detected) in the single mode, a reception completion interrupt request signal (intubntir) is generated and the receive data in the receive shift register n is transferred to the ubnrx register at the same time. also, if an overrun error occurs, the receive data at t hat time is not transferred to the ubnrx register, and a reception error interrupt request signal (intubntire) is generated. if a parity error or framing error occurs during the reception operation, the reception operation continues up to the position at which the stop bit is received. after completion of reception, an intubntire signal occurs (the receive data in the re ceive shift register n is transferred to the ubnrx register). if the ubnrxe bit is reset (0) during a receive operati on, the receive operation is immediately stopped. at this time, the contents of the ubnrx register remain unchanged, t he contents of the uartbn status register (ubnstr) are cleared, and the intu bntir and intubntire signals do not occur. no intubntir signal is generated when the ubnrxe bit = 0 (reception is disabled). ? in fifo mode (ubnfic0.ubnmod bit = 1) in the fifo mode, the reception completion interrupt request signal (intubntir) occurs when data of one frame has been received (stop bit is detected) and when as many receive data as the number specified as the trigger by the ubnfic2.ubnrt3 to ubnfic2.ubnrt0 bits are transferred from the receive shift register to receive fifon. if an overfl ow error occurs, the receive data is not transferred to receive fifon and the reception error inte rrupt request signal (intubntire) occurs. if a parity error or framing error occurs during re ception, reception contin ues up to the reception position of the stop bit. after re ception has been completed, the intubntire signal occurs and the receive data in the receive shift register n is transferre d to receive fifon. at th is time, error information is appended as the ubnrxap.ubnpef or ubnrxap.ub nfef bit = 1. if the intubntire signal occurs, the error data can be recognized by readi ng receive fifon as a 16-bit register, ubnrxap.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 798 (b) reception timeout interrupt request signal (intubntito) ( only in fifo mode) when the timeout counter function (ubnfic1.ubntce bi t = 1) is used in the fifo mode, the reception timeout interrupt request signal (intubntito) occurs if the next data does not come even after the next data reception wait time specified by the ubnfic1.ubntc4 to ubnfic 1.ubntc0 bits has elapsed and if data is stored in receive fifon. the intubntito signal does not o ccur while reception is disabled. if as many receive data as the number set as the tr igger by the ubnfic2.ubnr t3 to ubnfic2.ubnrt0 bits are not received, the timing of reading less re ceive data than the specified number can be set by the intubntito signal. since the timeout counter starts counting at start bit detection, a receive timeout interrupt request signal does not occur if data of 1 character has not been received. figure 16-5. timing of asynchronous serial inte rface reception completion interrupt request signal (intubntir) start d0 d1 d2 d6 d7 rxdbn (input) intubntir (output) receive data register parity stop cautions 1. be sure to read all the data (th e number of data indicated by the ubnfis0.ubnrb4 to ubnfis0.ubnrb0 bits) stored in the receive data register n (ubnrx register in the single mode or receive fifon in the fifo mode ( ubnrxap register)) even when a reception error occurs. unless the receive data register is read, an overrun error occurs when the next data is received, causing the reception error status to persist. if the pending mode is specified in the fi fo mode, however, be sure to clear the fifo (ubnfic0.ubnrfc bit = 1) after readi ng the data stored in receive fifon. in the fifo mode, the fifo can be clear ed even without reading the data stored in receive fifon. if a parity error or framing error occurs in the fifo mode, the ubnrxap register can be read in 16-bit (halfword) units. 2. data is alwa ys received with one stop bit (1). a second stop bit is ignored.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 799 16.6.5 reception error in the single mode (ubnfic0.ubnmod bit = 0), the three types of errors that can occur during a receive operation are a parity error, framing error, and overrun error. in the fifo mode (ubnfic0.ubnmod bit = 1), the three types of errors that can occur during a receive operation are a parity error, framing error, and overflow error. as a result of data reception, the ubnstr.ubnpe, ubnstr.ubnfe, or ubnstr.u bnove bit is set to 1 if a parity error, framing error, or overrun error occurs in the single mo de. the ubnstr.ubovf bit is set to 1 if an overflow error occurs in the fifo mode. the ubnrxap.ubnpef or ubnrxap.u bnfef bit is set to 1 if a parity error or framing error occurs in the fifo mode. at the same time, a receptio n error interrupt request signa l (intubntire) occurs. the contents of the error can be detected by reading th e contents of the ubnstr or ubnrxap register. the contents of the ubnstr r egister are reset when 0 is written to t he ubnovf, ubnpe, ubnfe, or ubnove bit, or the ubnctl0.ubnpwr or ubnctl0.ubnrxe bit. the contents of the ubnrxap register are reset when 0 is written to the ubnctl0.ubnpwr bit. table 16-4. reception error causes error flag valid operation mode error flag reception error cause ubnpe ubnpe parity error the parity specification during transmission does not match the parity of the receive data ubnfe ubnfe framing error no stop bit detected ubnove single mode ubnove overrun error the reception of the next data is completed before data is read from the ubnrx register ubnovf ubnovf overflow error the recept ion of the next data is completed while receive fifon is full and before data is read. ubnpef ubnpef parity error the parit y specification during transmission does not match the parity of the data to be received. ubnfef fifo mode ubnfef framing error the stop bit is not detected when the target data is loaded.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 800 16.6.6 parity types and corresponding operation a parity bit is used to detect a bit error in communication data. normally, the same type of parity bit is used at the transmission and reception sides. (1) even parity (a) during transmission the parity bit is controlled so t hat the number of bits with the valu e ?1? within the transmit data including the parity bit is even. the parity bit value is as follows. ? if the number of bits with the value ?1? within the transmit data is odd: 1 ? if the number of bits with the value ?1 ? within the transmit data is even: 0 (b) during reception the number of bits with the value ?1? within the receive data includi ng the parity bit is counted, and a parity error is generated if this number is odd. (2) odd parity (a) during transmission in contrast to even parity, the parity bit is controlled so that the number of bits with the value ?1? within the transmit data including the parity bit is odd. the parity bit value is as follows. ? if the number of bits with the value ?1? within the transmit data is odd: 0 ? if the number of bits with the value ?1 ? within the transmit data is even: 1 (b) during reception the number of bits with the value ?1? within the receive data includi ng the parity bit is counted, and a parity error is generated if this number is even. (3) 0 parity during transmission the parity bit is set to ?0? regardless of the transmit data. during reception, no parity bit check is performed. therefore, no parity error is generated regardless of whether the parity bit is ?0? or ?1?. (4) no parity no parity bit is added to the transmit data. during reception, the receive operation is performed as if there were no parity bit. since there is no parity bit, no parity error is generated.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 801 16.6.7 receive data noise filter the rxdbn signal is sampled at the rising edge of the peripheral clock (f xp ). if the same sampling value is obtained twice, the match detector output changes, and this output is sampled as input data. therefore, data not exceeding one clock width is judged to be noise and is not delivered to the internal circuit (see figure 16-7 ). also, since the circuit is configured as shown in figure 16-6, internal processing during a receive operation is delayed by up to 2 clocks according to the external signal status. figure 16-6. noise filter circuit rxdbn q f xp in ld_en q in internal signal a internal signal b match detector remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 802 figure 16-7. timing of rx dbn signal judg ed as noise internal signal a f xp rxdbn (input) internal signal b match mismatch (judged as noise) mismatch (judged as noise) match remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 803 16.7 dedicated baud rate generator (brg) a dedicated baud rate generator, which consists of a 16 -bit programmable counter, generates serial clocks during transmission/reception in uartbn. the dedicated baud rate generator output can be selected as the serial clock for each channel. separate 16-bit counters exist for transmission and for recept ion. the baud rate for transmission/reception is the same at the same channel. (1) baud rate genera tor configuration figure 16-8. baud rate generator configuration clock 16-bit counter match detector baud rate ubnctl2.ubnbrs15 to ubnctl2.ubnbrs0 1/2 ubnpwr, ubntxe (or ubnrxe) f xp output clock remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock (a) base clock (clock) when ubnctl0.ubnpwr bit = 1, the peripheral clock (f xp ) is supplied to the transmission/reception unit. this clock is called the base clock (clock).
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 804 (2) serial clock generation a serial clock can be generated according to the settings of the ubnctl2 register. the 16-bit counter divisor value can be select ed according to the ubnctl2.ubnbrs15 to ubnctl2.ubnbrs0 bits. (a) baud rate the baud rate is the value obtained according to the following formula. baud rate = f xp 2 k [bps] f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock k = value set according to ubnctl2.ubnbrs15 to ubnctl2.ubnbrs0 bits (k = 4, 5, 6, ..., 65535) (b) baud rate error the baud rate error is obtained according to the following formula. [%] 100 1 rate) baud (normal rate baud desired error) with rate (baud rate baud actual (%) error ? = ? ? ? ? ? ? ? ? cautions 1. make sure that the baud rate error during transmission does not exceed the allowable error of the reception destination. 2. make sure that the baud rate error duri ng reception is within th e allowable baud rate range during reception, which is described in paragraph (4). example: f xp = 32 mhz = 32,000,000 hz settings of ubnctl2.ubnbrs15 to ub nctl2.ubnbrs0 bits = 00000000000110011b (k = 51) target baud rate = 312500 bps baud rate = 32 m/(2 51) = 32000000/(2 51) = 313725 [bps] error = (313725/312500 ? 1) 100 = 0.392 [%]
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 805 (3) baud rate setting example table 16-5. baud rate ge nerator setting data (1/2) f xp = 32 mhz f xp = 24 mhz f xp = 16 mhz baud rate (bps) ubnctl2 err (%) ubnctl2 err (%) ubnctl2 err (%) 300 d055h 0.00 9c40h 0.00 682bh 0.00 600 682bh 0.00 4e20h 0.00 3415h 0.00 1200 3415h 0.00 2710h 0.00 1a0bh 0.00 2400 1a0bh 0.00 1388h 0.00 0d05h 0.01 4800 0d05h 0.01 09c4h 0.00 0683h ? 0.02 9600 0683h ? 0.02 04e2h 0.00 0341h 0.04 19200 0341h 0.04 0271h 0.00 01a1h ? 0.08 31250 0200h 0.00 0180h 0.00 0100h 0.00 38400 01a1h ? 0.08 0139h ? 0.16 00d0h 0.16 76800 00d0h 0.16 009ch 0.16 0068h 0.16 153600 0068h 0.16 004eh 0.16 0034h 0.16 312500 0033h 0.39 0026h 1.05 001ah ? 1.54 500000 0020h 0.00 0018h 0.00 0010h 0.00 625000 001ah ? 1.54 0013h 1.05 000dh ? 1.54 1500000 000bh ? 3.03 0008h 0.00 0006h ? 11.11 caution the maximum transfer speed of the baud rate is 1.5 mbps. remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock k: settings of ubnctl2.ubnbrs15 to ubnctl2.ubnbrs0 bits err: baud rate error [%]
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 806 (4) allowable baud rate range during reception the degree to which a discrepancy from the transmission destination?s baud rate is allowed during reception is shown below. caution the equations described be low should be used to set the baud rate error during reception so that it always is withi n the allowable error range. figure 16-9. allowable baud rate range during reception fl 1 data frame (11 fl) flmin flmax uartbn latch timing start bit bit 0 bit 1 bit 7 parity bit minimum allowable value maximum allowable value stop bit start bit bit 0 bit 1 bit 7 parity bit stop bit start bit bit 0 bit 1 bit 7 parity bit stop bit as shown in figure 16-9, after the start bit is detected, the receive data latch timing is determined according to the counter that was set by the ubnctl2 register. if all data up to the final data (stop bit) is in time for this latch timing, the data can be received normally. applying this to 11-bit reception is, theoretically, as follows. fl = (brate) ? 1 brate: uartbn baud rate k: ubnctl2 set value fl: 1-bit data length latch timing margin: 2 clocks minimum allowable value: fl k 2 2 k 21 fl k 2 2 k fl 11 flmin + = ? ? =
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 807 therefore, the maximum baud rate that can be re ceived at the transfer destination is as follows. brate 2 21k k 22 (flmin/11) brmax 1 + = = ? similarly, the maximum allowable value can be obtained as follows. fl k 2 2 k 21 fl k 2 2 k fl 11 flmax 11 10 ? = + ? = 11 fl k 20 2 k 21 flmax ? = therefore, the minimum baud rate that can be received at the transfer destination is as follows. brate 2 21k k 20 (flmax/11) brmin 1 ? = = ? the allowable baud rate error of uartbn and the transfer destination can be obtained as follows from the expressions described above for computing the minimum and maximum baud rate values. table 16-6. maximum and mini mum allowable baud rate error division ratio (k) maximum allowable baud rate error minimum allowable baud rate error 4 +2.33 % ? 2.44 8 +3.53 % ? 3.61 16 +4.14 % ? 4.19 32 +4.45 % ? 4.48 64 +4.61 % ? 4.62 128 +4.68 % ? 4.69 256 +4.72 % ? 4.73 512 +4.74 % ? 4.74 1024 +4.75 % ? 4.75 2048 +4.76 % ? 4.76 4096 +4.76 % ? 4.76 8192 +4.76 % ? 4.76 16384 +4.76 % ? 4.76 32768 +4.76 % ? 4.76 65535 +4.76 % ? 4.76 remarks 1. the reception precision depends on the number of bits in one frame, the base clock frequency, and the division ratio (k). the higher the base clock frequency and the larger the division ratio (k), the higher the precision. 2. k: ubnctl2 set value
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 808 (5) transfer rate durin g continuous transmission during continuous transmission, the transfer rate from a stop bit to the next start bit is extended two clocks longer than normal. however, on the reception side, the transfer result is not affected since the timing is initialized by the detection of the start bit. figure 16-10. transfer rate during continuous transmission start bit bit 0 bit 1 bit 7 parity bit stop bit fl 1 data frame bit 0 fl fl fl fl fl fl flstp start bit of second byte start bit representing the 1-bit data length by fl, the stop bit length by flstp, and the base clock frequency by f xp yields the following equation. flstp = fl + 2/(f xp ) therefore, the transfer rate during continuous transmission is as follows. transfer rate = 11 fl + 2/(f xp )
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 809 16.8 control flow (1) example of continuous tr ansmission processing flow in single mode (cpu control) figure 16-11. example of continuo us transmission processing flow in single mode (cpu control) set uartbn-related registers yes ubntsf = 0? (ubnstr) no start ubntxe = 1 (ubnctl0) : enable transmission write ubntx register : write transmit data ubntxe = 0 (ubnctl0) : disable transmission yes intubntit interrupt = 1? : ubntx register can be written? no yes transmission completed? : all transmit data written? : transmission completed? no end
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 810 (2) example of continuous r eception processing flow in si ngle mode (cpu control) figure 16-12. example of continuous reception processing flow in single mode (cpu control) set uartbn-related registers start ubnrxe = 1 (ubnctl0) : enable reception error processing in single mode yes intubntire interrupt = 1? : reception error occurred? yes intubntir interrupt = 1? : 1-byte reception completed? no yes reception completed? : reception completed? no no end read ubnrx register : read receive data ubnrxe= 0 (ubnctl0) : disable reception
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 811 (3) example of continuous tr ansmission processing flow in single mode (dma control) figure 16-13. example of continuo us transmission processing flow in single mode (dma control) set uartbn/dmac-related registers note start set dtfrm register : set intubntit as dma transfer start factor (in the case of intubntit) and clear dfm bit yes dma completed? : dma transfer completed? no yes ubntsf = 0? (ubnstr) : transmission completed? no ubntxe = 0 (ubnctl0) : disable transmission end emm = 1 (dchcm) : enable dma transfer ubntxe = 1 (ubnctl0) : enable transmission write ubntx register : write transmit data note in this control flow example, transmission of the first byte of the data is executed by a cpu write operation. exercise care in setting the number of data for dma transfer (dbcm register) and the source address (dsamh, dsaml registers). remark m = 0 to 3
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 812 (4) example of continuous r eception processing flow in si ngle mode (dma control) figure 16-14. example of continuous reception processing flow in single mode (dma control) set uartbn/dmac-related registers start set dtfrm register : set intubntir as dma transfer start factor (in the case of intubntir) and clear dfm bit yes dma completed? : dma transfer (reception) completed? no ubnrxe = 0 (ubnctl0) : disable reception end emm = 1 (dchcm) : enable dma transfer ubnrxe = 1 (ubnctl0) : enable reception remark m = 0 to 3
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 813 (5) example of continuous tr ansmission processing flow in fifo mode (cpu control) figure 16-15. example of continuous transmissi on processing flow in fifo mode (cpu control) set uartbn-related registers start write transmit fifo note 1 : write transmit data yes intubntif interrupt = 1? : transmission completed? note 2 yes intubntit interrupt = 1? : writing to transmit fifon enabled? no yes transmission completed? : writing all transmit data completed? no : transmission completed? no end ubntxe = 0 (ubnctl0) write transmit fifon note 3 : disable transmission clear transmit fifon ubntxe = 1 (ubnctl0) : enable transmission yes intubntif interrupt = 1? no notes 1. write more transmit data than the number set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits to transmit fifon. 2. this is the case where transmission is completed (transmit fifon and the transmit shift register n become empty) before the next transmit data is writt en. to continue data transmission, clear the intubntif and intubntit signals and write the next data to transmit fifon. 3. in the pending mode (ubnfic0.ubnitm bit = 0), write as many transmit data as the number set as the trigger by the ubnfic2.ubntt3 to ubnfic2.ubntt0 bits of to transmit fifon. in the pointer mode (ubnitm bit = 1), reference the ubnfis1.ub ntb4 to ubnfis1.ubntb0 bits and write as many data as the number of empty bytes in transmit fifon to transmit fifon. write 16-byte data to fully use the 8-bit 16-stage fifo function.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 814 (6) example of continuous reception processing in fi fo mode (cpu control) figure 16-16. example of continuous recepti on processing in fifo mode (cpu control) set uartbn-related registers start ubnrxe = 1 (ubnctl0) : enable reception yes intubntito interrupt = 1? : reception timeout occurred? yes intubntir interrupt = 1? : reading from receive fifon enabled? no yes reception completed? : reading all receive data completed? no no no intubntire interrupt = 1? : reception error occurred? yes end read receive fifon note 1 : read receive data error processing in fifo mode ubnrxe = 0 (ubnctl0) : disable reception check ubnfis0 register read receive fifon note 2 : read receive data remaining in receive fifon clear receive fifon notes 1. read as many receive data as the number set as the trigger by the ubnfic2.ubnrt3 to ubnfic2.ubnrt0 bits from receive fifon in th e pending mode (ubnfic0.ubnirm bit = 0). in the pointer mode (ubnirm bit = 1), reference the ubnfis0.ubnrb4 to ubnfis0.ubnrb0 bits and read as many data as the number of bytes st ored in receive fifon from receive fifon. 2. read as many data (remaining receive data less than the number set as the trigger) as the number of bytes stored in receive fifon from re ceive fifon by referencing the ubnfis0.ubnrb4 to ubnfis0.ubnrb0 bits.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 815 (7) example of reception erro r processing in single mode figure 16-17. example of reception erro r processing flow in single mode start read ubnrx register : extract receive data (error data) end clear error flag read ubnstr register : check error flag caution reception can be continued by completing th is control flow before reception of the next data is completed. if the next data is recei ved before this control flow is completed, a reception error interrupt request signal (intub ntire) may occur even if the data has been received correctly.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 816 (8) example of reception error pr ocessing flow in fifo mode (1) figure 16-18. example of reception erro r processing flow in fifo mode (1) start ubnrxe = 0 (ubnctl0) note : stop reception end read ubnfis0 register : check receive fifon pointer read ubnrxap register : extract receive data and check error ubnrfc = 1 (ubnfic0) : clear receive fifon clear error flag read ubnstr register : check error flag note if the error flag is cleared when ubnrxe bit = 0, the ubnctl0 register does not have to be set.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 817 (9) example of reception error pr ocessing flow in fifo mode (2) figure 16-19. example of reception erro r processing flow in fifo mode (2) start end read ubnfis0 register : check receive fifon pointer read ubnrxap register : extract receive data and check error clear error flag read ubnstr register : check error flag note reception can be continued by completing this control flow before reception of the next data is completed. extract the receive data and check if a reception error has occurred before receive fifon becomes empty. note that this control flow is valid only when a parity error or a framing error occurs. if an overflow error occurs, receive fifon must be cleared (ubnfic0.ubnrfc bit = 1). if the next data is received before this control flow is completed, a reception error interrupt request signal (intubntire) may occur even if the data has been received correctly.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 818 16.9 cautions cautions concerning uartbn are shown below. (1) when using dma control be sure to select the single mode when writing a transmit data or reading a received data by using the dma control. in fifo mode, the use of the dma control is prohibited. (2) when supply clock to uartbn is stopped when the supply of clocks to uartbn is stopped (for example, idle and stop modes), operation stops with each register retaining the value it had immediately befo re the supply of clocks was stopped. the txdbn pin output also holds and outp uts the value it had imm ediately before the supply of clocks was stopped. however, operation is not gua ranteed after the supply of clocks is rest arted. therefore, after the supply of clocks is restarted, the circuits should be initialized by setting the ubnpwr bit = 0, ubnrxe bit = 0, and ubntxe bit = 0. (3) caution on setting ubnctl0 register ? when using uartbn, set the external pins related to the uartbn f unction to the alte rnate function and set the ubnctl2 register. then set the ubnctl0. ubnpwr bit to 1 before setting the other bits. ? be sure to input a high level to the rxdbn pin when setting the external pins related to the uartbn function to the alternate function. if a low level is input, it is judged that a falling edge is input after the ubnctl0.ubnrxe bit has been set to 1, and reception may be started. (4) caution on setting ubnfic2 register be sure to clear the ubnctl0.ubntxe bit (to disable transmission) and ubnctl0.ubnrxe bit (to disable reception) to 0 before writing data to the ubnfic2 register . if data is written to the ubnfic2 register with the ubntxe or ubnrxe bit set to 1, the operation is not guaranteed. (5) transmission interrupt request signal in the single mode, the transmission enable interrup t request signal (intubntit) occurs when the ubntx register becomes empty (when 1 byte of data is transfe rred from the ubntx register to the transmit shift register). in the fifo mode, the fifo transmission co mpletion interrupt request signal (intubntif) occurs when data is no longer in transmit fifon and the trans mit shift register n (when the fifo and register are empty). however, the intubntit signal or intubntif signal does not occur if the transmit data register becomes empty due to reset input. (6) initialization during continu ous transmission in single mode confirm that the ubnstr.ubntsf bit is 0 before executing initialization during transmission processing. if initialization is executed while the ubntsf bit is 1, the transmit data is not guaranteed. (7) initialization during continuous tr ansmission (pending m ode) in fifo mode confirm that the ubnstr.ubntsf bit is 0 before exec uting initialization during transmission processing (this can also be done by checking the fifo transmission completion interrupt request signal (intubntif)). if initialization is executed while the ubntsf bi t is 1, the transmit data is not guaranteed.
chapter 16 asynchronous serial interface b (uartb) user?s manual u19201ej3v0ud 819 (8) initialization during continuous tran smission (pointer m ode) in fifo mode confirm that the ubnstr.ubntsf bit is 0 before exec uting initialization during transmission processing (this can also be done by checking the fifo transmission completion interrupt request signal (intubntif)). if initialization is executed while the ubntsf bit is 1, the transmit data is not guaranteed. (9) receive operation in fifo m ode (pointer mode specified) if the pointer mode is specified in the fifo mode and if as many data as the number of bytes stored in receive fifon are read by referencing the ubnfis0 register, no data may be stored in receive fifon (ubnfis0.ubnrb4 to ubnfis0.ubnrb0 bits = 00000) even though the reception completion interrupt request signal (intubntir) has occurred. in this case, do not read data from receive fifon. be sure to read data from receive fifon after confirming that the number of bytes stored in receive fifon = 1 byte or more (ubnrb4 to ubnrb0 bits = other than 00000). (10) switching dma transfer start factor in the v850e/sj3-h and v850e/sk3-h, the intub0tir and inttq0ov signals, intub0tit and inttp0ov signals, intub1tir and inttp1ov signals, and intub1tit and inttp2ov signals, which are the dma transfer start factors, share the same pin, respectively, and they cannot be used at the same time. to use the intub0tir, intub0tit, intub1tir, or intub1tit signal as the dma transfer start factor, set the option byte (0000007ah) (see chapter 33 option byte function ) dtfrob0 bit = 1. in this case, the inttq0ov, inttp0ov, inttp1ov, and inttp2ov signals cannot be used as the dma transfer start factor. remark for details, see table 22-1 dma transfer start factors .
user?s manual u19201ej3v0ud 820 chapter 17 3-wire variable-length serial i/o b (csib) 17.1 port settings of csib0 to csib5 17.1.1 for v850e/sj3-h table 17-1. pin configuration alternate-function pin port <1> port <2> mode pin name pin no. port alternate function pin no. port alternate function sib0 22 p40 sda01 ? ? ? sob0 23 p41 scl01 ? ? ? csib0 sckb0 24 p42 intp2 ? ? ? sib1 68 p97 a7/tip20/top20 ? ? ? sob1 69 p98 a8 ? ? ? csib1 sckb1 70 p99 a9 ? ? ? sib2 40 p53 kr3/tiq00/toq00/rtp03/ddo 35 p38 txda2/sda00 sob2 41 p54 kr4/rtp04/dck ? ? ? csib2 sckb2 42 p55 kr5/rtp05/dms 36 p39 rxda2/scl00 sib3 71 p910 a10 ? ? ? sob3 72 p911 a11 ? ? ? csib3 sckb3 73 p912 a12 ? ? ? sib4 26 p31 rxda0/intp7 ? ? ? sob4 25 p30 txda0 ? ? ? csib4 sckb4 27 p32 ascka0/tip00/top00 ? ? ? sib5 49 p66 intp9/kr3/tiq00/toq00 ? ? ? sob5 50 p67 rxda5/sda05 note ? ? ? csib5 sckb5 51 p68 txda5/scl05 note ? ? ? note these pins are not included in the pd70f3931, 70f3932, and 70f3933. (1) csib0 the serial reception data/serial transmission data/se rial clock pins (sib0, sob0, and sckb0) of csib0 are assigned to p40, p41, and p42, respectively. when us ing csib0, specify p40, p41, and p42 as the sib0, sob0, and sckb0 pins in advance, using the pmc4 and pfc4 registers. the sib0, sob0, and sckb0 pins and the serial transm ission/reception data/serial clock pins (sda01 and scl01) of i 2 c01 are alternate functions of t he same pin, and therefore cannot be used simultaneously. in addition, the sckb0 pin also functions alternately as the intp2 pin (external interrupt input), so use the intp2 pin assigned to another port pin (p05) when using the sckb0 and intp2 pins simultaneously. (2) csib1 the serial reception data, serial transmission data, a nd serial clock pins (sib1, sob1, and sckb1) of csib1 are assigned to p97, p98, and p99, respectively. w hen using csib1, specify p97, p98, and p99 as the sib1, sob1, and sckb1 pins in advance, using the pmc9, pfc9 and pfce9 registers.
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 821 the sib1, sob1, and sckb1 pins, tmp2 i/o pins (t ip20/top20), and address bus pins (a7 to a9) are alternate functions of the same pins, an d therefore cannot be used simultaneously. (3) csib2 the serial reception data, serial transmission data, a nd serial clock pins (sib2, sob2, and sckb2) of csib2 are assigned to p53, p54, and p55, respectively. in addition, the sib2 and sckb2 pins are also assigned to p38 and p39, respectively, and can only be used at either one of the pins (if used at p38 and p39, it is for reception only). when using csib2 at p53, p54, and p55, specify p53, p54, and p55 as the sib2, sob2, and sckb2 pins in advance, using the pmc5, pfc5 and pfce 5 registers. when using csib2 at p38 and p39 for reception only, specify p38 and p39 as the sib2 and sckb2 pins in advance, using the pmc3, pfc3, and pfce3 registers. p53, p54, and p55 function as t he on-chip debug control pins (ddo, dck, and dms) and the i/o pins (tiq00 and toq00) of tmq0. by using csib2 at p38 and p39 for reception only, these alternate functions can be used simultaneously with csib2. p38 and p39 function as the uarta2 transmission/reception pins (txda2 and rxda2) and the serial transmission/reception dat a/serial clock pins (sda00 and scl00) of i 2 c00. by using csib2 at p53, p54, and p 55, these alternate functions can be used simultaneously with csib2. (4) csib3 the serial reception data, serial transmission data, a nd serial clock pins (sib3, sob3, and sckb3) of csib3 are assigned to p910, p911, and p912, respectively. when using csib3, specify p910, p911, and p912 as the sib3, sob3, and sckb3 pins in advance, using the pmc9 and pfc9 registers. the sib3, sob3, and sckb3 pins and the address bus pins (a10 to a12) are alternate functions of the same pin, and therefore cannot be used simultaneously. (5) csib4 the serial reception data/serial transmission data/se rial clock pins (sib4, sob4, and sckb4) of csib4 are assigned to p31, p30, and p32, respectively. when us ing csib4, specify p31, p30, and p32 as the sib4, sob4, and sckb4 pins in advance, using the pmc3, pfc3 and pfce3 registers. the sib4 and sob4 pins and the trans mission/reception pins (rxda0 and txda0) of uarta0 are alternate functions of the same pin, and ther efore cannot be used simultaneously . in addition, the sib4 pin also functions alternately as the intp7 pin (external interrup t input), so use the intp7 pin assigned to another port pin (p51) when using the sib4 and intp7 pins simultaneously. (6) csib5 the serial reception data/serial transmission data/se rial clock pins (sib5, sob5, and sckb5) of csib5 are assigned to p66, p67, and p68, respectively. when us ing csib5, specify p66, p67, and p68 as the sib5, sob5, and sckb5 pins in advance, using the pmc6, pfc6, and pfce6 registers. the sob5 and sckb5 pins, the transmission/reception pins (rxda5 and txda5) of uarta5, and the serial transmission/reception data/serial clock pins (sda05 and scl05) note of i 2 c05 are alternate functions of the same pin, respectively, and therefore cannot be used simultaneously. note these pins are not included in the pd70f3931, 70f3932, and 70f3933 caution do not switch port settings during operation. also, be sure to disable operation of unused units for which port settings are not made.
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 822 17.1.2 for v850e/sk3-h table 17-2. pin configuration alternate-function pin port <1> port <2> mode pin name pin no. port alternate function pin no. port alternate function sib0 24 p40 sda01 ? ? ? sob0 25 p41 scl01 ? ? ? csib0 sckb0 26 p42 intp2 ? ? ? sib1 84 p97 a7/tip20/top20 ? ? ? sob1 85 p98 a8 ? ? ? csib1 sckb1 86 p99 a9 ? ? ? sib2 48 p53 kr3/tiq00/toq00/rtp03/ddo 40 p38 txda2/sda00 sob2 49 p54 kr4/rtp04/dck 42 p310 ? csib2 sckb2 50 p55 kr5/rtp05/dms 41 p39 rxda2/scl00 sib3 87 p910 a10 ? ? ? sob3 88 p911 a11 ? ? ? csib3 sckb3 89 p912 a12 ? ? ? sib4 31 p31 rxda0/intp7 ? ? ? sob4 30 p30 txda0 ? ? ? csib4 sckb4 32 p32 ascka0/tip00/top00 ? ? ? sib5 59 p66 intp9/kr3/tiq00/toq00 ? ? ? sob5 60 p67 rxda5/sda05 ? ? ? csib5 sckb5 61 p68 txda5/scl05 ? ? ? (1) csib0 the serial reception data/serial transmission data/se rial clock pins (sib0, sob0, and sckb0) of csib0 are assigned to p40, p41, and p42, respectively. when us ing csib0, specify p40, p41, and p42 as the sib0, sob0, and sckb0 pins in advance, using the pmc4 and pfc4 registers. the sib0 and sckb0 pins and the serial transmission/re ception data/serial clock pins (sda01 and scl01) of i 2 c01 are alternate functions of the sa me pin, and therefore cannot be used simultaneously. in addition, the sckb0 pin also functions alternately as the intp2 pin (external interrupt input), so use the intp2 pin assigned to another port pin (p05) when using the sckb0 and intp2 pins simultaneously. (2) csib1 the serial reception data, serial transmission data, a nd serial clock pins (sib1, sob1, and sckb1) of csib1 are assigned to p97, p98, and p99, respectively. w hen using csib1, specify p97, p98, and p99 as the sib1, sob1, and sckb1 pins in advance, using the pmc9, pfc9, and pfce9 registers. the sib1, sob1, and sckb1 pins, the tmp2 i/o pins (tip20/top20), and the address bus pins (a7 to a9) are alternate functions of the same pins , and therefore cannot be used simultaneously.
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 823 (3) csib2 the serial reception data, serial transmission data, a nd serial clock pins (sib2, sob2, and sckb2) of csib2 are assigned to p53, p54, and p55, respectively. in addition, the sib2, sob2, and sckb2 pins are assigned to p38, p310, and p39, respectively, and can be used at either one of the pins only. when using csib1 at p53, p54, and p55, specify p53, p54, and p55 as the sib2, sob2, and sckb2 pins in advance, using the pmc5, pfc5 and pfce5 registers. when using csib2 at p38, p310, and p39, specify p38, p310, and p39 as the sib2, sob2, and sckb2 pins in advance, using the pmc3, pfc3, and pfce3 registers. p53, p54, and p55 function as t he on-chip debug control pins (ddo, dck, and dms) and the i/o pins (tiq00 and toq00) of tmq0. by using csib2 at p38, p 310, and p39, these alternat e functions can be used simultaneously with csib2. p38 and p39 function as the serial transmission/reception data/serial clock pins (sda00 and scl00) of i 2 c00, and therefore cannot be used simultaneously. in addition, p38 and p39 also function as uarta2 transmission/reception pins (t xda2 and rxda2). use the txda2 and rxda2 pins assigned to another port pin (p311 and p312) when using these pins and other alternate functions simultaneously. (4) csib3 the serial reception data, serial transmission data, a nd serial clock pins (sib3, sob3, and sckb3) of csib3 are assigned to p910, p911, and p912, respectively. when using csib3, specify p910, p911, and p912 as the sib3, sob3, and sckb3 pins in advance, using the pmc9 and pfc9 registers. the sib3, sob3, and sckb3 pins and the address bus pins (a10 to a12) are alternate functions of the same pin, and therefore cannot be used simultaneously. (5) csib4 the serial reception data/serial transmission data/se rial clock pins (sib4, sob4, and sckb4) of csib4 are assigned to p31, p30, and p32, respectively. when us ing csib4, specify p31, p30, and p32 as the sib4, sob4, and sckb4 pins in advance, using the pmc3, pfc3 and pfce3 registers. the sib4 and sob4 pins and the trans mission/reception pins (rxda0 and txda0) of uarta0 are alternate functions of the same pin, and ther efore cannot be used simultaneously . in addition, the sib4 pin also functions alternately as the intp7 pin (external interrup t input), so use the intp7 pin assigned to another port pin (p51) when using the sib4 and intp7 pins simultaneously. (6) csib5 the serial reception data/serial transmission data/se rial clock pins (sib5, sob5, and sckb5) of csib5 are assigned to p66, p67, and p68, respectively. when us ing csib5, specify p66, p67, and p68 as the sib5, sob5, and sckb5 pins in advance, using the pmc6, pfc6, and pfce6 registers. the sob5 and sckb5 pins, the transmission/reception pins (rxda5 and txda5) of uarta5, and the serial transmission/reception data/serial cl ock pins (sda05 and scl05) of i 2 c05 are alternate functions of the same pin, so use the rxda5 and txda5 pins and sda05 and scl05 pins assigned to another port pin (uarta5: p84 and p85, i 2 c05: p82 and p83) when using these pins and other alternate functions simultaneously. caution do not switch port settings during operation. also, be sure to disable operation of unused units for which port settings are not made.
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 824 17.2 features transfer rate: 8 mbps max. master mode and slave mode selectable transfer data length selectable in 1-bit units between 8 and 16 bits transfer data msb-first/lsb-first switchable serial clock and data phase switchable transmission mode, reception mode, transmission/reception mode specifiable ? transmission mode: transmission starts triggered by writing a transmit data to the csibn transmit data register (cbntx) in the transmission enabled state. ? reception mode: reception starts triggered by reading the csibn receive data register (cbnrx) in the reception enabled state. ? transmission/reception mode: transmission/reception starts triggered by writing a transmit data to the csibn transmit data register (cbntx) in the transmission/reception enabled state. interrupt request signal ? reception completion interrupt (intcbnr) ? transmission enable interrupt (intcbnt) 3-wire transfer sobn: serial data output sibn: serial data input sckbn: serial clock i/o remark n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 825 17.3 configuration the following shows the block diagram of csibn. figure 17-1. block diagram of csibn internal bus cbnctl2 cbnctl0 cbnstr controller intcbnr f cclk sobn intcbnt cbntx so latch phase control shift register cbnrx cbnctl1 phase control sibn f brgm f xp /2 f xp /4 f xp /8 f xp /16 f xp /32 f xp /64 sckbn selector remarks f cclk : communication clock f xp : peripheral clock frequency (prescaler 1 input clock frequency) f xp = f xx in clock mode 1 f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 2 f xp = f xmpll (29.28 to 32 mhz) in clock mode 3 f xp = f xmpll /2 (20.88 to 24 mhz) in clock mode 4 f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock f brgm : brgm count clock n = 0 to 5 m = 1 (n = 0, 1) m = 2 (n = 2, 3) m = 3 (n = 4, 5)
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 826 csibn includes the following hardware. table 17-3. configuration of csibn item configuration registers csibn receive data register (cbnrx) csibn transmit data register (cbntx) control registers csibn control register 0 (cbnctl0) csibn control register 1 (cbnctl1) csibn control register 2 (cbnctl2) csibn status register (cbnstr)
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 827 (1) csibn receive data register (cbnrx) the cbnrx register is a 16-bit buffer register that holds receive data. this register is read-only, in 16-bit units. the receive operation is started by reading the cbnrx register in the reception enabled status. if the transfer data length is 8 bits, the lower 8 bits of th is register are read-only in 8-bit units as the cbnrxl register. reset sets this register to 0000h. in addition to reset input, the cbnrx register can be in itialized by clearing (to 0) the cbnpwr bit of the cbnctl0 register. after reset: 0000h r address: cb0rx fffffd04h, cb1rx fffffd14h, cb2rx fffffd24h, cb3rx fffffd34h, cb4rx fffffd44h, cb5rx fffffd54h cbnrx (n = 0 to 5) (2) csibn transmit data register (cbntx) the cbntx register is a 16-bit buffer regist er used to write the csibn transfer data. this register can be read or written in 16-bit units. the transmit operation is started by writing data to t he cbntx register in the transmission enabled status. if the transfer data length is 8 bits, the lower 8 bits of th is register are read or written in 8-bit units as the cbntxl register. reset sets this register to 0000h. after reset 0000h r/w address: cb0tx fffffd06h, cb1tx fffffd16h, cb2tx fffffd26h, cb3tx fffffd36h, cb4tx fffffd46h, cb5tx fffffd56h cbntx (n = 0 to 5) remark the communication start conditions are shown below. transmission mode (cbntxe bit = 1, cbnrxe bit = 0): write to cbntx register transmission/reception mode (cbntxe bit = 1, cb nrxe bit = 1): write to cbntx register reception mode (cbntxe bit = 0, cbnrxe bit = 1): read from cbnrx register
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 828 17.4 registers the following registers are used to control csibn. ? csibn control register 0 (cbnctl0) ? csibn control register 1 (cbnctl1) ? csibn control register 2 (cbnctl2) ? csibn status register (cbnstr) (1) csibn control register 0 (cbnctl0) cbnctl0 is a register that controls the csibn serial transfer operation. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 01h. (1/3) cbnpwr disable csibn operation and reset the cbnstr register enable csibn operation cbnpwr 0 1 specification of csibn operation disable/enable cbnctl0 (n = 0 to 5) cbntxe note cbnrxe note cbndir note 00 cbntms note cbnsce after reset: 01h r/w address: cb0ctl0 fffffd00h, cb1ctl0 fffffd10h, cb2ctl0 fffffd20h, cb3ctl0 fffffd30h, cb4ctl0 fffffd40h, cb5ctl0 fffffd50h ? the cbnpwr bit controls the csibn operation and resets the internal circuit. disable transmit operation enable transmit operation cbntxe note 0 1 specification of transmit operation disable/enable ? the sobn output is low level when the cbntxe bit is 0. ? when the cbnrxe bit is cleared to 0, no reception completion interrupt is output even when the prescribed data is transferred in order to disable the receive operation, and the receive data (cbnrx register) is not updated. disable receive operation enable receive operation cbnrxe note 0 1 specification of receive operation disable/enable < > < > < > < > < > note these bits can only be rewritten when the cbnpwr bit = 0. however, cbnpwr bit = 1 can also be set at the same time as rewriting these bits. cautions 1. to forcibly suspe nd transmission/reception, clear the cbnpwr bit instead of the cbnt xe and cbnrxe bits to 0. at this time, the clock output is stopped. 2. be sure to set bits 3 and 2 to ?0?.
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 829 (2/3) single transfer mode continuous transfer mode cbntms note 0 1 transfer mode specification [in single transfer mode] the reception completion interrupt request signal (intcbnr) is generated. even if transmission is enabled (cbntxe bit = 1), the transmission enable interrupt request signal (intcbnt) is not generated. if the next transmit data is written during communication (cbnstr.cbntsf bit = 1), it is ignored and the next communication is not started. also, if reception-only communication is set (cbntxe bit = 0, cbnrxe bit = 1), the next communication is not started even if the receive data is read during communication (cbnstr. cbbtsf bit = 1). [in continuous transfer mode] the continuous transmission is enabled by writing the next transmit data during communication (cbnstr.cbntsf bit = 1). writing the next transmission data is enabled after a transmission enable interrupt (intcbnt) occurrence. if reception-only communication is set (cbntxe bit = 0, cbnrxe bit = 1) in the continuous transfer mode, the next reception is started continuously after a reception completion interrupt (intcbnr) regardless of the read operation of the cbnrx register. therefore, read immediately the receive data from the cbnrx register. if this read operation is delayed, an overrun error (cbnove bit = 1) occurs. cbndir note 0 1 specification of transfer direction mode (msb/lsb) msb-first transfer lsb-first transfer note these bits can only be rewritten when the cbnpwr bit = 0. however, cbnpwr bit = 1 can also be set at the same time as rewriting these bits.
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 830 (3/3) communication start trigger invalid communication start trigger valid cbnsce 0 1 specification of start transfer disable/enable ? in master mode this bit enables or disables the communication start trigger. (a) in single transmission or transmission/reception mode, or continuous transmission or continuous transmission/reception mode the setting of the cbnsce bit has no influence on communication operation. (b) in single reception mode clear the cbnsce bit to 0 before reading the last receive data because reception is started by reading the receive data (cbnrx register) to disable the reception startup note 1 . (c) in continuous reception mode clear the cbnsce bit to 0 one communication clock before reception of the last data is completed to disable the reception startup after the last data is received note 2 . ? in slave mode this bit enables or disables the communication start trigger. set the cbnsce bit to 1 note 3 . notes 1. if the cbnsce bit is read while it is 1, the next communication operation is started. 2. the cbnsce bit is not cleared to 0 one communication clock before the completion of the last data reception, the next communication op eration is automatically started. to start the communication operation a gain after the last data has been read, set the cbnsce bit to ?1? and dummy-read the cbnrx register. 3. to start the reception, dummy reading is necessary.
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 831 (a) how to use cbnsce bit (i) in single reception mode <1> when the reception of the la st data is completed with intcbnr interrupt servicing, clear the cbnsce bit to 0, and then read the cbnrx register. <2> when the reception is disabled after the rec eption of the last data has been completed, check that the cbnstr.cbntsf bit is 0, and then cl ear the cbnpwr and cbnrxe bits to 0. to continue reception, set the cbnsce bit to 1 and start the next receive operation by performing a dummy read of the cbnrx register. (ii) in continu ous reception mode <1> clear the cbnsce bit to 0 during reception of the last data with intcbnr interrupt servicing by the reception before the last recept ion, and then read the cbnrx register. <2> after receiving the intcbnr signal of the la st reception, read the la st data from the cbnrx register. <3> when the reception is disabled after the rec eption of the last data has been completed, check that the cbnstr.cbntsf bit is 0, and then cl ear the cbnpwr and cbnrxe bits to 0. to continue reception, set the cbnsce bit to 1 and start the next receive operation by performing a dummy read of the cbnrx register. caution in continuous recep tion mode, the serial clock is not stopped until the reception executed when the cbnsce bit is cleared to 0 is completed after the reception is started by a dummy read. (2) csibn control register 1 (cbnctl1) cbnctl1 is an 8-bit register that controls the csibn serial transfer operation. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. caution the cbnctl1 register can be rewritte n only when the cbnc tl0.cbnpwr bit = 0.
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 832 0 cbnckp 0 0 1 1 specification of data transmission/ reception timing in relation to sckbn cbnctl1 (n = 0 to 5) 0 cbndap 0 1 0 1 0 cbnckp cbndap cbncks2 cbncks1 cbncks0 after reset 00h r/w address: cb0ctl1 fffffd01h, cb1ctl1 fffffd11h, cb2ctl1 fffffd21h, cb3ctl1 fffffd31h, cb4ctl1 fffffd41h, cb5ctl1 fffffd51h cbncks2 0 0 0 0 1 1 1 1 cbncks1 0 0 1 1 0 0 1 1 cbncks0 0 1 0 1 0 1 0 1 communication clock (f cclk ) note f xp /2 f xp /4 f xp /8 f xp /16 f xp /32 f xp /64 f brgm external clock (sckbn) master mode master mode master mode master mode master mode master mode master mode slave mode mode d7 d6 d5 d4 d3 d2 d1 d0 sckbn (i/o) sibn capture sobn (output) d7 d6 d5 d4 d3 d2 d1 d0 sckbn (i/o) sibn capture sobn (output) d7 d6 d5 d4 d3 d2 d1 d0 sckbn (i/o) sibn capture sobn (output) d7 d6 d5 d4 d3 d2 d1 d0 sckbn (i/o) sibn capture sobn (output) communication type 1 communication type 2 communication type 3 communication type 4 note set the communication clock (f cclk ) to 8 mhz or lower. remarks 1. m = 1 (n = 0, 1) m = 2 (n = 2, 3) m = 3 (n = 4, 5) for details of f brgm , see 17.8 baud rate generator . 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 833 (3) csibn control register 2 (cbnctl2) cbnctl2 is an 8-bit register that controls the number of csibn serial transfer bits. this register can be read or written in 8-bit units. reset sets this register to 00h. caution the cbnctl2 register can be rewritten only when the cbnctl0.cbnpwr bit = 0 or when both the cbntxe and cbnrxe bits = 0. after reset: 00h r/w address: cb0ctl2 fffffd02h, cb1ctl2 fffffd12h, cb2ctl2 fffffd22h, cb3ctl2 fffffd32h, cb4ctl2 fffffd42h, cb5ctl2 fffffd52h 0 cbnctl2 (n = 0 to 5) 0 0 0 cbncl3 cbncl2 cbncl1 cbncl0 8 bits 9 bits 10 bits 11 bits 12 bits 13 bits 14 bits 15 bits 16 bits cbncl3 0 0 0 0 0 0 0 0 1 cbncl2 0 0 0 0 1 1 1 1 cbncl1 0 0 1 1 0 0 1 1 cbncl0 0 1 0 1 0 1 0 1 serial register bit length remarks 1. if the number of transfer bits is other than 8 or 16, prepare and use data stuffed from the lsb of the cbntx and cbnrx registers. 2. : don?t care
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 834 (a) transfer data length change function the csibn transfer data length can be set in 1-bit units between 8 and 16 bits using the cbnctl2.cbncl3 to cbnctl2.cbncl0 bits. when the transfer bit length is set to a value othe r than 16 bits, set the data to the cbntx or cbnrx register starting from the lsb, regardless of whether t he transfer start bit is the msb or lsb. any data can be set for the higher bits that are not used, but the receive data becomes 0 following serial transfer. (i) transfer bit length = 10 bits, msb first 15 10 9 0 sobn sibn insertion of 0 (ii) transfer bit length = 12 bits, lsb first 0 sobn 11 12 15 sibn insertion of 0
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 835 (4) csibn status register (cbnstr) cbnstr is an 8-bit register that displays the csibn status. this register can be read or written in 8-bit or 1-bit units, but the cbntsf flag is read-only. reset sets this register to 00h. in addition to reset input, the cbnstr register can be initialized by clearing (0) the cbnctl0.cbnpwr bit. cbntsf communication stopped communicating cbntsf 0 1 communication status flag cbnstr (n = 0 to 5) 00 0 00 0 cbnove after reset: 00h r/w address: cb0str fffffd03h, cb1str fffffd13h, cb2str fffffd23h, cb3str fffffd33h, cb4str fffffd43h, cb5str fffffd53h ? during transmission, this register is set when data is prepared in the cbntx register, and during reception, it is set when a dummy read of the cbnrx register is performed. when transfer ends, this flag is cleared to 0 at the last edge of the clock. no overrun overrun cbnove 0 1 overrun error flag ? an overrun error occurs when the next reception starts without reading the value of the cbnrx register by cpu, upon completion of the receive operation. the cbnove flag displays the overrun error occurrence status in this case. ? the cbnove bit is valid also in the single transfer mode. therefore, when only using transmission, note the following. ? do not check the cbnove flag. (recommended) ? read this bit even if reading the reception data is not required. ? the cbnove flag is cleared by writing 0 to it. it cannot be set even by writing 1 to it. < > < > caution in single transfer mode, writing to the cbntx register with the cbntsf bit set to 1 is ignored. this has no influence on the operation during transfer. for example, if the next data is written to the cbntx register when dma is started by generating the intcbnr signal, th e written data is not transfer red because the cbntsf bit is set to 1. use the continuous transfer mode, not the si ngle transfer mode, for such applications.
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 836 17.5 interrupt request signals csibn can generate the following two types of interrupt request signals. ? reception completion interrupt request signal (intcbnr) ? transmission enable interrupt request signal (intcbnt) of these two interrupt request signals, the reception completion interrupt request signal has the higher priority by default, and the priority of the transmission enable interrupt request signal is lower. table 17-4. interrupts and their default priority interrupt priority reception complete high transmission enable low (1) reception completion interr upt request signal (intcbnr) when receive data is transferred to the cbnrx register while reception is enabled, the reception completion interrupt request signal is generated. this interrupt request signal can also be generated if an overrun error occurs. when the reception completion interrupt request signal is acknowledged and the data is read, read the cbnstr register to check that the re sult of reception is not an error. in the single transfer mode, the intcbnr interrupt request signal is generated upon completion of transmission, even when only transmission is executed. (2) transmission enable interr upt request signal (intcbnt) in the continuous transmission or continuous transmi ssion/reception mode, transmit data is transferred from the cbntx register and, as soon as writing to cbntx has been enabled, the transmission enable interrupt request signal is generated. in the single transmission and single transmission/receptio n modes, the intcbnt interrupt is not generated.
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 837 17.6 operation 17.6.1 single transfer mode (mast er mode, transmission mode) msb first (cbnctl0.cbndir bit = 0), communication type 1 (cbnctl1.cbnckp and cbnctl1.cbndap bits = 00), communication clock (f cclk ) = f xp /2 (cbnctl1.cbncks2 to cbnctl1.cbncks0 bits = 000), transfer data length = 8 bits (cbnctl2.cbncl3 to cbnctl2.cbncl0 bits = 0000) remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock (1) operation flow start no (1), (2), (3) (4) (5) (6) (8) no (7) intcbnr interrupt generated? transmission completed? end yes yes cbnctl1 register 00h cbnctl2 register 00h cbnctl0 register c1h write cbntx register start transmission cbnctl0 00h remarks 1. the broken lines indicate the hardware processing. 2. the numbers in this figure correspond to the processing numbers in (2) operation timing . 3. n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 838 (2) operation timing bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sckbn pin cbntsf bit (1) (2) (3) (4) (5) (6) (7) (8) sobn pin intcbnr signal (1) write 00h to the cbnctl1 register, and sele ct communication type 1, communication clock (f cclk ) = f xp /2, and master mode. (2) write 00h to the cbnctl2 register, and set the transfer data length to 8 bits. (3) write c1h to the cbnctl0 register, and select t he transmission mode and msb first at the same time as enabling the operation of the communication clock (f cclk ). (4) the cbnstr.cbntsf bit is set to 1 by writ ing the transmit data to the cbntx register, and transmission is started. (5) when transmission is started, output the serial clock to the sc kbn pin, and output the transmit data from the sobn pin in synchronization with the serial clock. (6) when transmission of the transfer data length se t with the cbnctl2 register is completed, stop the serial clock output and transmit data output, generate the reception completion interrupt request signal (intcbnr) at the last edge of the serial clock, and clear the cbntsf bit to 0. (7) to continue transmission, start the next transmission by writing the transmit dat a to the cbntx register again after the intcbnr signal is generated. (8) to end transmission, write the cbnctl0.cb npwr bit = 0 and the cbnctl0.cbntxe bit = 0. remarks 1. n = 0 to 5 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 839 17.6.2 single transfer mode (master mode, reception mode) msb first (cbnctl0.cbndir bit = 0), communication type 1 (cbnctl1.cbnckp and cbnctl1.cbndap bits = 00), communication clock (f cclk ) = f xp /2 (cbnctl1.cbncks2 to cbnctl1.cbncks0 bits = 000), transfer data length = 8 bits (cbnctl2.cbncl3 to cbnctl2.cbncl0 bits = 0000) remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 840 (1) operation flow start no intcbnr interrupt generated? reception completed? end yes yes no (7) cbnrx register dummy read cbnsce bit = 0 (cbnctl0) cbnctl0 register 00h read cbnrx register read cbnrx register cbnctl1 register 00h cbnctl2 register 00h cbnctl0 register a1h start reception (1), (2), (3) (4) (5) (6) (8) (9) (10) remarks 1. the broken lines indicate the hardware processing. 2. the numbers in this figure correspond to the processing numbers in (2) operation timing . 3. n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 841 (2) operation timing bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 sckbn pin cbntsf bit (1) (2) (3) (4) (5) (6) (7) (10) (8) (9) sibn pin sibn pin capture timing intcbnr signal (1) write 00h to the cbnctl1 register, and select communication type 1, communication clock (f cclk ) = f xp /2, and master mode. (2) write 00h to the cbnctl2 register, and set the transfer data length to 8 bits. (3) write a1h to the cbnctl0 register, and select t he reception mode and msb first at the same time as enabling the operation of the communication clock (f cclk ). (4) the cbnstr.cbntsf bit is set to 1 by per forming a dummy read of the cbnrx register, and reception is started. (5) when reception is started, out put the serial clock to the sckbn pi n, and capture the receive data of the sibn pin in synchronization with the serial clock. (6) when reception of the transfer data length set with the cbnctl2 regist er is completed, stop the serial clock output and data capturing, gener ate the reception completion interrupt request signal (intcbnr) at the last edge of the serial clo ck, and clear the cbntsf bit to 0. (7) to continue reception, read the cbnrx register with the cbnctl0.cbnsce bit = 1 remained after the intcbnr signal is generated. (8) to read the cbnrx register without starting the next reception, write the cbnsce bit = 0. (9) read the cbnrx register. (10) to end reception, write the cbnctl0.cbnpwr bit = 0 and the cbnctl0.cbnrxe bit = 0. remarks 1. n = 0 to 5 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 842 17.6.3 single transfer mode (master mode, transmission/reception mode) msb first (cbnctl0.cbndir bit = 0), communication type 1 (cbnctl1.cbnckp and cbnctl1.cbndap bits = 00), communication clock (f cclk ) = f xp /2 (cbnctl1.cbncks2 to cbnctl1.cbncks0 bits = 000), transfer data length = 8 bits (cbnctl2.cbncl3 to cbnctl2.cbncl0 bits = 0000) remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 843 (1) operation flow start (1), (2), (3) (4) (7), (9) (5) (6) (10) no (8) transmission/reception completed? end yes cbnctl1 register 00h cbnctl2 register 00h cbnctl0 register e1h write cbntx register read cbnrx register start transmission/reception cbnctl0 00h no intcbnr interrupt generated? yes end remarks 1. the broken lines indicate the hardware processing. 2. the numbers in this figure correspond to the processing numbers in (2) operation timing . 3. n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 844 (2) operation timing sckbn pin cbntsf bit (1) (2) (3) (4) (5) (6) (8) (7) (10) (9) sibn pin bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 0 sobn pin sibn pin capture timing intcbnr signal (1) write 00h to the cbnctl1 register, and sele ct communication type 1, communication clock (f cclk ) = f xp /2, and master mode. (2) write 00h to the cbnctl2 register, and set the transfer data length to 8 bits. (3) write e1h to the cbnctl0 register, and select the transmission/reception mode and msb first at the same time as enabling the operation of the communication clock (f cclk ). (4) the cbnstr.cbntsf bit is set to 1 by writ ing the transmit data to the cbntx register, and transmission/reception is started. (5) when transmission/reception is st arted, output the serial clock to the sckbn pin, output the transmit data to the sobn pin in synchronization with the seri al clock, and capture the re ceive data of the sibn pin. (6) when transmission/reception of t he transfer data length set with the cbnctl2 register is completed, stop the serial clock output, transmit data outpu t, and data capturing, generate the reception completion interrupt request signal (intcbnr) at t he last edge of the serial clock, and clear the cbntsf bit to 0. (7) read the cbnrx register. (8) to continue transmission/reception, write t he transmit data to the cbntx register again. (9) read the cbnrx register. (10) to end transmission/reception, write the cbnctl0.cbnpwr bit = 0, the cbnctl0.cbntxe bit = 0, and the cbnctl0.cbnrxe bit = 0. remarks 1. n = 0 to 5 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 845 17.6.4 single transfer mode (s lave mode, transmission mode) msb first (cbnctl0.cbndir bit = 0), communication type 1 (cbnctl1.cbnckp and cbnctl1.cbndap bits = 00), communication clock (f cclk ) = external clock (sckbn) (cbnctl1.cbncks2 to cbnctl1.cbncks0 bits = 111), transfer data length = 8 bits (cbnctl2. cbncl3 to cbnctl2.cbncl0 bits = 0000) (1) operation flow start no (1), (2), (3) (4) (5) (4) (6) (8) no (7) intcbnr interrupt generated? transmission completed? end yes yes cbnctl1 register 07h cbnctl2 register 00h cbnctl0 register c1h write cbntx register start transmission cbnctl0 00h no yes sckbn pin input started? remarks 1. the broken lines indicate the hardware processing. 2. the numbers in this figure correspond to the processing numbers in (2) operation timing . 3. n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 846 (2) operation timing bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 0 sckbn pin cbntsf bit (1) (2) (3) (4) (5) (6) (7) (8) sobn pin intcbnr signal (1) write 07h to the cbnctl1 register, and sele ct communication type 1, communication clock (f cclk ) = external clock (sckbn), and slave mode. (2) write 00h to the cbnctl2 register, and set the transfer data length to 8 bits. (3) write c1h to the cbnctl0 register, and select t he transmission mode and msb first at the same time as enabling the operation of the communication clock (f cclk ). (4) the cbnstr.cbntsf bit is set to 1 by writing the transmit data to the cb ntx register, and the device waits for a serial clock input. (5) when a serial clock is input, output the transmit data from the sobn pin in synchronization with the serial clock. (6) when transmission of the transfer data length se t with the cbnctl2 register is completed, stop the serial clock input and transmit data output, generate the reception completion interrupt request signal (intcbnr) at the last edge of the serial clock, and clear the cbntsf bit to 0. (7) to continue transmission, write the transmit data to the cbntx register again after the intcbnr signal is generated, and wait for a serial clock input. (8) to end transmission, write the cbnctl0.cb npwr bit = 0 and the cbnctl0.cbntxe bit = 0. remark n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 847 17.6.5 single transfer mode (slave mode, reception mode) msb first (cbnctl0.cbndir bit = 0), communication type 1 (cbnctl1.cbnckp and cbnctl1.cbndap bits = 00), communication clock (f cclk ) = external clock (sckbn) (cbnctl1.cbncks2 to cbnctl1.cbncks0 bits = 111), transfer data length = 8 bits (cbnctl2. cbncl3 to cbnctl2.cbncl0 bits = 0000) (1) operation flow start reception completed? end yes no (7) cbnrx register dummy read cbnsce bit = 0 (cbnctl0) cbnctl0 register 00h read cbnrx register read cbnrx register cbnctl1 register 07h cbnctl2 register 00h cbnctl0 register a1h start reception no intcbnr interrupt generated? yes no yes (1), (2), (3) (4) (5) (4) (6) (6) (8) (9) (10) sckbn pin input started? remarks 1. the broken lines indicate the hardware processing. 2. the numbers in this figure correspond to the processing numbers in (2) operation timing . 3. n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 848 (2) operation timing bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sckbn pin cbntsf bit (1) (2) (3) (4) (5) (6) (7) (10) (8) (9) sibn pin sibn pin capture timing intcbnr signal (1) write 07h to the cbnctl1 register, and select communication type 1, communication clock (f cclk ) = external clock (sckbn), and slave mode. (2) write 00h to the cbnctl2 register, and set the transfer data length to 8 bits. (3) write a1h to the cbnctl0 register, and select t he reception mode and msb first at the same time as enabling the operation of the communication clock (f cclk ). (4) the cbnstr.cbntsf bit is set to 1 by perf orming a dummy read of the cbnrx register, and the device waits for a serial clock input. (5) when a serial clock is input, capture the receive data of the sibn pin in syn chronization with the serial clock. (6) when reception of the transfer data length set with the cbnctl2 regist er is completed, stop the serial clock input and data capturing, generate the reception completion interrupt request signal (intcbnr) at the last edge of the serial clo ck, and clear the cbntsf bit to 0. (7) to continue reception, read the cbnrx register with the cbnctl0.cbnsce bit = 1 remained after the intcbnr signal is generated, and wait for a serial clock input. (8) to end reception, write the cbnsce bit = 0. (9) read the cbnrx register. (10) to end reception, write the cbnctl0.cbnpwr bit = 0 and the cbnctl0.cbnrxe bit = 0. remark n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 849 17.6.6 single transfer mode (slave mode, transmission/reception mode) msb first (cbnctl0.cbndir bit = 0), communication type 1 (cbnctl1.cbnckp and cbnctl1.cbndap bits = 00), communication clock (f cclk ) = external clock (sckbn) (cbnctl1.cbncks2 to cbnctl1.cbncks0 bits = 111), transfer data length = 8 bits (cbnctl2. cbncl3 to cbnctl2.cbncl0 bits = 0000) (1) operation flow start (1), (2), (3) (4) (7), (9) (5) (4) (6) (10) no (8) transmission/reception completed? end yes cbnctl1 register 07h cbnctl2 register 00h cbnctl0 register e1h write cbntx register read cbnrx register start transmission/reception cbnctl0 00h no intcbnr interrupt generated? yes no yes sckbn pin input started? remarks 1. the broken lines indicate the hardware processing. 2. the numbers in this figure correspond to the processing numbers in (2) operation timing . 3. n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 850 (2) operation timing sckbn pin cbntsf bit (1) (2) (3) (4) (5) (6) (8) (7) (10) (9) sibn pin bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sobn pin sibn pin capture timing intcbnr signal (1) write 07h to the cbnctl1 register, and select communication type 1, communication clock (f cclk ) = external clock (sckbn), and slave mode. (2) write 00h to the cbnctl2 register, and set the transfer data length to 8 bits. (3) write e1h to the cbnctl0 register, and select the transmission/reception mode and msb first at the same time as enabling the operation of the communication clock (f cclk ). (4) the cbnstr.cbntsf bit is set to 1 by writing the transmit data to the cb ntx register, and the device waits for a serial clock input. (5) when a serial clock is input, output the transmit dat a to the sobn pin in synchronization with the serial clock, and capture the receiv e data of the sibn pin. (6) when transmission/reception of the transfer data length set with the cbnctl2 register is completed, stop the serial clock input, transmit data output, and data capturing, generate the reception completion interrupt request signal (intcbnr) at the last edge of the serial clock, and clear the cbntsf bit to 0. (7) read the cbnrx register. (8) to continue transmission/reception, write the trans mit data to the cbntx regist er again, and wait for a serial clock input. (9) read the cbnrx register. (10) to end transmission/reception, write the cbnctl0.cbnpwr bit = 0, the cbnctl0.cbntxe bit = 0, and the cbnctl0.cbnrxe bit = 0. remark n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 851 17.6.7 continuous transfer mode (master mode, transmission mode) msb first (cbnctl0.cbndir bit = 0), communication type 1 (cbnctl1.cbnckp and cbnctl1.cbndap bits = 00), communication clock (f cclk ) = f xp /2 (cbnctl1.cbncks2 to cbnctl1.cbncks0 bits = 000), transfer data length = 8 bits (cbnctl2.cbncl3 to cbnctl2.cbncl0 bits = 0000) remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 852 (1) operation flow start (1), (2), (3) (4), (8) (5) (11) no (7) transmission completed? end yes cbnctl1 register 00h cbnctl2 register 00h cbnctl0 register c3h write cbntx register start transmission cbnctl0 00h no (6), (9) intcbnt interrupt generated? yes no (10) yes cbntsf bit = 0? (cbnstr register) remarks 1. the broken lines indicate the hardware processing. 2. the numbers in this figure correspond to the processing numbers in (2) operation timing . 3. n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 853 (2) operation timing bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sckbn pin cbntsf bit (1) (2) (3) (4) (5) (6) (7) (8) (9) (11) (10) sobn pin intcbnt signal intcbnr signal l bit 0 (1) write 00h to the cbnctl1 register, and select communication type 1, communication clock (f cclk ) = f xp /2, and master mode. (2) write 00h to the cbnctl2 register, and set the transfer data length to 8 bits. (3) write c3h to the cbnctl0 register, and select the transmission mode, msb first, and continuous transfer mode at the same time as enablin g the operation of the communication clock (f cclk ). (4) the cbnstr.cbntsf bit is se t to 1 by writing the transmit data to the cbntx register, and transmission is started. (5) when transmission is started, output the serial clock to the sc kbn pin, and output the transmit data from the sobn pin in synchronization with the serial clock. (6) when transfer of the transmit data from the cbnt x register to the shift register is completed and writing to the cbntx register is enabled, the transmission enable inte rrupt request signal (intcbnt) is generated. (7) to continue transmission, write the transmit data to the cbntx register again after the intcbnt signal is generated. (8) when a new transmit data is written to the cbntx register before communicat ion completion, the next communication is started following communication completion. (9) the transfer of the transmit data from the cbntx register to the shift register is completed and the intcbnt signal is generated. to end continuous transmission with the current transmission, do not write to the cbntx register. (10) when the next transmit data is not written to t he cbntx register before tr ansfer completion, stop the serial clock output to the sckbn pin after transf er completion, and clear the cbntsf bit to 0. (11) to release the transmission enable status , write the cbnctl0.cbnpwr bit = 0 and the cbnctl0.cbntxe bit = 0 after che cking that the cbntsf bit = 0. caution in continuous transmi ssion mode, the reception comple tion interrupt request signal (intcbnr) is not generated. remarks 1. n = 0 to 5 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 854 17.6.8 continuous transfer mode (master mode, reception mode) msb first (cbnctl0.cbndir bit = 0), communication type 1 (cbnctl1.cbnckp and cbnctl1.cbndap bits = 00), communication clock (f cclk ) = f xp /2 (cbnctl1.cbncks2 to cbnctl1.cbncks0 bits = 000), transfer data length = 8 bits (cbnctl2.cbncl3 to cbnctl2.cbncl0 bits = 0000) remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 855 (1) operation flow start no intcbnr interrupt generated? cbnove bit = 1? (cbnstr) end yes no yes cbnrx register dummy read cbnsce bit = 0 (cbnctl0) cbnove bit = 0 (cbnstr) read cbnrx register is data being received last data? yes cbnsce bit = 0 (cbnctl0) read cbnrx register cbnctl1 register 00h cbnctl2 register 00h cbnctl0 register a3h start reception (1), (2), (3) (4) (5) (6) (8) (9) (12) (13) (13) no read cbnrx register (9) (7) read cbnrx register no yes cbnctl0 register 00h no yes cbntsf bit = 0? (cbnstr) (9) (10) (11) (8) intcbnr interrupt generated? remarks 1. the broken lines indicate the hardware processing. 2. the numbers in this figure correspond to the processing numbers in ( 2) operation timing . 3. n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 856 (2) operation timing bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sckbn pin cbntsf bit (1) (2) (4) (3) (5) (6) (7) (8) (9) (11) (13) (10) sibn pin intcbnr signal cbnsce bit sobn pin l sibn pin capture timing bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 (1) write 00h to the cbnctl1 register, and select communication type 1, communication clock (f cclk ) = f xp /2, and master mode. (2) write 00h to the cbnctl2 register, and set the transfer data length to 8 bits. (3) write a3h to the cbnctl0 register, and select t he reception mode, msb first, and continuous transfer mode at the same time as enabling the operation of the communication clock (f cclk ). (4) the cbnstr.cbntsf bit is set to 1 by per forming a dummy read of the cbnrx register, and reception is started. (5) when reception is started, output the serial clock to the sckbn pin, and capture the receive data of the sibn pin in synchronization with the serial clock. (6) when reception is completed, the reception co mpletion interrupt request signal (intcbnr) is generated, and reading of the cbnrx register is enabled. (7) when the cbnctl0.cbnsce bit = 1 upon communication completion, the next communication is started following communication completion. (8) to end continuous reception with the curr ent reception, write the cbnsce bit = 0. (9) read the cbnrx register. (10) when reception is completed, the intcbnr signa l is generated, and reading of the cbnrx register is enabled. when the cbnsce bit = 0 is set before communication completion, stop the serial clock output to the sckbn pin, and clear the cbntsf bit to 0, to end the receive operation. (11) read the cbnrx register. (12) if an overrun error occurs, write the cbns tr.cbnove bit = 0, and clear the error flag. (13) to release the reception enable status , write the cbnctl0.cbnpwr bit = 0 and the cbnctl0.cbnrxe bit = 0 after che cking that the cbntsf bit = 0. remarks 1. n = 0 to 5 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 857 17.6.9 continuous transfer mode (mast er mode, transmissi on/reception mode) msb first (cbnctl0.cbndir bit = 0), communication type 1 (cbnctl1.cbnckp and cbnctl1.cbndap bits = 00), communication clock (f cclk ) = f xp /2 (cbnctl1.cbncks2 to cbnctl1.cbncks0 bits = 000), transfer data length = 8 bits (cbnctl2.cbncl3 to cbnctl2.cbncl0 bits = 0000) remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 858 (1) operation flow start end yes no is receive data last data? yes (12) no write cbntx register cbnove bit = 0 (cbnstr) read cbnrx register read cbnrx register cbnctl1 register 00h cbnctl2 register 00h cbnctl0 register e3h no (9) yes (1), (2), (3) (4) (5) (7) (11) (7) (6), (11) (8) (13) (13) (14) (15) (15) (10) no yes intcbnt interrupt generated? no yes cbntsf bit = 0? (cbnstr) write cbntx register yes no is data being transmitted last data? start transmission/reception cbnctl0 register 00h cbnove bit = 1? (cbnstr) intcbnr interrupt generated? remarks 1. the broken lines indicate the hardware processing. 2. the numbers in this figure correspond to the processing numbers in (2) operation timing . 3. n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 859 (2) operation timing (1/2) sckbn pin cbntsf bit (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (13) (15) (12) sibn pin bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sobn pin intcbnt signal intcbnr signal sibn pin capture timing bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 (1) write 00h to the cbnctl1 register, and select communication type 1, communication clock (f cclk ) = f xp /2, and master mode. (2) write 00h to the cbnctl2 register, and set the transfer data length to 8 bits. (3) write e3h to the cbnctl0 register, and select the transmission/reception mode, msb first, and continuous transfer mode at the same time as enabling the operation of the communication clock (f cclk ). (4) the cbnstr.cbntsf bit is se t to 1 by writing the transmit data to the cbntx register, and transmission/reception is started. (5) when transmission/reception is st arted, output the serial clock to the sckbn pin, output the transmit data to the sobn pin in synchronization with the seri al clock, and capture the receive data of the sibn pin. (6) when transfer of the transmit data from the cbntx register to the shift register is completed and writing to the cbntx register is enabled, the transmission enable inte rrupt request signal (intcbnt) is generated. (7) to continue transmission/reception, write the tr ansmit data to the cbntx register again after the intcbnt signal is generated. (8) when one transmission/reception is completed, the reception completion interrupt request signal (intcbnr) is generated, and reading of the cbnrx register is enabled. remarks 1. n = 0 to 5 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 860 (2/2) (9) when a new transmit data is written to the cbntx register before communicat ion completion, the next communication is started following communication completion. (10) read the cbnrx register. (11) the transfer of the transmit data from the cbntx register to the shift register is completed and the intcbnt signal is generated. to end cont inuous transmission/reception with the current transmission/reception, do not wr ite to the cbntx register. (12) when the next transmit data is not written to t he cbntx register before tr ansfer completion, stop the serial clock output to the sckbn pin after transf er completion, and clear the cbntsf bit to 0. (13) when the reception error interrupt request si gnal (intcbnr) is generated, read the cbnrx register. (14) if an overrun error occurs, write the cbns tr.cbnove bit = 0, and clear the error flag. (15) to release the transmission/reception enable status, write the cbnctl0.cbnpwr bit = 0, the cbnctl0.cbntxe bit = 0, and the cbnctl0.cbnrxe bi t = 0 after checking that the cbntsf bit = 0. remark n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 861 17.6.10 continuous transfer mode (slave mode, transmission mode) msb first (cbnctl0.cbndir bit = 0), communication type 1 (cbnctl1.cbnckp and cbnctl1.cbndap bits = 00), communication clock (f cclk ) = external clock (sckbn) (cbnctl1.cbncks2 to cbnctl1.cbncks0 bits = 111), transfer data length = 8 bits (cbnctl2. cbncl3 to cbnctl2.cbncl0 bits = 0000) (1) operation flow start (1), (2), (3) (4) (4) (5), (8) (11) no (7) transmission completed? end yes cbnctl1 register 07h cbnctl2 register 00h cbnctl0 register c3h write cbntx register start transmission cbnctl0 00h no (10) yes cbntsf bit = 0? (cbnstr register) no (6), (9) intcbnt interrupt generated? yes no (9) yes sckbn pin input started? remarks 1. the broken lines indicate the hardware processing. 2. the numbers in this figure correspond to the processing numbers in (2) operation timing . 3. n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 862 (2) operation timing bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sckbn pin cbntsf bit (1) (2) (3) (4) (5) (6) (7) (8) (9) (11) (10) sobn pin intcbnt signal bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 (1) write 07h to the cbnctl1 register, and select communication type 1, communication clock (f cclk ) = external clock (sckbn), and slave mode. (2) write 00h to the cbnctl2 register, and set the transfer data length to 8 bits. (3) write c3h to the cbnctl0 register, and select the transmission mode, msb first, and continuous transfer mode at the same time as enablin g the operation of the communication clock (f cclk ). (4) the cbnstr.cbntsf bit is set to 1 by writing the transmit data to the cb ntx register, and the device waits for a serial clock input. (5) when a serial clock is input, output the transmit data from the sobn pin in synchronization with the serial clock. (6) when transfer of the transmit data from the cbnt x register to the shift register is completed and writing to the cbntx register is enabled, the transmission enable inte rrupt request signal (intcbnt) is generated. (7) to continue transmission, write the transmit data to the cbntx register again after the intcbnt signal is generated. (8) when a serial clock is input following completion of the transmission of the transfer data length set with the cbnctl2 register, continu ous transmission is started. (9) when transfer of the transmit data from the cbnt x register to the shift register is completed and writing to the cbntx register is enabled, the in tcbnt signal is generated. to end continuous transmission with the current transmission, do not write to the cbntx register. (10) when the clock of the transfer dat a length set with the cbnctl2 register is input without writing to the cbntx register, clear the cbntsf bit to 0 to end transmission. (11) to release the transmission enable status , write the cbnctl0.cbnpwr bit = 0 and the cbnctl0.cbntxe bit = 0 after che cking that the cbntsf bit = 0. caution in continuous transmis sion mode, the reception completi on interrupt request signal (intcbnr) is not generated. remark n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 863 17.6.11 continuous transfer m ode (slave mode, reception mode) msb first (cbnctl0.cbndir bit = 0), communication type 1 (cbnctl1.cbnckp and cbnctl1.cbndap bits = 00), communication clock (f cclk ) = external clock (sckbn) (cbnctl1.cbncks2 to cbnctl1.cbncks0 bits = 111), transfer data length = 8 bits (cbnctl2. cbncl3 to cbnctl2.cbncl0 bits = 0000)
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 864 (1) operation flow start no intcbnr interrupt generated? cbnove bit = 1? (cbnstr) end no yes yes cbnrx register dummy read cbnsce bit = 0 (cbnctl0) cbnove bit = 0 (cbnstr) read cbnrx register is data being received last data? yes cbnsce bit = 0 (cbnctl0) read cbnrx register cbnctl1 register 07h cbnctl2 register 00h cbnctl0 register a3h reception start (1), (2), (3) (4) (5) (4) (6) (8) (9) (12) (13) (13) no read cbnrx register (9) (7) read cbnrx register no yes cbnctl0 register 00h intcbnr interrupt generated? (9) (10) (11) (8) no yes cbntsf bit = 0? (cbnstr) no yes sckbn pin input started? remarks 1. the broken lines indicate the hardware processing. 2. the numbers in this figure correspond to the processing numbers in (2) operation timing . 3. n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 865 (2) operation timing bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sckbn pin cbntsf bit (1) (2) (4) (3) (5) (6) (7) (8) (9) (11) (13) (10) sibn pin intcbnr signal cbnsce bit sibn pin capture timing bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 (1) write 07h to the cbnctl1 register, and select communication type 1, communication clock (f cclk ) = external clock (sckbn), and slave mode. (2) write 00h to the cbnctl2 register, and set the transfer data length to 8 bits. (3) write a3h to the cbnctl0 register, and select t he reception mode, msb first, and continuous transfer mode at the same time as enabling the operation of the communication clock (f cclk ). (4) the cbnstr.cbntsf bit is set to 1 by perf orming a dummy read of the cbnrx register, and the device waits for a serial clock input. (5) when a serial clock is input, capture the receive dat a of the sibn pin in synchronization with the serial clock. (6) when reception is completed, the reception co mpletion interrupt request signal (intcbnr) is generated, and reading of the cbnrx register is enabled. (7) when a serial clock is input in the cbnctl0.cbns ce bit = 1 status, continuous reception is started. (8) to end continuous reception with the curr ent reception, write the cbnsce bit = 0. (9) read the cbnrx register. (10) when reception is completed, the intcbnr signa l is generated, and reading of the cbnrx register is enabled. when the cbnsce bit = 0 is set before communication completion, clear the cbntsf bit to 0 to end the receive operation. (11) read the cbnrx register. (12) if an overrun error occurs, write the cbns tr.cbnove bit = 0, and clear the error flag. (13) to release the reception enable status , write the cbnctl0.cbnpwr bit = 0 and the cbnctl0.cbnrxe bit = 0 after che cking that the cbntsf bit = 0. remark n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 866 17.6.12 continuous transfer mode (s lave mode, transmission/reception mode) msb first (cbnctl0.cbndir bit = 0), communication type 1 (cbnctl1.cbnckp and cbnctl1.cbndap bits = 00), communication clock (f cclk ) = external clock (sckbn) (cbnctl1.cbncks2 to cbnctl1.cbncks0 bits = 111), transfer data length = 8 bits (cbnctl2. cbncl3 to cbnctl2.cbncl0 bits = 0000)
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 867 (1) operation flow start end yes no is receive data last data? yes no write cbntx register cbnove bit = 0 (cbnstr) read cbnrx register read cbnrx register cbnctl1 register 07h cbnctl2 register 00h cbnctl0 register e3h no yes (1), (2), (3) (4) (5) (7) (11) (9) (7) (8) (13) (12) (13) (14) (15) (15) (10) no yes cbntsf bit = 0? (cbnstr) write cbntx register yes no is data being transmitted last data? start transmission/reception cbnctl0 register 00h cbnove bit = 1? (cbnstr) intcbnr interrupt generated? (6), (11) no yes intcbnt interrupt generated? (4) no yes sckbn pin input started? remarks 1. the broken lines indicate the hardware processing. 2. the numbers in this figure correspond to the processing numbers in (2) operation timing . 3. n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 868 (2) operation timing (1/2) sckbn pin cbntsf bit (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (13) (15) (12) sibn pin bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sobn pin intcbnt signal intcbnr signal sibn pin capture timing bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 (1) write 07h to the cbnctl1 register, and select communication type 1, communication clock (f cclk ) = external clock (sckbn), and slave mode. (2) write 00h to the cbnctl2 register, and set the transfer data length to 8 bits. (3) write e3h to the cbnctl0 register, and select the transmission/reception mode, msb first, and continuous transfer mode at the same time as enabling the operation of the communication clock (f cclk ). (4) the cbnstr.cbntsf bit is set to 1 by writing the transmit data to the cb ntx register, and the device waits for a serial clock input. (5) when a serial clock is input, output the transmit dat a to the sobn pin in synchronization with the serial clock, and capture the receiv e data of the sibn pin. (6) when transfer of the transmit data from the cbnt x register to the shift register is completed and writing to the cbntx register is enabled, the transmission enable inte rrupt request signal (intcbnt) is generated. (7) to continue transmission, write the transmit data to the cbntx register again after the intcbnt signal is generated. (8) when reception of the transfer dat a length set with the cbnctl2 regist er is completed, the reception completion interrupt request signal (intcbnr) is ge nerated, and reading of the cbnrx register is enabled. (9) when a serial clock is input continuously, continuous transmission/re ception is started. (10) read the cbnrx register. (11) when transfer of the transmit data from the cbnt x register to the shift register is completed and writing to the cbntx register is enabled, the in tcbnt signal is generated. to end continuous transmission/reception with the current transmission/re ception, do not write to the cbntx register. remark n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 869 (2/2) (12) when the clock of the transfer data length set with the cbnc tl2 register is input without writing to the cbntx register, the intcbnr signal is gener ated. clear the cbntsf bit to 0 to end transmission/reception. (13) when the intcbnr signal is generated, read the cbnrx register. (14) if an overrun error occurs, write the cbns tr.cbnove bit = 0, and clear the error flag. (15) to release the transmission/reception enable status, write the cbnctl0.cbnpwr bit = 0, the cbnctl0.cbntxe bit = 0, and the cbnctl0.cbnrxe bi t = 0 after checking that the cbntsf bit = 0. remark n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 870 17.6.13 reception error when transfer is performed with reception enabled (cbnctl0. cbnrxe bit = 1) in the continuous transfer mode, the reception completion interrupt requ est signal (intcbnr) is generated again when the next receive operation is completed before the cbnrx register is read after the intcbnr signal is generated, and the overrun error flag (cbnstr.cbnove) is set to 1. even if an overrun error has occurred, the previous receive data is lost since the cbnrx register is updated. even if a reception error has occurred, the intcbnr signal is generated again upon the next re ception completion if the cbnrx register is not read. to avoid an overrun error, complete reading the cbnrx r egister until one half clock before sampling the last bit of the next receive data from the intcbnr signal generation. (1) operation timing sckbn pin cbnrx register read signal (1) (2) (4) 01h 02h 05h 0ah 15h 2ah 55h aah 00h 01h 02h 05h 0ah 15h 2ah 55h shift register aah 55h cbnrx register sibn pin intcbnr signal cbnove bit sibn pin capture timing (3) (1) start continuous transfer. (2) completion of the first transfer (3) the cbnrx register cannot be read until one hal f clock before the completion of the second transfer. (4) an overrun error occurs, and the reception completion interrupt request signal (intcbnr) is generated, and then the overrun error flag (cbnst r.cbnove) is set to 1. the receive data is overwritten. remark n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 871 17.6.14 clock timing (1/2) (i) communication type 1 ( cbnckp and cbndap bits = 00) d6 d5 d4 d3 d2 d1 sckbn pin sibn capture reg-r/w sobn pin intcbnt interrupt note 1 intcbnr interrupt note 2 cbntsf bit d0 d7 (ii) communication type 3 (cbnckp and cbndap bits = 10) d6 d5 d4 d3 d2 d1 d0 d7 sckbn pin sibn capture reg-r/w sobn pin intcbnt interrupt note 1 intcbnr interrupt note 2 cbntsf bit notes 1. the intcbnt interrupt is set when the data writt en to the cbntx register is transferred to the data shift register in the continuous transmission or continuous transmission/reception mode. in the single transmission or single transmission/reception mode, the intcbnt interrupt request signal is not generated, but the intcbnr interrupt request signal is generated upon end of communication. 2. the intcbnr interrupt occurs if reception is correctly ended and receive data is ready in the cbnrx register while reception is enabled. in the single mode, the intcbnr interrupt request signal is generated even in the transmission mode, upon end of communication. caution in single transfer mode, writing to the cbntx register with the cbntsf bit set to 1 is ignored. this has no influence on the operation during transfer. for example, if the next data is written to the cbntx register when dma is started by generating the intcbnr signal, th e written data is not transfe rred because the cbntsf bit is set to 1. use the continuous transfer mode, not the si ngle transfer mode, for such applications.
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 872 (2/2) (iii) communication type 2 (cbnckp and cbndap bits = 01) d6 d5 d4 d3 d2 d1 d0 d7 sckbn pin sibn capture reg-r/w sobn pin intcbnt interrupt note 1 intcbnr interrupt note 2 cbntsf bit (iv) communication type 4 (cbnckp and cbndap bits = 11) d6 d5 d4 d3 d2 d1 d0 d7 sckbn pin sibn capture reg-r/w sobn pin intcbnt interrupt note 1 intcbnr interrupt note 2 cbntsf bit notes 1. the intcbnt interrupt is set when the data writt en to the cbntx register is transferred to the data shift register in the continuous transmission or continuous transmission/reception modes. in the single transmission or single transmission/reception modes, the intcbnt interrupt request signal is not generated, but the intcbnr interrupt request signal is generated upon end of communication. 2. the intcbnr interrupt occurs if reception is correctly ended and receive data is ready in the cbnrx register while reception is enabled. in the single mode, the intcbnr interrupt request signal is generated even in the transmission mode, upon end of communication. caution in single transfer mode, writing to the cbntx register with the cbntsf bi t set to 1 is ignored. this has no influence on the operation during transfer. for example, if the next data is written to the cbntx register when dma is started by generating the intcbnr signal, th e written data is not transfe rred because the cbntsf bit is set to 1. use the continuous transfer mode, not the si ngle transfer mode, for such applications.
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 873 17.7 output pins (1) sckbn pin when csibn operation is disabled (cbnctl0.cbnpwr bit = 0), the sckbn pin output status is as follows. cbnckp cbncks2 cbncks1 cbncks0 sckbn pin output 1 1 1 high impedance 0 other than above fixed to high level 1 1 1 high impedance 1 other than above fixed to low level remarks 1. the output level of the sckbn pin changes if any of the cbnctl1.cbnckp and cbncks2 to cbncks0 bits is rewritten. 2. n = 0 to 5 (2) sobn pin when csibn operation is disabled (cbnpwr bit = 0), the sobn pin output status is as follows. cbntxe cbndap cbndir sobn pin output 0 fixed to low level 0 sobn latch value (low level) 0 cbntx value (msb) 1 1 1 cbntx value (lsb) remarks 1. the sobn pin output chan ges when any one of the cbnctl0.cbntxe, cbnctl0.cbndir bits, and cbnctl1.cbndap bit is rewritten. 2. : don?t care 3. n = 0 to 5
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 874 17.8 baud rate generator the brg1 to brg3 and csib0 to csib5 baud rate generators are connected as shown in the following block diagram. csib0 csib1 csib2 csib3 csib4 brg1 brg2 brg3 csib5 f xp f xp f xp f brg1 f brg2 f brg3 remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 875 (1) brgm prescaler mode registers (prsmm) the prsm1 to prsm3 registers control generation of the baud rate signal for csib. these registers can be read or written in 8-bit or 1-bit units. reset sets these registers to 00h. 0 prsmm (m = 1 to 3) 0 0 bgcem 0 0 bgcsm1 bgcsm0 disabled enabled bgcem 0 1 baud rate output f xp f xp /2 f xp /4 f xp /8 setting value (k) 0 1 2 3 bgcsm1 0 0 1 1 bgcsm0 0 1 0 1 input clock selection (f bgcsm ) after reset: 00h r/w address: prsm1 fffff320h, prsm2 fffff324h, prsm3 fffff328h < > cautions 1. do not rewrite the prsmm register during operation. 2. set the prsmm register befo re setting the bgcem bit to 1. 3. be sure to set bits 2, 3, and 5 to 7 to ?0?. remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 876 (2) brgm prescaler compare registers (prscmm) the prscm1 to prscm3 registers are 8-bit compare registers. these registers can be read or written in 8-bit units. reset sets these registers to 00h. prscmm7 prscmm (m = 1 to 3) prscmm6 prscmm5 prscmm4 prscmm3 prscmm2 prscmm1 prscmm0 after reset: 00h r/w address: prscm1 fffff321h, prscm2 fffff325h, prscm3 fffff329h cautions 1. do not rewrite the pr scmm register during operation. 2. set the prscmm register before setting the prsmm.bgcem bit to 1. 17.8.1 baud rate generation the transmission/reception clock is generated by dividing the main clock. the baud rate generated from the main clock is obtained by the following equation. f brgm = caution set f brgm to 8 mhz or lower. remark f brgm : brgm count clock f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock k: prsmm register setting value = 0 to 3 n: prscmm register setting value = 1 to 256 however, n = 256 only when prscmm register is set to 00h. m = 1 to 3 f xp 2 k+1 n
chapter 17 3-wire variable-length serial i/o b (csib) user?s manual u19201ej3v0ud 877 17.9 cautions (1) when transferring transmit data and receive data using dma transfer, error processing cannot be performed even if an overrun error occurs during serial transfer. check that the no overrun error has occurred by reading the cbnstr.cbnove bit after dma transfer has been completed. (2) in regards to registers that are forbidden from bei ng rewritten during operations (cbnctl0.cbnpwr bit is 1), if rewriting has been carried out by mistake during oper ations, set the cbnctl0.cbnpwr bit to 0 once, then initialize csibn. registers to which rewriting during op eration are prohibited are shown below. ? cbnctl0 register: cbntxe, cbnrxe, cbndir, cbntms bits ? cbnctl1 register: cbnckp, cbndap, cbncks2 to cbncks0 bits ? cbnctl2 register: cbncl3 to cbncl0 bits (3) in communication type 2 and 4 (cbnctl1.cbndap bit = 1), the cbnstr.cbntsf bit is cleared half a sckbn clock after occurrence of a receptio n completion interrupt (intcbnr). in the single transfer mode, writing the next transmit data is ignored during communication (cbntsf bit = 1), and the next communication is not st arted. also if reception-only co mmunication (cbnctl0.cbntxe bit = 0, cbnctl0.cbnrxe bit = 1) is set, the next communication is not started even if the receive data is read during communication (cbntsf bit = 1). therefore, when using the single transfer mode with communication type 2 or 4 (cbndap bit = 1), pay particular attention to the following. ? to start the next transmission, confirm that cbntsf bit = 0 and then write the transmit data to the cbntx register. ? to perform the next reception continuously when re ception-only communication (cbntxe bit = 0, cbnrxe bit = 1) is set, confirm that cbntsf bit = 0 and then read the cbnrx register. or, use the continuous transfer mode inst ead of the single transfer mode. us e of the continuous transfer mode is recommended especially when using dma. remark n = 0 to 5
user?s manual u19201ej3v0ud 878 chapter 18 3-wire variable-l ength serial i/o e (csie) the v850e/sj3-h and v 850e/sk3-h provide a cl ocked serial interfac e called 3-wire variable -length serial i/o e (csie). the number of channels differs depending on th e product in the v850e/sj3-h and v850e/sk3-h as shown in the table below. table 18-1. number of channels available fo r 3-wire variable-length serial i/o e (csie) v850e/sj3-h product name pd70f3931, 70f3932, and 70f3933 only other than pd70f3931, 70f3932, and 70f3933 v850e/sk3-h channel 0 channels 2 channels 18.1 port setting of csie0 and csie1 18.1.1 v850e/sj3-h (other than pd70f3931, 70f3932, 70f3933) table 18-2. pin configuration alternate-function pin port <1> port <2> mode pin name pin no. port alternate function pin no. port alternate function sie0 43 p60 rtp10/rxda4 ? ? ? soe0 44 p61 rtp11/txda4 ? ? ? csie0 scke0 45 p62 rtp12 ? ? ? sie1 46 p63 rtp13/kr4 ? ? ? soe1 47 p64 rtp14/kr5 ? ? ? csie1 scke1 48 p65 rtp15/kr2/tiq03/toq03 ? ? ? (1) csie0 the serial reception data/serial transmission data/se rial clock pins (sie0, soe0, and scke0) of csie0 are assigned to p60 to p62, respectively. when using cs ie0, specify p60 to p62 as the sie0, soe0, and scke0 pins in advance, using the pmc6, pfc6, and pfce6 registers. the sie0, soe0, and scke0 pins function alternately as the pins (rxda4 and txda4) of uarta4 as well as the real-time output pins (rtp10, rtp11, and rtp12); therefore, they cannot be used at the same time. (2) csie1 the serial reception data/serial transmission data/se rial clock pins (sie1, soe1, and scke1) of csie1 are assigned to p63 to p65, respectively. when using cs ie1, specify p63 to p65 as the sie1, soe1, and scke1 pins in advance, using the pmc6, pfc6, and pfce6 registers. the sie1, soe1, and scke1 pins function alternately as the real-time output pins (rtp13, rtp14, rtp15) and they cannot be used at the same time. the sie1, soe1, and scke1 pins function alternately as the key interrupt input pins (kr4, kr5, and kr2), as well as the tmq0 i/o pins (tiq03 and toq03), therefore, when using them at the same time, use the pins assigned to the other port (kr4:p54, kr5:p55, kr2/tiq03, and toq03:p52).
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 879 cautions 1. the csie0 and csie1 functions are not included in the pd70f3931, 70f3932, and 70f3933. 2. do not switch port settings during operati on. be sure to disable operation of the unit which does not perform the port setting and is not being used. 18.1.2 v850e/sk3-h table 18-3. pin configuration alternate-function pin port <1> port <2> mode pin name pin no. port alternate function pin no. port alternate function sie0 53 p60 rtp10/rxda4 ? ? ? soe0 54 p61 rtp11/txda4 ? ? ? csie0 scke0 55 p62 rtp12 ? ? ? sie1 56 p63 rtp13/kr4 ? ? ? soe1 57 p64 rtp14/kr5 ? ? ? csie1 scke1 58 p65 rtp15/kr2/tiq03/toq03 ? ? ? (1) csie0 the serial reception data/serial transmission data/se rial clock pins (sie0, soe0, and scke0) of csie0 are assigned to p60 to p62, respectively. when using cs ie0, specify p60 to p62 as the sie0, soe0, and scke0 pins in advance, using the pmc6, pfc6, and pfce6 registers. the sie0, soe0 and scke0 pins function alternatel y as the real-time output pins (rtp10, rtp11, and rtp12), and they cannot be used at the same time. the sie0 and soe0 pins function alternately as the transmission/reception pins (rxda4 and txda4) of uart a4. when using them at the same time, therefore, use the pins assigned to the other port (p56 and p57). (2) csie1 the serial reception data/serial transmission data/se rial clock pins (sie1, soe1, and scke1) of csie1 are assigned to p63 to p65, respectively. when using cs ie1, specify p63 to p65 as the sie1, soe1, and scke1 pins in advance, using the pmc6, pfc6, and pfce6 registers. the sie1, soe1, and scke1 pins function alternately as the real-time output pins (rtp13, rtp14, rtp15) and they cannot be used at the same time. the sie1, soe1, and scke1 pins function alternately as the key interrupt input pins (kr4, kr5, and kr2), as well as the tmq0 i/o pins (tiq03 and toq03), therefore, when using them at the same time, use the pins assigned to the other port (kr4:p54, kr5:p55, kr2/tiq03, and toq03:p52). caution do not switch port settings during operation. be sure to disable operation of the unit which does not perform the port setting and is not being used.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 880 18.2 features { transfer rate: 8 mbps max. { master mode and slave mode selectable { transfer data length selectable in 1-bit units between 8 and 16 bits { transfer data msb-first/lsb-first switchable { serial clock and data phase switchable { sixteen on-chip 16-bit transmission/reception buffers (csibufn) available { transmission mode, reception mode, and transmission/reception mode specifiable ? transmission mode: transmission is started by writ ing transmit data to the csien transmit buffer register (centx0) while transmission is enabled. ? reception mode: reception is started by wr iting dummy data to the csien transmit buffer register (centx0) while reception is enabled. ? transmission/reception mode: transmission/reception is started by writing transmit data to the csien transmit buffer register (centx0) while transmission/reception is enabled. { interrupt request signals ? transmit/receive comple tion interrupt (intcent) ? csibufn overflow interrupt (intcentiof) { 3-wire soen: serial data output sien: serial data input scken: serial clock i/o remark n = 0, 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 881 18.3 configuration the following shows the block diagram of csien. figure 18-1. block diagram of csien (1/2) soen scken intcent sien scken transfer control csi data buffer register n (csibufn) brgn prescaler output f xp csien reception data buffer register (cenrx0) 15 0 intcentiof transfer data control csien status register (censtr) csien transmission buffer register (centx0) selector note 1 note 2 f xclk csien control register 1 (cenctl1) cenmdl1 cenmdl0 cencks2 cencks1 cencks0 cenmdl2 internal bus internal bus shift register n (sion) notes 1. in single mode 2. in continuous mode remark 1. n = 0, 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 882 figure 18-1. block diagram of csien (2/2) remark 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock f xclk : base clock selected in cenctl1.cencks2 to cencks0 bit csien includes the following hardware. table 18-4. configuration of csien item configuration registers serial i/o shift register n (sion) csien receive data buffer register (cenrx0) csien transmit data buffer register (centx0) csi data buffer register n (csibufn) control registers csien control register 0 (cenctl0) csien control register 1 (cenctl1) csien control register 2 (cenctl2) csien control register 3 (cenctl3) csien status register (censtr)
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 883 (1) serial i/o shift registers n (sion) the sion register is an 8-bit register for converting between serial data and parallel data. sion is used for both transmission and reception. data is shifted in (reception) or shifted out (transmissi on) beginning at either the msb side or the lsb side. (2) csien receive data buffer register (cenrx0) the cenrx0 register is a 16-bit buffer register that stores receive data. by consecutively reading this regist er in the continuous mode (cenctl0. centms bit = 1), the received data in the csibufn register can be sequ entially read while the csibufn pointer for reading is incremented. however, if the number of the read value exceeds the receive data count in the cenrx0 register, the read value becomes undefined. in the single mode (cenctl0.centms bit = 1), received da ta is read by reading the cenrx0 register and it is judged that the cenrx0 register has become empty. the cenrx0 register is read-only, in 16-bit units. when the higher 8 bits of the cenrx0 register are used as the cenrx0h register and the lower 8 bits as the cenrx0l register, these registers are read-only, in 8-bit units. when reading in 8-bit units, be sure to read the cenrx0h register and cenrx0l register in that order. the received data is always read from the lower bits, regardless of the transfer direction. if the receiv ed data is 8 bits, read the cenrx0l register only. reset sets this register to 0000h. but, be undefined in the consecutive mode. in addition to reset input, the cenrx0 register can be in itialized by clearing (to 0) the cenctl0.cenpwr bit. caution because the values of the cenflf, cenemf, centsf, censfp3 to censfp0 bits may change at any time during transfer, their values during transfer may differ from the actual values. especially, use the centsf bit independently (d o not use this bit in relation with the other bits). to detect the end of tr ansfer by the censtr register, ch eck to see if the cenemf bit is 1 after the data to be transferred has been written to the csibufn register. after reset: 0000h note 1 r address: ce0rx0 fffff902h note 2 , ce0rx0l fffff902h note 2 , ce0rx0h fffff903h note 2 , ce1rx0 fffff942h note 2 , ce1rx0l fffff942h note 2 , ce1rx0h fffff943h note 2 cenrx0 notes 1. in continuous mode (cenct l0.centms = 1): undefined 2. other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) the following shows the cenrx0 register in reading by each transfer mode. transfer mode cenrx0 single mode (cenctl0.centms bit = 0) reading the data value in reception data buffer consecutive mode (cenctl0.centms bit = 0) reading the reception data value in the csibufn pointer for current read showing (the initial value of the csibufn register by reset is undefined).
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 884 (3) csien transmit data bu ffer register (centx0) the centx0 register is a 16-bit buffer register that stores transmit data. when transmit data is written to this register, the data is sequentially stor ed in the csibufn register while the csibufn pointer for writing is incremented. writing to the centx register for the number of times exceeding the set value of the cenctl3.censfn 3 to cenctl3.censfn0 bits (csien transfer data count) during the continuous transfer mode (cenctl0. centms bit = 1) is prohibited. when the data of this register is read, the value of the trans mit data written last is read. the centx0 register can be read or written in 16-bit units. when the higher 8 bits of the centx0 register are used as the centx0h regi ster, and the lower 8 bits as the centx0l register, these registers can be read or written in 8-bit units. when reading in 8-bit units, be sure to read the centx0h register a nd centx0l register in that order. in addition, write the transmission data from the lower bits, regardless of the transfer direction. if t he transmission data is 8 bits, write the centx0l register only. reset sets this register to 0000h. caution accessing the centx0 register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock after reset: 0000h r/w address: ce0tx0 fffff906h note , ce0tx0l fffff906h note , ce0tx0h fffff907h note , ce1tx0 fffff946h note , ce1tx0l fffff946h note , ce1tx0h fffff947h note centx0 note other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h) the following shows the centx0 regist er operation in reading/writing. read/write operation of centx0 register write storing the transmission data in the csibufn register by step read reading the value of transmission data writing at last (4) csi data buffer register n (csibufn) by consecutively writing transmit data to the centx0 regi ster from where it is transferred, up to sixteen 16-bit data can be stored in the csibufn regi ster while the csibufn pointer for wr iting is automatically incremented. in the continuous mode, the data received in the csibufn register can be sequentially read while the read csibufn pointer is automatically in cremented, by continuously reading the receive data from the cenrx0 register.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 885 18.4 control registers the following registers are used to control csien. ? csien control register 0 (cenctl0) ? csien control register 1 (cenctl1) ? csien control register 2 (cenctl2) ? csien control register 3 (cenctl3) ? csien status register (censtr)
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 886 (1) csien control register 0 (cenctl0) the cenctl0 register contro ls the operation of csien. these registers can be read or written in 8-bit or 1-bit units. writing the centms, cendir, and censit bits is enabled only when centxe bit = 0 and cenrxe bit = 0. reset sets this register to 00h. caution accessing the cenctl0 register is prohibited in the following st atuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock (1/2) after reset: 00h r/w address: ce0ctl0 fffff900h note , ce1ctl0 fffff940h note cenpwr cenctl0 (n = 0, 1) centxe cenrxe centms censit censit 0 0 < > < > < > < > < > cenpwr disables csien oper ation/specifies inhibited 0 csien operation disables 1 csien operation enables ? the csien unit is reset when the cenpwr bit = 0, and csien is stopped. to operate csien, first set the cenpwr bit to 1. ? when rewriting the cenpwr bit from 0 to 1 or from 1 to 0, simultaneously rewriting the bits other than the cenctl0.cenpwr register is prohibited. when the cenpwr bit = 0, rewriting the bits other than the cenpwr bit of the cenctl0 register, and the centx0, ce ntx0l, and censtr registers is prohibited. centxe enables or disables transmission 0 disables transmission operation. 1 enables transmission operation. ? the centxe bit is reset when the cenpwr bit is cleared to 0. ? when the cenpwr bit = 1, after the ce ntxe bit has been cleared to 0, setting the centxe bit to 1 before 2 cycles of the operation clock (f xp ) elapse is disabled. the transmit operation is enabled after the centxe bit has been set to 1, and 2 cycles of the operation clock (f xp ) have elapsed. note other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3- h), and 70f3933 (v850e/sj3-h) caution be sure to clear bits 0 and 1 to ?0?. if these bits are set to 1, the operation is not guaranteed.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 887 (2/2) cenrxe enables or disables reception 0 disables reception. 1 enables reception. ? the cenrxe bit is reset when the cenpwr bit is cleared to 0. ? when the cenpwr bit = 1, after the ce nrxe bit has been cleared to 0, setting the cenrxe bit to 1 before 2 cycles of the operation clock (f xp ) elapse is disabled. the receive operation is enabled after the cenrxe bit has been set to 1 and 2 cycles of the operation clock (f xp ) have elapsed. centms specifies the transfer mode 0 single mode 1 continuous mode cendir specifies the transfer direction (msb/lsb) 0 msb first 1 lsb first ? specifies the transfer direction when data is written from the centx0 register to the csibufn register or read from the cenrx0 and csibufn registers. censit controls delay of the transmissi on completion interrupt signal (intcent) 0 no delay 1 delay mode (in the continuous mode (trmdn = 1), the next data transfer is delayed half a cycle because a del ay of half a cycle is inserted when transfer of 1-bit data is complete.) ? the delay mode (censit bit = 1) is valid only in the master mode (when the cencks2 to cencks0 bits are other than 111). in the slave mode (when the cencks2 to cencks0 bits are 111), do not set the delay mode. even if the delay mode is set, intcent is not affected by the censit bit. ? if the censit bit is set to 1 in the c ontinuous mode (trmdn bit = 1), the intcent interrupt is not output except when the last data set by the cenctl3.censfn3 to cenctl3.censfn0 bits is transferred, but a delay of half a clock (1/2 serial clock) can be inserted between each data transfer.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 888 (2) csien control register 1 (cenctl1) the cenctl1 register is an 8-bit register that cont rols the operation clock and operating mode of csien. these registers can be read or written in 8-bit or 1-bit units. data c an be written to the cenctl1 register only when the cenctl0.centxe bit = 0 and cenrxe bit = 0. reset sets this register to 07h. (1/2) cenmdl2 cenctl1 (n = 0, 1) cenmdl1 cenmdl0 cenckp cendap cencks2 cencks1 cencks0 after reset 07h r/w address: ce0ctl1 fffff901h note , ce1ctl1 fffff941h note, cenmdl2 cenmdl1 cenmdl0 set value (n) specification the transfer clock (brgn output signal) 0 0 0 ? brgn stop mode (power save) 0 0 1 1 f xclk /2 0 1 0 2 f xclk /4 0 1 1 3 f xclk /6 1 0 0 4 f xclk /8 1 0 1 5 f xclk /10 1 1 0 6 f xclk /12 1 1 1 7 f xclk /14 ? in the slave mode (cencks2 to cencks0 bits = 111), clear the cenmdl2 to cenmdl0 bits to 000 (brgn stop mode). cenckp cendap specification the data transmission/reception timing for scken communication type 1 0 0 d7 d6 d5 d4 d3 d2 d1 d0 scken (i/o) sien capture soen (output) communication type 2 0 1 d7 d6 d5 d4 d3 d2 d1 d0 scken (i/o) sien capture soen (output) communication type 3 1 0 d7 d6 d5 d4 d3 d2 d1 d0 scken (i/o) sien capture soen (output) communication type 4 1 1 d7 d6 d5 d4 d3 d2 d1 d0 scken (i/o) sien capture soen (output) note other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3- h), and 70f3933 (v850e/sj3-h) remark f xclk : base clock selected by cencks2 to cencks0 bit
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 889 (2/2) cencks2 cencks1 cencks0 set value (n) base clock (f xclk ) mode 0 0 0 0 f xp master mode 0 0 1 1 f xp /2 master mode 0 1 0 2 f xp /4 master mode 0 1 1 3 f xp /8 master mode 1 0 0 4 f xp /16 master mode 1 0 1 5 f xp /32 master mode 1 1 0 6 f xp /64 master mode 1 1 1 ? external clock (scken) slave mode ? if the cencks2 to cencks0 bits are cleared to 000, setting the cenmdl2 to cenmdl0 bit to 001 is prohibited. remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 890 (3) csien control register 2 (cenctl2) the cenctl2 register is used to sele ct the transfer data length of csien. these registers can be read or wr itten in 8-bit or 1-bit units. the cenctl2 register may be transferring data when t he cenctl0.centxe bit or cenrxe bit is 1. be sure to clear the centxe and cenrxe bits to 0 befor e writing data to the cenctl2 register. reset sets this register to 00h. after reset: 00h r/w address: ce0ctl2 fffff909h note , ce1ctl2 fffff949h note 0 cenctl2 (n = 0, 1) 0 0 0 cendls3 cendls2 cendls1 cendls0 cendls3 cendls2 cendls1 cendls0 specification of transfer bit length 0 0 0 0 16 bits 1 0 0 0 8 bits 1 0 0 1 9 bits 1 0 1 0 10 bits 1 0 1 1 11 bits 1 1 0 0 12 bits 1 1 0 1 13 bits 1 1 1 0 14 bits 1 1 1 1 15 bits other than above setting prohibited ? if a transfer data length other than 16 bits is specified (cendls3 to cendls0 bits = 0000), an undefined value is read to the higher excess bits of the cenrx0 and csibufn registers (see 18.6 (3) data transfer direction specification function ). note other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3- h), and 70f3933 (v850e/sj3-h) caution be sure to clear bits 7 to 4 to ?0?. if they are set to 1, the operation is not guaranteed.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 891 (4) csien status register (cenctl3) the cenctl3 register is used to set the number of transfer data of csien in the continuous mode (cenctl0.centms bit = 1). rewriting of the cenctl3 regi ster is prohibited during tr ansfer in the continuous mode (censtr.centsf bit = 1). these registers can be read or wr itten in 8-bit or 1-bit units. reset sets this register to 00h. after reset: 00h r/w address: ce0ctl3 fffff90ch note , ce1ctl3 fffff94ch note 0 cenctl3 (n = 0, 1) 0 0 0 censfn3 censfn2 censfn1 censfn0 censfn3 censfn2 censfn1 censfn0 specification of number of transfer data 0 0 0 0 16 0 0 0 1 1 0 0 1 0 2 0 0 1 1 3 0 1 0 0 4 0 1 0 1 5 0 1 1 0 6 0 1 1 1 7 1 0 0 0 8 1 0 0 1 9 1 0 1 0 10 1 0 1 1 11 1 1 0 0 12 1 1 0 1 13 1 1 1 0 14 1 1 1 1 15 ? writing data exceeding the value set by the censfn3 to censfn0 bits (number of csien transfer data) to the csibufn register is prohibited. note other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3- h), and 70f3933 (v850e/sj3-h) caution be sure to clear bits 7 to 4 to ?0?.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 892 (5) csien status register (censtr) these registers indicate the status of t he csibufn register or the transfer status. these registers can be read or written in 8-bit or 1-bit un its (however, bits 6 to 0 can only be read. they do not change even if they are written). reset sets this register to 20h. in addition to reset input, the censtr register can be initialized by clearing (0) the cenctl0.cenpwr bit. cautions 1. accessing the censtr register is prohibi ted in the following stat uses. for details, refer to 3.4.9 (2) accessing specific on- chip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock 2. because the values of the cenflf, cene mf, centsf, censfp3 to censfp0 bits may change at any time during transfer, their valu es during transfer may differ from the actual values. especially, u se the centsf bit independently (do not use this bit in relation with the other bits). to detect the end of transfer by the censtr register, check to see if the cenemf bit is 1 after the data to be transfe rred has been written to the csibufn register.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 893 (1/2) after reset: 20h r/w address: ce0str fffff908h note , ce1str fffff948h note cenpct censtr (n = 0, 1) cenflf cenemf centsf censfp3 censfp2 censfp1 censfp0 < > < > < > < > cenpct specifies clearing of the csibufn pointer 0 no operation 1 clear all csibufn pointers to 0. ? this bit is always 0 when it is read. ? if 1 is written to the cenpct bit in the middle of transfer, transfer is aborted. because all the csibufn pointers are cleared to 0, the remaining data in the csibufn register is ignored. if 1 is written to the cenpct bit, be sure to read the censtr register to check to see if all the csibufn pointers have been correctly cleared to 0 (cenflf bit = 0, cenemf bit = 1, censfp3 to censfp0 bits = 0000). writing to the cenpct bit is prohibited before confirming that a ll csibufn pointers have been cleared to 0 without fail. cenflf this flag indicates the full status of the csibufn register 0 csibufn register has a vacancy. 1 csibufn register is full. ? this bit is cleared to 0 when the cenc tl0.cenpwr register is cleared to 0 or when the cenpct bit is set to 1. ? if transfer of 16 data is specified in the continuous mode (cenctl0.centms bit = 1) (cenctl0.centms bit = 0000), the cenflf bit is set to 1 in the same way as in the single mode (cenctl0.centms bit = 1) when 16 data are in the csibufn register. if even one of the data has been completely transferred, the cenflf bit is cleared to 0. however, this does not mean that the csibufn register has a vacancy. in this case, writing the next transmission data to the csibufn register is prohibited. even if the data is wri tten to the csibufn register, it is not transferred. if a data reception process is executed, the received data is overwritten. to execute the next transfer, be sure to wait until all transfers have completed, then write 1 to the cenpct bi t to clear (0) the all csibufn pointers. cenemf this flag indicates the empt y status of the csibufn register 0 data is in csibufn register. 1 csibufn register is empty. ? this flag is set to 1 when the cenctl0.ce npwr register is cleared to 0 or when the cenpct bit is set to 1. ? if the data written to the csibufn regist er has been transferred, the cenemf bit is set to 1 (even if receive data is stored in the csibufn register). note other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3- h), and 70f3933 (v850e/sj3-h)
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 894 (2/2) centsf this flag indicates transfer status 0 idle status 1 transfer or transfer start processing in progress ? this flag is cleared to 0 when the cenc tl0.cenpwr register is cleared to 0 and the cenpct bit is set to 1, or when the cenctl0.centxe bit = 0 and cenctl0.cenrxe bit = 0 register are cleared to 0. ? this flag is ?1? from when transfer is st arted until there is no more transfer data in the csibufn register in the single mode (cenctl0.centms bit = 0) or until the specified number of data has been transferred in the continuous mode (cenctl0.centms bit = 1). censfp3 to censfp0 ? in the single mode (cenctl0.centms bit = 0), the ?number of transfer data remaining in csibufn register (csibufn pointer value for writing ? csibufn pointer value for sion loading)? can be read. ? in the continuous mode (cenctl0.centms bit = 1), the ?number of data completely transferred (value of csibufn pointer for sion loading/storing)? can be read. if the censfp3 to censfp0 bits are 0h, however, the number of transferred data is as follows, depending on the setting of the cenemf bit. when cenemf bit = 0: number of transferred data = 0 when cenemf bit = 1: number of transferred data = 16 or status before starting transfer (before writing transfer data) ? these bits are cleared to 0 in synchr onization with the operating clock when the cenpct bit = 1. however, the values of these bits are held until the cenctl0.cenpwr register is cleared to 0 or the cenpct bit is set to 1.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 895 18.5 baud rate generator n (brgn) the transfer clock of csien can be selected from the output of a dedicated baud rate generator or external clock (n = 0, 1). the serial clock source is specified by the cenctl1 register. in the master mode (cenctl1.cencks2 to cenctl1.cenc ks0 bits = other than 111 in the csien register), brgn is selected as the clock source. (1) transfer clock figure 18-2. transfer clock of csien selector prescaler (1/1, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64) brgn (1/2, 1/4, 1/6, 1/8, 1/10, 1/12, 1/14) transfer clock f xp sckn cenmdl1 cenmdl0 cencks2 cencks1 cencks0 cenmdl2 f xclk csien control register (cenctl1) remarks 1. n = 0, 1 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock f xclk : base clock selected in cenctl1.cencks2 to cenctl1.cencks0 bits
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 896 (2) baud rate the baud rate is calculated by the following expression. baud rate = f n 2 k+1 [bps] f = f xp k = value set by cenctl1.cencks2 to cenct l1.cencks0 bits (k = 0, 1, 2, ?, 6) n = value set by cenctl1.cenmdl2 to cenct l1.cenmdl0 bits (n = 1, 2, 3, ?, 7) caution if the cenctl1.cencks 2 to cenctl1.cencks0 bits are cleared to 000, setting the cenctl1.cenmdl2 to cenctl1.cenmd l0 bits to 001 is prohibited. remark f xp : peripheral clock frequency (prescaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock (3) example of baud rate setting (unit: mbps) table 18-5. baud rate ge nerator setting data in f xp = 32 mhz k n 1 2 3 4 5 6 7 0 setting prohibited 8 5.3333 4 3.2 2.6667 2.2857 1 8 4 2.6667 2 1.6 1.3333 1.1429 2 4 2 1.3333 1 0.8 0.6667 0.5714 3 2 1 0.6667 0.5 0.4 0.3333 0.2857 4 1 0.5 0.3333 0.25 0.2 0.1667 0.1429 5 0.5 0.25 0.1667 0.125 0.1 0.0833 0.0714 6 0.25 0.125 0.0833 0.0625 0.05 0.0417 0.0357
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 897 18.6 operation (1) operation modes table 18-6. operation modes centms bit cencks2 to cencks0 bits cent xe, cenrxe bits cendir bit censit bit master mode enables/disables intcent delay mode single mode slave mode ? master mode enables/disables intcent delay mode consecutive mode slave mode transmission, reception, transmission/reception msb/lsb first ? remarks 1. centxe bit: bit 6 of cenctl0 register cenrxe bit: bit 5 of cenctl0 register centms bit: bit 4 of cenctl0 register cendir bit: bit 3 of cenctl0 register censit bit: bit 2 of cenctl0 register cencks2 to cencks0 bits: bits 2 to 0 of cenctl0 register 2. n = 0, 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 898 (2) function of csi data buffer registers 0, 1 (csibuf0, csibuf1) by consecutively writing the transmit data to the centx0 register from w here it is transferred, up to sixteen 16- bit data can be stored in the csibufn register whil e the csibufn pointer for writing is automatically incremented (n = 0, 1). the condition under which transfer is to be started (censtr.cenemf bit = 0) is satisfied when data is written to the lower 8 bits (centx0l register) of the centx0 regi ster. if a transfer data length of 9 bits or more is specified (cenctl2.cendls3 to ce nctl2.cendls0 bits = 0000 or 1001 to 1111), data must be written to the centx0 register in 16-bit units or to the centx0h and centx0l registers, in that order, in 8-bit units. if the transfer data length is set to 8 bits (cenctl2.cend ls3 to cenctl2.cendls0 bits = 1000), data must be written to the centx0l register in 8-bit units or to the ce ntx0 register in 16-bit units. (if data is written to the centx0l register in 16-bit units, howe ver, the higher 8 bits of the data (of the centx0h register) are ignored and not transferred). the censtr.cenflf register is set to 1 when 16 data exist in the csibufn regi ster and outputs a csibufn overflow interrupt (intcentiof) w hen the cenflf bit = 1 and when the 17th transfer data is written (17th transfer data is not written and ignored). sixteen data exist in the csibufn r egister in the single mode (cenctl0.centms bit = 1) when ?csibufn pointer value for writing = csibufn pointer value for sion loading, and censtr.cenflf bit = 1?. when the csibufn pointer for sion loading is incremented after completion of transfer while cenflf bit = 1, the cenflf bit is cleared to 0 and the ne xt transmission data can be written. in the continuous mode (cenctl0.cent ms bit = 1), when one data has been transferred, the cenflf bit is cleared to 0, but writing the next transmission data is prohibited (if a receive operation is processed, the received data is stored in the csibufn register. theref ore, if the transmission data is written to the register, the received data is overwritten and destroyed).
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 899 figure 18-3. function of csi da ta buffer register n (csibufn) csi data buffer register n (csibufn) 15 15 0 0 transfer data 0 transfer data 1 transfer data 2 transfer data 3 transfer data 4 censfp3 to censfp0 70 3 4 incremented sion load csibufn pointer incremented write csibufn pointer centx0h centx0l 15 8 7 0 csien transmission data buffer register (centx0) csien status register (censtr) remark n = 0, 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 900 (3) data transfer direct ion specification function the data transfer direction can be changed by using the cenctl0.cendir bit (n = 0, 1). (a) msb first (cendir bit = 0) figure 18-4. transfer data length: 8 bits (cen ctl2.cendls3 to cenctl2.cendls0 bits = 1000), transfer direction: msb first (cenctl0.cendir bit = 0) (1/2) (i) transfer direction: msb first di7 di6 di5 di4 di3 di2 di1 di0 do7 do6 do5 do4 do3 do2 do1 do0 scken (i/o) sien (input) soen (output) (ii) writing from centx0 register to csibufn register centx0 csibufn data 00h sion 15 8 7 0 soen sien remark n = 0, 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 901 figure 18-4. transfer data length: 8 bits (cen ctl2.cendls3 to cenctl2.cendls0 bits = 1000), transfer direction: msb first (cenctl0.cendir bit = 0) (2/2) (iii) reading from cenrx0 register (in single mode (cenc tl0.centms bit = 0)) cenrx0 (read value) undefined value data sion 15 8 7 0 soen sien (iv) reading from cenrx0 register (in c ontinuous mode (cenctl0.centms bit = 1)) cenrx0 (read value) csibufn undefined value data sion 15 8 7 0 soen sien remark n = 0, 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 902 (b) lsb first (cendir bit = 1) figure 18-5. transfer data length: 8 bits (cen ctl2.cendls3 to cenctl2.cendls0 bits = 1000), transfer direction: lsb first (cenctl0.cendir bit = 1) (1/2) (i) transfer direction: lsb first di0 di1 di2 di3 di4 di5 di6 di7 do0 do1 do2 do3 do4 do5 do6 do7 scken (i/o) sien (input) soen (output) (ii) writing from centx0 register to csibufn register centx0 csibufn data 00h sion 15 8 7 0 soen sien remark n = 0, 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 903 figure 18-5. transfer data length: 8 bits (cen ctl2.cendls3 to cenctl2.cendls0 bits = 1000), transfer direction: lsb first (cenctl0.cendir bit = 1) (2/2) (iii) reading from cenrx0 register (i n single mode (cenc tl0.centms bit = 0)) cenrx0 (read value) 00h data sion 15 8 7 0 soen sien (iv) reading from cenrx0 register (in continuous mode (cen ctl0.centms bit = 1)) cenrx0 (read value) csibufn 00h data sion 15 8 7 0 soen sien remark n = 0, 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 904 (4) transfer data le ngth changing function the transfer data length can be set from 8 to 16 bits in 1-bit units, by using the cenctl2.cendls3 to cenctl2.cendls0 bits (n = 1, 0). figure 18-6. transfer data length: 16 bits (cen ctl2.cendls3 to cenctl2 .cendls0 bits = 0000), transfer direction: msb first (cenctl0.cendir bit = 0) di15 di14 di13 di12 di2 di1 di0 do15 do14 do13 do12 do2 do1 do0 scken (i/o) sien (input) soen (output) remark n = 0, 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 905 (5) function to select serial clock and data phase the serial clock and data phase can be changed by usin g the cenctl1.cenckp, cenctl1.cendap bits (n = 0, 1). figure 18-7. clock timing (a) when cenckp bit = 0, cendap bit = 0 intcent interrupt sien capture scken son d7 d6 d5 d4 d3 d2 d1 d0 (b) when cenckp bit = 0, cendap bit = 1 intcent interrupt sien capture scken soen d7 d6 d5 d4 d3 d2 d1 d0 (c) when cenckp bit = 1, cendap bit = 0 intcent interrupt sien capture scken soen d7 d6 d5 d4 d3 d2 d1 d0 (d) when cenckp bit = 1, cendap bit = 1 intcent interrupt sien capture scken soen d7 d6 d5 d4 d3 d2 d1 d0 remark n = 0, 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 906 (6) master mode the master mode is set and data is transferred with th e serial clock output to the cenctl1.cencks2 to cenctl1.cencks0 bits are set to a value other than 111 (scken pin input is invalid) (n = 0, 1). the default output level of the scken pin is high when the cenctl1.cenckp bit is 0, and low when the cenckp bit is 1. figure 18-8. master mode (cenctl1.c enckp and cenctl1.cendap bits = 00, cenctl2.cendls3 to cenctl2.c endls0 bits = 1000 (transfe r data length: 8 bits)) di7 di6 di5 di4 di3 di2 di1 di0 do7 do6 do5 do4 do3 do2 do1 do0 scken (output) sien (input) soen (output) remark n = 0, 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 907 (7) slave mode the slave mode is set when the cenctl1.cencks2 to cenctl1.cencks0 bits are set to 111, and data is transferred with the serial clock input to the scken pin (in the slave mode, set the cenctl1.cenmdl2 to cenctl1.cenmdl0 bits to 000) (n = 0, 1). figure 18-9. slave mode (cenctl1.cen ckp and cenctl1.cendap bits = 00, cenctl2.cendls3 to cenctl2.c endls0 bits = 1000 (transfe r data length: 8 bits)) di7 di6 di5 di4 di3 di2 di1 di0 do7 do6 do5 do4 do3 do2 do1 do0 scken (input) sien (input) soen (output) remark n = 0, 1 (8) transfer clock selection function in the master mode (cenctl1.cencks2 to cenct l1.cencks0 bits = other than 111 in the cenctl1 register), the bit transfer rate can be selected by setting the cenctl1.cencks2 to cenctl1.cencks0, cenmdl2 to cenmdl0 bits (see 18.4 (2) csien control register 1 (cenctl1) ).
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 908 (9) single mode the single mode is set when the cenctl0.centms bit is 0 (n = 0, 1). in this mode, transfer is started when the centxe bit or cenrxe bit is set to 1 and when data is in the csibufn register (censtr.cenemf bit = 0). if no data is in the csibufn register (cenemf bit = 1), transfer is kept waiting unt il transmit data or dummy data is written to the centx0 register. when data is written to the centx0 register while transmission or reception is enabled (centxe or cenrxe bit is 1), the censtr.centsf bit (transfer status flag) is set to 1. if transfer is not in the wait status, the transfer data indicated by the sion load csibufn pointer is loaded from the censtr.centsf bit, and transfer processing is started. if the read operation (cenrx0 register read) of the pr eviously received data has been completed before one data has been transferred in the reception mode or tr ansmission/reception mode, t he received data is stored from the sion register to the cenrx0 register, the transmission/reception completion interrupt (intcent) is output, and the sion load csibufn pointer is incremented. if the read opera tion of the previously received data has not been completed, the wait status is set and storing the receive data in the cenrx0 register, outputting the intcent interrupt, and incrementing the sion load csibufn pointer are held pending, until all previously received data is read output from the cenrx0 register. in the transmission mode, the intcent interrupt is ou tput and the sion load po inter is incremented when transfer processing of one data has been completed (the cenrx0 register is always in the read complete status because no data is stor ed from the sion register to the cenrx0 register). in all modes (transmission, reception, and transmission/ reception modes), if the csibufn register is empty (write csibufn pointer value = sion load csibufn point er value) when transfer processing of one data has been completed, the centsf bit is cl eared to 0. the value of the ?number of remaining data in the csibufn register (write csibufn pointer ? sion load point er)? can always be read from the censtr.censfp3 to censtr.censfp0 bits. caution be sure to confirm that the censtr.cenflf register is 0 when wr iting data to the centx0 register. even if data is wri tten to this register when cenflf bit is 1, the csibufn overflow interrupt (intcentiof) is output, and the written data is ignored.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 909 figure 18-10. single mode sion cenrx0 soen sien csi data buffer register n (csibufn) 15 15 0 0 transfer data 0 transfer data 1 transfer data 2 transfer data 3 transfer data 4 censfp3 to censfp0 70 3 4 incremented sion load csibufn pointer incremented write csibufn pointer centx0h centx0l 15 8 7 0 difference csien transmission data buffer register (centx0) csien status register (censtr) remark n = 0, 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 910 the transfer start conditions in single mode are shown be low. csien starts data transfer when these conditions are satisfied. table 18-7. transfer start conditions in single mode transfer mode centxe bit cenrxe bit csibufn register cenrx0 register, sion register scken pin transmission mode 1 0 untransferred data is present (cenemf bit = 0) ? reception mode 0 1 untransferred dummy data is present (cenemf bit = 0) master mode transmission/ reception mode 1 1 untransferred data is present (cenemf bit = 0) received data has been transferred from sion register to cenrx0 register ? transmission mode 1 0 untransferred data is present (cenemf bit = 0) ? reception mode 0 1 untransferred dummy data is present (cenemf bit = 0) slave mode transmission/ reception mode 1 1 untransferred data is present (cenemf bit = 0) received data has been transferred from sion register to cenrx0 register input remarks 1. centxe bit: bit 6 of cenctl0 register cenrxe bit: bit 5 of cenctl0 register cenemf bit: bit 5 of censtr register 2. n = 0 or 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 911 (10) continuous mode the continuous mode is set when the ce nctl0.centms bit is 1 (n = 0, 1). in this mode, transfer is started when the centxe bi t or cenrxe bit is 1 and when data is in the csibufn register (censtr.cenemf register). at this time, set the number of transfer data in advance by using the cenctl3.censfn3 to cenctl3.censfn0 bits. if data exceeding the number of transfer data specified by the cenctl3.censfn3 to cenctl3.ce nsfn0 bits are written to the cs ibufn register, the excess data are ignored and not transferred. if no data is in the csibufn register (cenemf bit = 1) , transfer is kept waiting until transmit data or dummy data is written to the centx0 register. if data is written to the centx0 register when transmission or reception is enabled (centxe or cenrxe bit is 1), the censtr.centsf bit (transfer status flag) is set to 1 and the transfer data indicated by the sion load/store csibufn pointer is loaded from the csibufn register to sion register. then transfer processing is started. when transfer processing of one data is completed in the reception mode or trans mission/reception mode, the received data is overwritten from the sion register to the transfer dat a in the csibufn register indicated by the sion load/store csibufn pointer , and then the pointer is increment ed. by consecutively reading the transfer data from the cenrx0 register after all data in the csibufn register have been transferred (when the intcent interrupt has occurred), the receive dat a can be sequentially read while the read csibufn pointer is incremented. if read operation is executed for the data number exceeding the received data count from the cenrx0 register, howeve r, the read value is undefined. in the transmission mode, the sion load/store csibufn pointer is incremented when transfer processing of one data has been completed. in all modes (transmission, reception, and transmissi on/reception modes), when data has been transferred by the value set by the cenctl3.censfn3 to cenctl3.cens fn0 bits, the centsf bit is cleared to 0 and the transmission/reception completion in terrupt (intcent) is output. to transfer the next data, be sure to write 1 to the censtr.cenpct bit and clear all the csibufn pointers to 0. the ?number of transferred data (sion load/store csib ufn pointer value)? can always be read from the censtr.censfp3 to ce nstr.censfp0 bits. caution the censtr register is in the same status when transfer data is written (before start of transfer) after the csibufn pointer is cleared (censtr.cenpct bit = 1) and when 16 data have been transferred (censtr.censtr.c enflf bit = 0, censtr.cenemf bit = 1, censtr.censfp3 to cens tr.censfp0 bits = 0000).
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 912 figure 18-11. continuous mode transfer data 0 cenrx0 soen sien csi data buffer register n (csibufn) 15 15 0 0 transfer data 1 transfer data 2 transfer data 3 censpf3 to censpf0 70 3 4 csien status register (censtr) incremented read csibufn pointer incremented sion load/store csibufn pointer incremented write csibufn pointer centx0h centx0l 15 8 7 0 sion note 1 note 2 note 1 csien transmission data buffer register (centx0) notes 1. reception 2. transmission remark n = 0, 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 913 the transfer start conditions in continuous mode are shown below. csien starts data transfer when these conditions are satisfied. table 18-8. transfer start conditions in continuous mode transfer mode centxe bit cenrxe bit csibufn register cenrx0 register, sion register scken pin transmission mode 1 0 untransferred data is present (cenemf bit = 0) reception mode 0 1 untransferred dummy data is present (cenemf bit = 0) note master mode transmission/ reception mode 1 1 untransferred data is present (cenemf bit = 0) ? transmission mode 1 0 untransferred data is present (cenemf bit = 0) reception mode 0 1 untransferred dummy data is present (cenemf bit = 0) note slave mode transmission/ reception mode 1 1 untransferred data is present (cenemf bit = 0) ? input note the same amount of dummy data as t he data to be received is required. remarks 1. centxe bit: bit 6 of cenctl0 register cenrxe bit: bit 5 of cenctl0 register cenemf bit: bit 5 of censtr register 2. n = 0 or 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 914 (11) transmission mode the transmission mode is set when the ce nctl0.centxe bit is set to 1 and the cenrxe bit is cleared to 0. in this mode, transmission is started by a trigger that wr ites transmit data to the centx0 register or sets the centxe bit to 1 when transmit data is in the csibufn regi ster (n = 0, 1). the value input to the sien pin during transmission is latched in the shift register (s ion) but is not transferred to the cenrx0 and csibufn registers at the end of transmission. the transmission/reception completion inte rrupt (intcent) occurs immediately after data is sent out from the sion register. (12) reception mode the reception mode is set when t he cenctl0.centxe bit is cleared to 0 and the cenctl0.cenrxe bit is set to 1. in this mode, reception is started by using the processing of writing dummy data to the centx0 register as a trigger (n = 0, 1). in the single m ode (cenctl0.centms bit = 1), however, the condition of starting reception includes that the receive data has been transferred from the sion register to the cenrx0 register. (if reception to the sion register is completed when the previous receive data is held in the cenrx0 register without being read, the receiv e data stored in the sion register is transferred to the cenrx0 register by reading the cenrx0 register.) in the continuous mode, reception starts by writing dummy data of the number of receive data to the centx0 register with t he first dummy data write processing taken as a trigger. the soen pin outputs a low level. the transmission/reception completion interrupt (int cent) occurs immediately after receive data is transferred from the sion register to the cenrx0 register. (13) transmission/reception mode the transmission/reception mode is set when both t he cenctl0.centxe bit = 1 and the cenctl0.cenrxe bit = 1. in this mode, transmission/reception is start ed by using the processing to write transmit data to the centx0 register as a trigger (n = 0, 1). in t he single mode (cenctl0.centms bit = 0), however, the condition of starting transmission/reception includes that the receive data has been transferred from the sion register to the cenrx0 register. (if reception to the sion register is completed when the previously received data is held in the cenrx0 register without being read, the receive data stored in the sion register is transferred to the cenrx0 register by reading the cenrx0 register.)
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 915 (14) delay control of transmission/r eception completion interrupt (intcent) in the master mode (cenctl1.cencks2 to cenctl1.ce ncks0 bits = other than 111), occurrence of the transmission/reception completion interrupt (intcent) c an be delayed by half a clock (1/2 serial clock), depending on the setting (1) of the cenctl0.centms bit. the censit bit is valid only in the master mode. in the slave mode (cenctl1.cencks2 to cenctl1.ce ncks0 bits = 111), setting the censit bit to 1 is prohibited (even if set, the intcent interrupt is not affected). caution if the cenctl0.censit bit is set to 1 in the continuous mode (cenctl0.centms bit = 1), the intcent interrupt is not output at the end of data other than the last data set by the cenctl3.censfn3 to cenctl3.censf n0 bits, but a delay of half a clock (1/2 serial clock) can be inserted between each data transfer. figure 18-12. delay control of transmissi on/reception completion interrupt (intcent): cenctl0.censit bit = 1, cenckp, cendap bits = 00, cenctl2.cendls3 to cenctl2 .cendls0 bits = 1000 (transfer data length: 8 bits) di7 di7 di6 di5 di4 di3 di2 di1 di0 delay do7 do6 do5 do4 do3 do2 do1 do0 do7 scken (output) sien (input) soen (output) intcent interrupt delay note note if the cenctl0.centms bit is set to 1 in the continuous mode (cenctl0.centms bits = 1), the intcent interrupt is not output at the end of data other than the last data set by the cenctl3.censfn3 to cenctl3.censfn0 bits, but a de lay of half a clock (1/2 serial clock) can be inserted between each data transfer. remark n = 0, 1
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 916 (15) output pins (a) scken pin the scken pin output status when the csien does not perform transmission/reception. table 18-9. scken pin output level in non-communication state cenpwr bit cenpct bit cenckp bit centxe, cenrxe bits cencks2 to cencks0 bits scken pin output level 111 (slave mode) high im pedance 0 ? ? ? other than 111 (master mode) high level 111 (slave mode) high im pedance 0 other than 111 (master mode) high level 111 (slave mode) high im pedance 0 1 after setting 1 ? other than 111 (master mode) low level 111 (slave mode) high im pedance changes to 00b note 1 other than 111 (master mode) high level 111 (slave mode) high im pedance 0 other than above other than 111 (master mode) note 3 111 (slave mode) high im pedance changes from 00b note 2 other than 111 (master mode) low level 111 (slave mode) high im pedance 1 ? 1 other than above other than 111 (master mode) note 3 notes 1. when the values set to the centxe and cenrxe bits change from 01 to 00, 10 to 00, or 11 to 00. 2. when the values set to the centxe and cenrxe bits change from 00 to 01, 00 to 10, or 00 to 11. 3. the previous scken pin output level is retai ned (the scken pin output level does not change). remark n = 0, 1 caution if the cenckp bit is set to 1 in the master mode (cencks2 to cencks0 bits are other than 111), the scken pin outputs a low level when it is inactiv e. if the cenctl0.centxe bit is cleared to 0 (disabling transmission) and cenrxe bit is clear ed to 0 (disabling reception), the scken pin outputs a high level. therefore, take the following measures to fix the scken pin to low level when csien is not used. [scke0 pin (scke1 pin)] <1> clearing the p6.p62 bit to 0 (clearing the p6.p65 bit to 0): the port output level is set to low. <2> clearing the pm6.pm62 bit to 0 (cl earing the pm6.pm65 bit register to 0): the port is set in the output mode. <3> clearing the pmc6.pmc62 to 0 (clearing the pmc6.pmc65 bit to 0): the pin is set in the port mode (fixed to low-level output). <4> clearing the ce0ctl0.ce0t xe and ce0ctl0.ce0rxe bits to 0 (clearing the ce1ctl0.ce1txe and ce1ctl0.ce1rx e bits to 0): transmission and reception are disabled. <5> setting the ce0str.ce0pct bit to 1 (setting the ce1str.ce1pct bit to 1): clearing all pointers for csibuf0 (csibuf1).
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 917 <6> setting the ce0ctl0.ce0t xe or ce0ctl0.ce0rxe bit to 1 (setting the ce1ctl0.ce1txe or ce1ctl0.ce1rxe bit to 1): transmission or reception is enabled (both transmission/reception can also be enabled). <7> setting the pmc6.pmc62 bit to 1 (setting the pmc6.pmc65 bit to 1): the pin is set as the alternate function (scke0 and scke1 pin outputs). because the register set values <1> and <2> are retained, control can be performed only by <3> to <7> once they have been set. (b) soen pin the soen pin output status when the csien does not perform transmission/reception. table 18-10. soen pin output level in non-communication state cenpwr bit cenpct bit cendap bit centxe bit cenc ks2 to cencks0 bits soen pin output level 0 ? ? ? ? low level 111 (slave mode) note 0 other than 111 (master mode) low level 0 1 after setting 1 ? ? low level 1 0 low level 1 ? ? 0 1 ? note note the previous soen pin output level is retained (the soen pin output level does not change). remark n = 0, 1 (16) csibufn overflow interrupt signal (intcentiof) in the single mode and continuous mode, the intcent iof interrupt is output when 16 untransmitted data exist in the csibufn register and wh en the 17th data is written (to the centx0 or centx0l register) (the 17th transfer data is not written but ignored). in the single mode (cenctl0.centms bit = 0), 16 untr ansmitted data exist in t he csibufn register when ?write csibufn pointer value = sion load csibufn pointer value and censtr.cenflf bit = 1?. when transfer is completed and the sion load csibufn pointe r is incremented, the csib ufn register can write one transmission data. writing the next transmission data to the csibufn register is not availa ble even when transfer of one data has been completed in the continuous mode (cenctl0.centms bit = 1).
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 918 18.7 how to use (1) single mode (in master mode and transmission mode) <1> when the cenctl0.cenpwr register is set to 1, supplying the operating clock is enabled. <2> specify the transfer mode by setti ng the cenctl1 and cenctl2 registers. <3> write 1 to the censtr.cenpct bit to clear all the csibufn pointers to 0. <4> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <5> specify the transfer mode by using the cenc tl0.centms, cenctl0.cend ir, and cenctl0.censit bits and, at the same time, enable trans mission by setting the centxe bit to 1. <6> confirm that the censtr.cenflf register is 0, and t hen write transfer data to the centx0 register. if it is clearly known that the cenflf bit is 0 because transfer data is written to that bit by the interrupt servicing routine of intcent, it is not always nec essary to confirm that the cenflf bit is 0. <7> confirm that the intcent interrupt has occu rred and the censtr.cenemf bit is 1, and disable transmission by clearing the cenctl0.centxe bit to 0 (end of transmission). caution to execute further transfer, repeat <6> before <7>. (2) single mode (in master mode and reception mode) <1> when the cenctl0.cenpwr register is set to 1, supplying the operating clock is enabled. <2> specify the transfer mode by setti ng the cenctl1 and cenctl2 registers. <3> write 1 to the censtr.cenpct bit to clear all the csibufn pointers to 0. <4> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <5> specify the transfer mode by using the cenc tl0.centms, cenctl0.cend ir, and cenctl0.censit bits and, at the same time, enable reception by setting the cenrxe bit to 1. <6> confirm that the censtr.cenflf register is 0, and then write dummy trans fer data to the centx0 register (reception start trigger). if it is clearly kn own that the cenflf bit is 0 because dummy transfer data is written to that bit by the interrupt servici ng routine of intcent, it is not always necessary to confirm that the cenflf bit is 0. <7> confirm that the intcent interrupt has oc curred, and then read the cenrx0 register. <8> confirm that the intcent interrupt has occurred and the cenemf bit is 1, and disable reception by clearing the cenctl0.cenrxe bit to 0 (end of reception). cautions 1. to execute further tr ansfer, repeat <6> and <7> before <8>. 2. the soen pin outputs a low level but this is invalid.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 919 (3) single mode (in master mode and transmission/reception mode) <1> when the cenctl0.cenpwr register is set to 1, supplying the operating clock is enabled. <2> specify the transfer mode by setti ng the cenctl1 and cenctl2 registers. <3> write 1 to the censtr.cenpct bit to clear all the csibufn pointers to 0. <4> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <5> specify the transfer mode by using the cenc tl0.centms, cenctl0.cend ir, and cenctl0.censit bits and, at the same time, enable transmission/re ception by setting the centxe and cenrxe bits to 1. <6> confirm that the censtr.cenflf register is 0, and t hen write transfer data to the centx0 register. if it is clearly known that the cenflf bit is 0 because transfer data is written to that bit by the interrupt servicing routine of intcent, it is not always nec essary to confirm that the cenflf bit is 0. <7> confirm that the intcent interrupt has oc curred, and then read the cenrx0 register. <8> confirm that the intcent interrupt has occurred and the cenemf bit is 1, and disable transmission/reception by clearing the cenctl0.ce ntxe bit = 0 and cenctl0.cenrxe bit = 0 register to 0 (end of transmission/reception). caution to execute further transfer , repeat <6> and <7> before <8>. (4) single mode (in slave m ode and transmission mode) <1> when the cenctl0.cenpwr register is set to 1, supplying the operating clock is enabled. <2> specify the transfer mode by setti ng the cenctl1 and cenctl2 registers. <3> write 1 to the censtr.cenpct bit to clear all the csibufn pointers to 0. <4> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <5> specify the transfer mode by using the cenc tl0.centms, cenctl0.cend ir, and cenctl0.censit bits and, at the same time, enable trans mission by setting the centxe bit to 1. <6> confirm that the censtr.cenflf register is 0, and t hen write transfer data to the centx0 register. if it is clearly known that the cenflf bit is 0 because transfer data is written to that bit by the interrupt servicing routine of intcent, it is not always nec essary to confirm that the cenflf bit is 0. <7> confirm that the intcent interrupt has occurred and the cenemf bit is 1, and disable transmission by clearing the cenctl0.centxe bit to 0 (end of transmission). caution to execute further transfer, repeat <6> before <7>.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 920 (5) single mode (in slave mode and reception mode) <1> when the cenctl0.cenpwr register is set to 1, supplying the operating clock is enabled. <2> specify the transfer mode by setti ng the cenctl1 and cenctl2 registers. <3> write 1 to the censtr.cenpct bit to clear all the csibufn pointers to 0. <4> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <5> specify the transfer mode by using the cenc tl0.centms, cenctl0.cend ir, and cenctl0.censit bits and, at the same time, enable reception by setting the cenrxe bit to 1. <6> confirm that the censtr.cenflf register is 0, and then write dummy trans fer data to the centx0 register (reception start trigger). if it is clearly kn own that the cenflf bit is 0 because dummy transfer data is written to that bit by the interrupt servici ng routine of intcent, it is not always necessary to confirm that the cenflf bit is 0. <7> confirm that the intcent interrupt has oc curred, and then read the cenrx0 register. <8> confirm that the intcent interrupt has occurred and the cenemf bit is 1, and disable reception by clearing the cenctl0.cenrxe bit to 0 (end of reception). cautions 1. to execute further tr ansfer, repeat <6> and <7> before <8>. 2. the soen pin outputs a low level but this is invalid. (6) single mode (in slave mode and transmission/reception mode) <1> when the cenctl0.cenpwr register is set to 1, supplying the operating clock is enabled. <2> specify the transfer mode by setti ng the cenctl1 and cenctl2 registers. <3> write 1 to the censtr.cenpct bit to clear all the csibufn pointers to 0. <4> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <5> specify the transfer mode by using the cenc tl0.centms, cenctl0.cend ir, and cenctl0.censit bits and, at the same time, enable transmission/re ception by setting the centxe and cenrxe bits to 1. <6> confirm that the censtr.cenflf register is 0, and t hen write transfer data to the centx0 register. if it is clearly known that the cenflf bit is 0 because transfer data is written to that bit by the interrupt servicing routine of intcent, it is not always nec essary to confirm that the cenflf bit is 0. <7> confirm that the intcent interrupt has oc curred, and then read the cenrx0 register. <8> confirm that the intcent interrupt has occurred and the cenemf bit is 1, and disable transmission/reception by clearing the cenctl0.ce ntxe bit = 0 and cenctl0.cenrxe bit = 0 register to 0 (end of transmission/reception). caution to execute further transfer , repeat <6> and <7> before <8>.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 921 (7) continuous mode (in master mode and transmission mode) <1> when the cenctl0.cenpwr register is set to 1, supplying the operating clock is enabled. <2> specify the transfer mode by setti ng the cenctl1 and cenctl2 registers. <3> write 1 to the censtr.cenpct bit to clear all the csibufn pointers to 0. <4> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <5> specify the transfer mode by using the cenc tl0.centms, cenctl0.cend ir, and cenctl0.censit bits and, at the same time, enable trans mission by setting the centxe bit to 1. <6> set the amount of data to be transmitted by us ing the cenctl3.censfn3 to cenctl3.censfn0 bits. <7> write the amount of data to be transmitted to the centx0 register as transfer data. writing data exceeding the set value of the ce nctl3 register is prohibited. <8> confirm that the intcent interrupt has occurred and the cenemf bit is 1. then write 1 to the censtr.cenpct bit, and clear all the csibufn pointers to 0 in preparation for the next transfer. <9> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <10> disable transmission by clearing the cenc tl0.centxe bit to 0 (end of transmission). caution to execute further transfer , repeat <6> to <9> before <10>. (8) continuous mode (in mast er mode and reception mode) <1> when the cenctl0.cenpwr register is set to 1, supplying the operating clock is enabled. <2> specify the transfer mode by setti ng the cenctl1 and cenctl2 registers. <3> write 1 to the censtr.cenpct bit to clear all the csibufn pointers to 0. <4> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <5> specify the transfer mode by using the cenc tl0.centms, cenctl0.cend ir, and cenctl0.censit bits and, at the same time, enable reception by setting the cenrxe bit to 1. <6> set the amount of data to be received by usi ng the cenctl3.censfn3 to cenctl3.censfn0 bits. <7> write dummy transfer data of the number of rece ive data to the centx0 register. the first dummy transfer data write is the trigger to start reception. writing dummy data exc eeding the set value of the cenctl3 register is prohibited. <8> confirm that the intcent interrupt has occurred an d the cenemf bit is 1. then read the receive data from the cenrx0 register (sequentially read t he receive data stored in the csibufn register). <9> write 1 to the censtr.cenpct bit, and clear all the csibufn pointers to 0 in preparation for the next transfer. <10> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <11> disable reception by clearing the ce nctl0.cenrxe bit to 0 (end of reception). cautions 1. to execute further tran sfer, repeat <6> to <10> before <11>. 2. the soen pin outputs a low level.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 922 (9) continuous mode (in master m ode and transmission/reception mode) <1> when the cenctl0.cenpwr register is set to 1, supplying the operating clock is enabled. <2> specify the transfer mode by se tting the cenctl1 and cenctl2 registers. <3> write 1 to the censtr.cenpct bit to clear all the csibufn pointers to 0. <4> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <5> specify the transfer mode by using the cenc tl0.centms, cenctl0.cend ir, and cenctl0.censit bits and, at the same time, enable transmission/ reception by setting both the centxe and cenrxe bits to 1. <6> set the amount of data to be transmitt ed/received by using the cenctl3.censfn3 to cenctl3.censfn0 bits. <7> write the amount of data to be transmitted to the centx0 register as transfer data. writing data exceeding the set value of the ce nctl3 register is prohibited. <8> confirm that the intcent interrupt has occurred an d the cenemf bit is 1. then read the receive data from the cenrx0 register (sequentially read t he receive data stored in the csibufn register). <9> write 1 to the censtr.cenpct bit, and clear all the csibufn pointers to 0 in preparation for the next transfer. <10> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <11> disable transmission/reception by clearing the cenctl0.centxe bit = 0 and cenctl0.cenrxe bit = 0 register to 0 (end of transmission/reception). caution to execute further transfer, repeat <6> to <10> before <11>. (10) continuous mode (in sla ve mode and transmission mode) <1> when the cenctl0.cenpwr register is set to 1, supplying the operating clock is enabled. <2> specify the transfer mode by se tting the cenctl1 and cenctl2 registers. <3> write 1 to the censtr.cenpct bit to clear all the csibufn pointers to 0. <4> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <5> specify the transfer mode by using the cenc tl0.centms, cenctl0.cend ir, and cenctl0.censit bits and, at the same time, enable trans mission by setting the centxe bit to 1. <6> set the amount of data to be transmitted by us ing the cenctl3.censfn3 to cenctl3.censfn0 bits. <7> write the amount of data to be transmitted to t he centx0 register as transfer data. writing data exceeding the set value of the ce nctl3 register is prohibited. <8> confirm that the intcent interrupt has occurr ed and the cenemf bit is 1. then write 1 to the censtr.cenpct bit, and clear all the csibufn pointers to 0 in preparation for the next transfer. <9> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <10> disable transmission by clearing the cenc tl0.centxe bit to 0 (end of transmission). caution to execute further transfer , repeat <6> to <9> before <10>.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 923 (11) continuous mode (in sl ave mode and reception mode) <1> when the cenctl0.cenpwr register is set to 1, supplying the operating clock is enabled. <2> specify the transfer mode by se tting the cenctl1 and cenctl2 registers. <3> write 1 to the censtr.cenpct bit to clear all the csibufn pointers to 0. <4> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <5> specify the transfer mode by using the cenc tl0.centms, cenctl0.cend ir, and cenctl0.censit bits and, at the same time, enable reception by setting the cenrxe bit to 1. <6> set the amount of data to be received by us ing the cenctl3.censfn3 to cenctl3.censfn0 bits. <7> write dummy transfer data of t he number of receive data to the ce ntx0 register. the first dummy transfer data write is the trigger to start reception. writing dummy data exc eeding the set value of the cenctl3 register is prohibited. <8> confirm that the intcent interrupt has occurred an d the cenemf bit is 1. then read the receive data from the cenrx0 register (sequentially read t he receive data stored in the csibufn register). <9> write 1 to the censtr.cenpct bit, and clear all the csibufn pointers to 0 in preparation for the next transfer. <10> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <11> disable reception by clearing the ce nctl0.cenrxe bit to 0 (end of reception). cautions 1. to execute further tran sfer, repeat <6> to <10> before <11>. 2. the soen pin outputs a low level.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 924 (12) continuous mode (in slave m ode and transmissi on/reception mode) <1> when the cenctl0.cenpwr register is set to 1, supplying the operating clock is enabled. <2> specify the transfer mode by se tting the cenctl1 and cenctl2 registers. <3> write 1 to the censtr.cenpct bit to clear all the csibufn pointers to 0. <4> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <5> specify the transfer mode by using the cenc tl0.centms, cenctl0.cend ir, and cenctl0.censit bits and, at the same time, enable transmission/ reception by setting both the centxe and cenrxe bits to 1. <6> set the number of data to be transmitt ed/received by using the cenctl3.censfn3 to cenctl3.censfn0 bits. <7> write the amount of data to be transmitted to t he centx0 register as transfer data. writing data exceeding the set value of the ce nctl3 register is prohibited. <8> confirm that the intcent interrupt has occurred an d the cenemf bit is 1. then read the receive data from the cenrx0 register (sequentially read t he receive data stored in the csibufn register). <9> write 1 to the censtr.cenpct bit, and clear all the csibufn pointers to 0 in preparation for the next transfer. <10> confirm that the censtr.cenflf bit = 0, censtr.cenemf bit = 1, and censtr.censfp3 to censfp0 bits = 0000. <11> disable transmission/reception by clearing the cenctl0.centxe bit = 0 and cenctl0.cenrxe bit = 0 register to 0 (end of transmission/reception). caution to execute further transfer, repeat <6> to <10> before <11>.
chapter 18 3-wire variable-length serial i/o e (csie) user?s manual u19201ej3v0ud 925 18.8 cautions cautions concerning csien are shown below (n = 0, 1). (1) stopping csien the csien unit is reset and csien is stopped when the cenctl0.cenpwr bit is cleared to 0. to operate csien, first set the cenpwr bit to 1. usually, before clearing the cenpwr bit to 0, clear both the centxe and cenrxe bits to 0 (after the end of transfer). (2) enabling transfer be sure to write 1 to the censtr.cenpct bit to clear all the csibufn pointers to 0 before enabling transfer by setting the cenctl0.cenpwr bits to 1. if the centxe or cenrxe bit is set to 1 without clearing the pointers, and if the previously transferred data remains in the csibufn register, transferring that data is immediately started. if transfer data is set to the csibufn register before tran sfer is enabled, transfer is started as soon as the centxe or cenrxe bit is set to 1. (3) caution on cenctl0 register setting be sure to set the port pins related to the csien func tion to the alternate-function mode before using csien. then set the cenpwr bit to 1 before setting the other bits. (4) writing data to centx0 register in single mode be sure to confirm that the censtr.cenflf register is 0 when writing data to the centx0 register. even if data is written to this register when the cenflf bit is 1, the csibufn overflow interrupt (intcentiof) is issued, and the written data is ignored. (5) censtr register stat us in continuous mode the censtr register is in the same status when transfer data is written (before start of transfer) after the csibufn pointer is cleared (censtr.cenpct bit = 1) and when 16 data have been transferred (censtr.cenflf bit = 0, censtr.cenemf bit = 1, censtr.censfp3 to cens tr.censfp0 bits = 0000). (6) switching dma transfer start factor in the v850e/sj3-h and v850e/sk3-h, dma transfer start factor signals intce0t and interr are shared and cannot be used at the same time. this is also t he case for dma transfer start factor signals intce1t and intsta. when using the intce0t or intce1t signal as the dma transfer start factor, set the dtfrob0 bit to 1 using the option byte 0000007ah (refer to chapter 33 option byte function for details). in this case, the interr and intsta signals cannot be used as dma transfer start factors. remark for details, see table 22-1 dma transfer start factors .
user?s manual u19201ej3v0ud 926 chapter 19 i 2 c bus to use the i 2 c bus function, use the p38/ sda00, p39/scl00, p40/sda 01, p41/scl01, p90/sda02, p91/scl02, p614/sda03, p615/scl03, p00/sda04 note , p20/sda04 (v850e/sk3-h only), p01/scl04 note , p21/scl04 (v850e/sk3-h only), p67/sda05 note , p82/sda05 (v850e/sk3-h only), p68/scl05 note , and p83/scl05 (v850e/sk3-h only) pins as alternate functions and set them to n-ch open-drain output. note not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h). the v850e/sj3-h and v850e/sk3-h have an i 2 c bus. the number of channels differs depending on the product in the v850e/sj3-h and v850e/sk3-h as shown in the table below. table 19-1. number of channels available for i 2 c bus v850e/sj3-h product only pd70f3931, 70f3932, 70f3933 other than pd70f3931, 70f3932, 70f3933 v850e/sk3-h channel 4 channels (i 2 c00 to i 2 c03) 6 channels (i 2 c00 to i 2 c05)
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 927 19.1 port settings of i 2 c00 to i 2 c05 19.1.1 for v850e/sj3-h table 19-2. pin configuration alternate-function pin port <1> port <2> mode pin name pin no. port alternate function pin no. port alternate function sda00 35 p38 txda2/sib2 ? ? ? i 2 c00 scl00 36 p39 rxda2/sckb2 ? ? ? sda01 22 p40 sib0 ? ? ? i 2 c01 scl01 23 p41 sob0 ? ? ? sda02 61 p90 a0/kr6/txda1 ? ? ? i 2 c02 scl02 62 p91 a1/kr7/rxda1/kr7 ? ? ? sda03 57 p614 tecr8 ? ? ? i 2 c03 scl03 58 p615 ? ? ? ? sda04 note 6 p00 tip61/top61 ? ? ? i 2 c04 note scl04 note 7 p01 tip60/top60 ? ? ? sda05 note 50 p67 sob5/rxda5 ? ? ? i 2 c05 note scl05 note 51 p68 sckb5/txda5 ? ? ? note not available in the pd70f3931, 70f3932, and 70f3933 (1) i 2 c00 the serial transmission/reception data and se rial clock pins (sda00 and scl00) of i 2 c00 are assigned to p38 and p39, respectively. when using i 2 c00, specify p38 and p39 as the sda00 and scl00 pins in advance, using the pmc3, pfc3, and pfce3 registers. the sda00 and scl00 pins and txda2 and rxda2 (transmission/reception pi ns) of uarta2 are alternate functions of the same pin, and therefore cannot be used simultaneously. in addition, the sda00 and scl00 pins and sib2 and sckb2 (serial reception data and serial clock pins) of csib2 are al ternate functions of the same pin, so use the sib2 and sckb2 pins assigned to other port pins (p53 and p 55) when using the pins simultaneously.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 928 (2) i 2 c01 the serial transmission/reception data and se rial clock pins (sda01 and scl01) of i 2 c01 are assigned to p40 and p41, respectively. when using i 2 c01, specify p40 and p41 as the sda01 and scl01 pins in advance, using the pmc4 and pfc4 registers. the sda01 and scl01 pins and the trans mission/reception pins (sib0 and sob0) of csib0 are alternate functions of the same pin, and t herefore cannot be used simultaneously. (3) i 2 c02 the serial transmission/reception data and se rial clock pins (sda02 and scl02) of i 2 c02 are assigned to p90 and p91, respectively. when using i 2 c02, specify p90 and p91 as the sda02 and scl02 pins in advance, using the pmc9, pfc9, and pfce9 registers. the sda02 and scl02 pins and the transmission/recept ion pins (txda1 and rxda2) of uarta1 are alternate functions of the same pin, and therefore cannot be used simultaneously. (4) i 2 c03 the serial transmission/reception data and se rial clock pins (sda03 and scl03) of i 2 c03 are assigned to p614 and p615, respectively. when using i 2 c03, specify p614 and p615 as the sda03 and scl03 pins in advance, using the pmc6, pfc6, and pfce6 registers. the sda03 pin and the encoder clear input pin (tecr8) of tmp8 are alternat e functions of the same pin, and therefore cannot be used simultaneously. (5) i 2 c04 (other than pd70f3931, 70f3932, and 70f3933) the serial transmission/reception data and se rial clock pins (sda04 and scl04) of i 2 c04 are assigned to p00 and p01, respectively. when using i 2 c04, specify p00 and p01 as the sda04 and scl04 pins in advance, using the pmc0, pfc0, and pfce0 registers. the sda04 and scl04 pins and i/o pins (t ip61/top60 and tip60/top60) of tm p6 are alternate functions of the same pin, and therefor e cannot be used simultaneously. (6) i 2 c05 (other than pd70f3931, 70f3932, and 70f3933) the serial transmission/reception data and se rial clock pins (sda05 and scl05) of i 2 c05 are assigned to p67 and p68, respectively. when using i 2 c05, specify p67 and p68 as the sda05 and scl05 pins in advance, using the pmc6, pfc6, and pfce6 registers. the sda05 and scl05 pins, the serial transmission data and serial clock pins (sob5 and sckb5) of csib5, and transmission/reception pins (rxda5 and txda5) of ua rta5 are alternate functi ons of the same pin, and therefore cannot be used simultaneously. caution do not switch port settings during operation. also, be sure to disable operation of unused units for which port se ttings are not made.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 929 19.1.2 for v850e/sk3-h table 19-3. pin configuration alternate-function pin port <1> port <2> mode pin name pin no. port alternate function pin no. port alternate function sda00 40 p38 txda2/sib2 ? ? ? i 2 c00 scl00 41 p39 rxda2/sckb2 ? ? ? sda01 24 p40 sib0 ? ? ? i 2 c01 scl01 25 p41 sob0 ? ? ? sda02 77 p90 a0/kr6/txda1 ? ? ? i 2 c02 scl02 78 p91 a1/kr7/rxda1/kr7 ? ? ? sda03 67 p614 tecr8 ? ? ? i 2 c03 scl03 68 p615 ? ? ? ? sda04 6 p00 tip61/top61 8 p20 ? i 2 c04 scl04 7 p01 tip60/top60 9 p21 ? sda05 60 p67 sob5/rxda5 73 p82 ? i 2 c05 scl05 61 p68 sckb5/txda5 74 p83 ? (1) i 2 c00 the serial transmission/reception data and se rial clock pins (sda00 and scl00) of i 2 c00 are assigned to p38 and p39, respectively. when using i 2 c00, specify p38 and p39 as the sda00 and scl00 pins in advance, using the pmc3, pfc3, and pfce3 registers. the sda00 and scl00 pins and the transmission/recept ion pins (txda2 and rxda2) of uarta2 are alternate functions of the same pin. use the txda2 and rxda2 pins assigned to other port pins (p311 and p312) when using the pins simultaneously. in addi tion, the sda00 and scl00 pins and sib2 and sckb2 (serial reception data and serial clock pins) of csib2 are alternate functions of the sa me pin, so use the sib2 and sckb2 pins assigned to other port pins (p 53 and p55) when using the pins simultaneously. (2) i 2 c01 the serial transmission/reception data and se rial clock pins (sda01 and scl01) of i 2 c01 are assigned to p40 and p41, respectively. when using i 2 c01, specify p40 and p41 as the sda01 and scl01 pins in advance, using the pmc4 and pfc4 registers. the sda01 and scl01 pins and sib0 and sob0 (transmission/reception pins) of csib0 are alternate functions of the same pin, and t herefore cannot be used simultaneously. (3) i 2 c02 the serial transmission/reception data and se rial clock pins (sda02 and scl02) of i 2 c02 are assigned to p90 and p91, respectively. when using i 2 c02, specify p90 and p91 as the sda02 and scl02 pins in advance, using the pmc9, pfc9, and pfce9 registers. the sda02 and scl02 pins and the transmission/recept ion pins (txda1 and rxda1) of uarta1 are alternate functions of the same pi n, so use the txda1 and rxda1 pins assigned to other port pins (p151 and p150) when using the pins simultaneously.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 930 (4) i 2 c03 the serial transmission/reception data and se rial clock pins (sda03 and scl03) of i 2 c03 are assigned to p614 and p615, respectively. when using i 2 c03, specify p614 and p615 as the sda03 and scl03 pins in advance, using the pmc6, pfc6, and pfce6 registers. the sda03 pin and the encoder clear input pin (tecr8) of tmp8 are alternat e functions of the same pin, and therefore cannot be used simultaneously. (5) i 2 c04 the serial transmission/reception data and se rial clock pins (sda04 and scl04) of i 2 c04 are assigned to two port pins p00, p01 and p20, p21, re spectively, and can be used at either one of the two port pins only. when using i 2 c04 at p00 and p01, specify p00 and p01 as the sda04 and scl04 pins in advance, using the pmc0, pfc0, and pfce0 registers. when using i 2 c04 at p20 and p21, specify p20 and p21 as the sda04 and scl04 pins in advance, using the pmc2 register. p00 and p01 function as the i/o pins (tip61/top 61 and tip60/top60) of tmp6. by using i 2 c04 at p20 and p21, these alternate functions can be used simultaneously with i 2 c04. (6) i 2 c05 the serial transmission/reception data and se rial clock pins (sda05 and scl05) of i 2 c05 are assigned to two port pins p67, p68 and p82, p83, re spectively, and can be used at either one of the two port pins only. when using i 2 c05 at p67 and p68, specify p67 and p68 as the sda05 and scl05 pins in advance, using the pmc6, pfc6, and pfce6 registers. when using i 2 c05 at p82 and p83, specify p82 and p83 as the sda05 and scl05 pins in advance, using the pmc8 register. p67 and p68 function as the serial transmission data and serial clock pins (sob5 and sckb5) of csib5 and transmission/reception pins (rxda5 and txda5) of uarta5. by using i 2 c05 at p82 and p83, these alternate functions can be used simultaneously with i 2 c05. caution do not switch port settings during operation. also, be sure to disable operation of unused units for which port se ttings are not made.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 931 19.2 features i 2 c0n has the following two modes. ? operation stopped mode ? i 2 c (inter ic) bus mode (multimasters supported) (1) operation stopped mode in this mode, serial transfers are not performed, thus enabling a reduction in power consumption. (2) i 2 c bus mode (multimaster support) this mode is used for 8-bit data transfers with several devices via two lines: a serial clock pin (scl0n) and a serial data bus pin (sda0n). this mode complies with the i 2 c bus format and the master device can generate ?start condition?, ?address?, ?transfer direction specification?, ? data?, and ?stop condition? data to the sl ave device via the serial data bus. the slave device automatically detects the received status es and data by hardware. this function can simplify the part of an application progr am that controls the i 2 c bus. since scl0n and sda0n pins are us ed for n-ch open-drain outputs, i 2 c0n requires pull-up resistors for the serial clock line and the serial data bus line. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 932 19.3 configuration the block diagram of the i 2 c0n is shown below. figure 19-1. block diagram of i 2 c0n (1/2) internal bus iic status register n (iicsn) iic control register n (iiccn) so latch iicen dq cln1, cln0 trcn dfcn dfcn sda0n scl0n output control intiicn iic shift register n (iicn) iiccn.sttn, sptn iicsn.mstsn, excn, coin iicsn.mstsn, excn, coin lreln wreln spien wtimn acken sttn sptn mstsn aldn excn coin trcn ackdn stdn spdn internal bus cldn dadn smcn dfcn cln1 cln0 clxn iic clock select register n (iiccln) stcfn iicbsyn stcenn iicrsvn iic flag register n (iicfn) iic function expansion register n (iicxn) f xp iic division clock select register m (ocksm) f xp to f xp /5 ocksthm ocksenm ocksm1 ocksm0 clear slave address register n (svan) match signal set noise eliminator iic shift register n (iicn) data retention time correction circuit n-ch open-drain output ack detector ack generator start condition detector stop condition detector serial clock counter serial clock controller noise eliminator n-ch open-drain output start condition generator stop condition generator wakeup controller interrupt request signal generator serial clock wait controller bus status detector prescaler prescaler remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3, m = 0, 1 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5, m = 0, 1, 3
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 933 figure 19-1. block diagram of i 2 c0n (2/2) remarks 2. f xp : peripheral clock frequency (pre scaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock a serial bus configuration example is shown below. figure 19-2. serial bus configuration example using i 2 c bus sda scl sda +v dd +v dd scl sda scl slave cpu3 address 3 sda scl slave ic address 4 sda scl slave ic address n master cpu1 slave cpu1 address 1 serial data bus serial clock master cpu2 slave cpu2 address 2
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 934 i 2 c0n includes the following hardware. table 19-4. configuration of i 2 c0n item configuration registers iic shift register n (iicn) slave address register n (svan) control registers iic control register n (iiccn) iic status register n (iicsn) iic flag register n (iicfn) iic clock select register n (iiccln) iic function expansion register n (iicxn) iic division clock select registers 0, 1 (ocks0, ocks1) (1) iic shift register n (iicn) the iicn register converts 8-bit serial data into 8- bit parallel data and vice versa, and can be used for both transmission and reception. write and read operations to the iicn r egister are used to control the act ual transmit and receive operations. this register can be read or written in 8-bit units. reset sets this register to 00h. (2) slave address register n (svan) the svan register sets local addresses when in slave mode. this register can be read or written in 8-bit units. reset sets this register to 00h. (3) so latch the so latch is used to retain t he output level of the sda0n pin. (4) wakeup controller this circuit generates an interrupt r equest signal (intiicn) when the address re ceived by this register matches the address value set to the svan register or when an extension code is received. (5) prescaler this selects the sampling clock to be used. (6) serial clock counter this counter counts the serial clocks that are output and the serial clocks t hat are input during transmit/receive operations and is used to verify that 8-bit data was transmitted or received. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 935 (7) interrupt request signal generator this circuit controls the generation of interrupt request signals (intiicn). an i 2 c interrupt is generated followi ng either of two triggers. ? falling edge of eighth or ninth clock of the serial clock (set by iiccn.wtimn bit) ? interrupt occurrence due to stop conditi on detection (set by iiccn.spien bit) (8) serial clock controller in master mode, this circuit generates the clock output via the scl0n pin from the sampling clock. (9) serial clock wait controller this circuit controls the wait timing. (10) ack generator, stop condition detector, start condition detector, and ack detector these circuits are used to gener ate and detect various statuses. (11) data hold time correction circuit this circuit generates the hold time for data corresponding to the falling edge of the scl0n pin. (12) start condition generator a start condition is generated when the iiccn.sttn bit is set. however, in the communication reservation disabled st atus (iicfn.iicrsvn bit = 1), this request is ignored and the iicfn.stcfn bit is set to 1 if the bus is not released (iicfn.iicbsyn bit = 1). (13) stop condition generator a stop condition is generated when t he iiccn.sptn bit is set (1). (14) bus status detector whether the bus is released or not is ascertai ned by detecting a start c ondition and stop condition. however, the bus status c annot be detected immediately a fter operation, so set the bus status detector to the initial status by using the iicfn.stcenn bit. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 936 19.4 registers i 2 c0n is controlled by t he following registers. ? iic control register n (iiccn) ? iic status register n (iicsn) ? iic flag register n (iicfn) ? iic clock select register n (iiccln) ? iic function expansion register n (iicxn) ? iic division clock select register m (ocksm) the following registers are also used. ? iic shift register n (iicn) ? slave address register n (svan) remarks 1. for the alternate-function pin settings, see table 4-25 using port pin as alternate-function pin . 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3, m = 0, 1 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5, m = 0, 1, 3 (1) iic control register n (iiccn) the iiccn registers enable/stop i 2 c0n operations, set the wait timing, and set other i 2 c operations. these registers can be read or written in 8-bit or 1-bit units. howe ver, set the spien, wtimn, and acken bits when the iicen bit is 0 or during the wa it period. when setting the iicen bit fr om ?0? to ?1?, these bits can also be set at the same time. reset sets these registers to 00h.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 937 (1/4) after reset: 00h r/w address: iicc0 fffffd82h, iicc1 fffffd92h, iicc2 fffffda2h, iicc3, fffffdb2h, iicc4 fffffdc2h note 1 , iicc5 fffffdd2h note 1 <7> <6> <5> <4> <3> <2> <1> <0> iiccn iicen lreln wreln spien wtimn acken sttn sptn iicen specification of i 2 cn operation enable/disable 0 operation stopped. iicsn register reset note 2 . internal operation stopped. 1 operation enabled. be sure to set this bit to 1 when the scl0n and sda0n lines are high level. condition for clearing (iicen bit = 0) condition for setting (iicen bit = 1) ? cleared by instruction ? after reset ? set by instruction lreln note 3 exit from communications 0 normal operation 1 this exits from the current communication oper ation and sets standby mode. this setting is automatically cleared after being ex ecuted. its uses include cases in which a locally irrelevant extension code has been received. the scl0n and sda0n lines are set to high impedance. the sttn and sptn bits and the mstsn, excn, coin , trcn, ackdn, and stdn bits of the iicsn register are cleared. the standby mode following exit from communications rema ins in effect until the following communication entry conditions are met. ? after a stop condition is detected, restart is in master mode. ? an address match occurs or an extension code is received after the start condition. condition for clearing (lreln bit = 0) condition for setting (lreln bit = 1) ? automatically cleared after execution ? after reset ? set by instruction wreln note 3 wait state cancellation control 0 wait state not canceled 1 wait state canceled. this setting is automat ically cleared after wait state is canceled. condition for clearing (wreln bit = 0) condition for setting (wreln bit = 1) ? automatically cleared after execution ? after reset ? set by instruction notes 1. not available in the pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) 2. the iicsn register, iicfn.stcfn and iicfn.iic bsyn bits, and iiccln.cldn and iiccln.dadn bits are reset. 3. this flag?s signal is invalid when the iicen bit = 0. caution if the i 2 cn operation is enabled (iicen bit = 1) when the scl0n line is high level and the sda0n line is low level, the start condition is detected immediately. to avoid this, after enabling the i 2 cn operation, immediately set the lr eln bit to 1 with a bit manipulation instruction. remarks 1. the lreln and wreln bits are 0 when read after the data has been set. 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 938 (2/4) spien note enable/disable generation of interrupt request when stop condition is detected 0 disabled 1 enabled condition for clearing (spien bit = 0) condition for setting (spien bit = 1) ? cleared by instruction ? after reset ? set by instruction wtimn note control of wait state and interrupt request generation 0 interrupt request is generated at the eighth clock?s falling edge. master mode: after output of eight clocks, clock output is set to low level and the wait state is set. slave mode: after input of eight clocks, the clock is set to low level and the wait state is set for the master device. 1 interrupt request is generated at the ninth clock?s falling edge. master mode: after output of nine clocks, clock output is set to low level and the wait state is set. slave mode: after input of nine clocks, the clock is set to low level and the wait state is set for the master device. during address transfer, an interrupt occurs at the falling edge of the ninth clock regardless of this bit setting. this bit setting becomes valid when the address transfer is complet ed. in master mode, a wait state is inserted at the falling edge of the ninth clock during address transfer. for a slave device that has rece ived a local address, a wait state is inserted at the falling edge of the ninth clock a fter ack is generated. when t he slave device has received an extension code, however, a wait state is inserted at the falling edge of the eighth clock. condition for clearing (wtimn bit = 0) condition for setting (wtimn bit = 1) ? cleared by instruction ? after reset ? set by instruction acken note acknowledgment control 0 acknowledgment disabled. 1 acknowledgment enabled. during t he ninth clock period, the sda0n line is set to low level. the acken bit setting is invalid for address reception. in this case, ack is generated when the addresses match. however, the acken bit setting is valid for reception of the extension code. condition for clearing (acken bit = 0) condition for setting (acken bit = 1) ? cleared by instruction ? after reset ? set by instruction note this flag?s signal is invalid when the iicen bit = 0. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 939 (3/4) sttn start condition trigger 0 start condition is not generated. 1 when bus is released (in stop mode): a start condition is generated (for st arting as master). the sda0n line is changed from high level to low level while the scln line is high level and then the start condition is generated. next, after the rated amount of time has elapsed, the scl0n line is changed to low level (wait state). during communication with a third party: ? if the communication reservation func tion is enabled (iicfn.iicrsvn bit = 0) this trigger functions as a star t condition reserve flag. when set to 1, it releases the bus and then automatically generates a start condition. ? if the communication reservation f unction is disabled (iicrsvn = 1) the iicfn.stcfn bit is set to 1 to clear the info rmation set (1) to the sttn bit. this trigger does not generate a start condition. in the wait state (when master device): a restart condition is generated afte r the wait state is released. cautions concerning set timing for master reception: cannot be set to 1 during transfer. can be set to 1 only when the acken bit has been set to 0 and the slave has been notified of final reception. for master transmission: a start condition cannot be generat ed normally during the ack period. set to 1 during the wait period that follows output of the ninth clock. for slave: even when the communication reservati on function is disabled (iicrsvn bit = 1), the communication reservation status is entered. ? setting to 1 at the same time as the sptn bit is prohibited. ? when the sttn bit is set to 1, setting the sttn bit to 1 again is disabled until the setting is cleared to 0. condition for clearing (sttn bit = 0) condition for setting (sttn bit = 1) ? when the sttn bit is set to 1 in the communication reservation disabled status ? cleared by loss in arbitration ? cleared by start condition generation in the master device ? when the lreln bit = 1 (communication save) ? when the iicen bit = 0 (operation stop) ? after reset ? set by instruction remarks 1. the sttn bit is 0 if it is read immediately after data setting. 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 940 (4/4) sptn stop condition trigger 0 stop condition is not generated. 1 stop condition is generated (terminati on of master device?s transfer). after the sda0n line goes to low level, either set the scl0n line to high level or wait until the scl0n pin goes to high level. next, after the rated am ount of time has elapsed, the sda0n line is changed from low level to high level and a stop condition is generated. cautions concerning set timing for master reception: cannot be set to 1 during transfer. can be set to 1 only when the acken bit has been set to 0 and during the wait period after the slave has been notified of final reception. for master transmission: a stop condition cannot be generat ed normally during the ack reception period. set to 1 during the wait period that follows output of the ninth clock. ? cannot be set to 1 at the same time as the sttn bit. ? the sptn bit can be set to 1 only when in master mode note . ? when the wtimn bit has been set to 0, if the sptn bit is set to 1 during the wait period that follows output of eight clocks, note that a stop condition will be generated during the high-level period of the ninth clock. the wtimn bit should be changed from 0 to 1 during the wait period following output of eight clocks, and the sptn bit should be set to 1 during the wait peri od that follows output of the ninth clock. ? when the sptn bit is set to 1, setting the sptn bit to 1 again is disabled until the setting is cleared to 0. condition for clearing (sptn bit = 0) condition for setting (sptn bit = 1) ? cleared by loss in arbitration ? automatically cleared after stop condition is detected ? when the lreln bit = 1 (communication save) ? when the iicen bit = 0 (operation stop) ? after reset ? set by instruction note set the sptn bit to 1 only in master mode. howeve r, when the iicrsvn bit is 0, the sptn bit must be set to 1 and a stop condition generated before the firs t stop condition is detect ed following the switch to the operation enabled stat us. for details, see 19.15 cautions . caution when the trcn bit = 1, the wreln bit is set to 1 during the ninth clock and the wait state is canceled, after which th e trcn bit is cleared to 0 and the sda0n line is set to high impedance. remarks 1. the sptn bit is 0 if it is r ead immediately after data setting. 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 941 (2) iic status registers n (iicsn) the iicsn registers indica te the status of the i 2 c0n bus. these registers are read-only, in 8-bit or 1-bit units. however, t he iicsn register can only be read when the iiccn.sttn bit is 1 or during the wait period. reset sets these registers to 00h. caution accessing the iicsn register is prohibited in the following statu ses. for details, refer to 3.4.9 (2) accessing specific on-chip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with th e internal oscillation clock (1/3) after reset: 00h r address: iics0 fffffd86h, iics1 fffffd96h, iics2 fffffda6h, iics3 fffffdb6h, iics4 fffffdc6h note 1 , iics5 fffffdd6h note 1 <7> <6> <5> <4> <3> <2> <1> <0> iicsn mstsn aldn excn coin trcn ackdn stdn spdn mstsn master device status 0 slave device status or communication standby status 1 master device communication status condition for clearing (mstsn bit = 0) condition for setting (mstsn bit = 1) ? when a stop condition is detected ? when the aldn bit = 1 (arbitration loss) ? cleared by lreln bit = 1 (communication save) ? when the iicen bit changes from 1 to 0 (operation stop) ? after reset ? when a start condition is generated aldn arbitration loss detection 0 this status means either that there was no arbitr ation or that the arbitration result was a ?win?. 1 this status indicates the arbitration result was a ?loss?. the mstsn bit is cleared to 0. condition for clearing (aldn bit = 0) condition for setting (aldn bit = 1) ? automatically cleared after the iicsn register is read note 2 ? when the iicen bit changes from 1 to 0 (operation stop) ? after reset ? when the arbitration result is a ?loss?. notes 1. other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3- h) 2. the aldn bit is also cleared when a bit mani pulation instruction is executed for another bit in the iicsn register. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 942 (2/3) excn detection of extension code reception 0 extension code was not received. 1 extension code was received. condition for clearing (excn bit = 0) condition for setting (excn bit = 1) ? when a start condition is detected ? when a stop condition is detected ? cleared by lreln bit = 1 (communication save) ? when the iicen bit changes from 1 to 0 (operation stop) ? after reset ? when the higher four bits of the received address data are either ?0000? or ?1111? (set at the rising edge of the eighth clock). coin matching address detection 0 addresses do not match. 1 addresses match. condition for clearing (coin bit = 0) condition for setting (coin bit = 1) ? when a start condition is detected ? when a stop condition is detected ? cleared by lreln bit = 1 (communication save) ? when the iicen bit changes from 1 to 0 (operation stop) ? after reset ? when the received address matches the local address (svan register) (set at the rising edge of the eighth clock). trcn transmit/receive status detection 0 receive status (other than transmit status ). the sda0n line is set to high impedance. 1 transmit status. the value in t he so latch is enabled for output to the sda0n line (valid starting at the falling edge of the first byte?s ninth clock). condition for clearing (trcn bit = 0) condition for setting (trcn bit = 1) ? when a stop condition is detected ? cleared by lreln bit = 1 (communication save) ? when the iicen bit changes from 1 to 0 (operation stop) ? cleared by iiccn.wreln bit = 1 note ? when the aldn bit changes from 0 to 1 (arbitration loss) ? after reset master ? when ?1? is output to the first byte?s lsb (transfer direction specification bit) slave ? when a start condition is detected when not used for communication master ? when a start condition is generated ? when ?0? is output to the first byte?s lsb (transfer direction specification bit) slave ? when ?1? is input by the first byte?s lsb (transfer direction specification bit) note the trcn bit is cleared to 0 and sda0n li ne becomes high impedance when the wreln bit is set to 1 and the wait state is canceled to 0 at the ninth clock by trcn bit = 1. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 943 (3/3) ackdn ack detection 0 ack was not detected. 1 ack was detected. condition for clearing (ackdn bit = 0) condition for setting (ackdn bit = 1) ? when a stop condition is detected ? at the rising edge of the next byte?s first clock ? cleared by lreln bit = 1 (communication save) ? when the iicen bit changes from 1 to 0 (operation stop) ? after reset ? after the sda0n bit is set to low level at the rising edge of the scl0n pin?s ninth clock stdn start condition detection 0 start condition was not detected. 1 start condition was detected. this indicates that the address transfer period is in effect condition for clearing (stdn bit = 0) condition for setting (stdn bit = 1) ? when a stop condition is detected ? at the rising edge of the next byte?s first clock following address transfer ? cleared by lreln bit = 1 (communication save) ? when the iicen bit changes from 1 to 0 (operation stop) ? after reset ? when a start condition is detected spdn stop condition detection 0 stop condition was not detected. 1 stop condition was detected. the master devic e?s communication is terminated and the bus is released. condition for clearing (spdn bit = 0) condition for setting (spdn bit = 1) ? at the rising edge of the address transfer byte?s first clock following setting of this bit and detection of a start condition ? when the iicen bit changes from 1 to 0 (operation stop) ? after reset ? when a stop condition is detected remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 944 (3) iic flag register n (iicfn) the iicfn registers set the i 2 c0n operation mode and indicate the i 2 c bus status. these registers can be read or writt en in 8-bit or 1-bit units. howeve r, the stcfn and iicbsyn bits are read- only. iicrsvn enables/disables the communi cation reservation function (see 19.14 communication reservation ). the initial value of the iicbsyn bit is set by using the stcenn bit (see 19.15 cautions ). the iicrsvn and stcenn bits can be written only when operation of i 2 c0n is disabled (iiccn.iicen bit = 0). after operation is enabled, iicfn can be read. reset sets these registers to 00h. (1/2) after reset: 00h r/w note 1 address: iicf0 fffffd8ah, iicf1 fffffd9ah, iicf2 fffffdaah, iicf3 fffffdbah, iicf4 fffffdcah note 2 , iicf5 fffffddah note 2 <7> <6> 5 4 3 2 <1> <0> iicfn stcfn iicbsyn 0 0 0 0 stcenn iicrsvn stcfn sttn bit clear 0 start condition issued 1 start condition cannot be issued, sttn bit cleared condition for clearing (stcfn bit = 0) condition for setting (stcfn bit = 1) ? cleared by iiccn.sttn bit = 1 ? when the iiccn.iicen bit = 0 ? after reset ? when start condition is not issued and sttn flag is cleared to 0 during communi cation reservation is disabled (iicrsvn bit = 1). iicbsyn i 2 c0n bus status 0 bus released status (default communi cation status when stcenn bit = 1) 1 bus communication status (default comm unication status when stcenn bit = 0) condition for clearing (iicbsyn bit = 0) condition for setting (iicbsyn bit = 1) ? when stop condition is detected ? when the iicen bit = 0 ? after reset ? when start condition is detected ? by setting the iicen bit when the stcenn bit = 0 notes 1. bits 6 and 7 are read-only bits. 2. other than the pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) cautions 1. write the stcenn bit only wh en operation is stopped (iicen bit = 0). 2. when the stcenn bit = 1, the bus rel eased status (iicbsyn bit = 0) is recognized regardless of the actual bus st atus immediately after the i 2 cn bus operation is enabled. therefore, to i ssue the first start condition (sttn bit = 1), it is necessary to confirm that the bus has been released, so as to not disturb other communications. 3. write the iicrsvn bit only when operation is stopped (iicen bit = 0). remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 945 (2/2) stcenn initial start enable trigger 0 start conditions cannot be generated until a stop condition is detected following operation enable (iicen bit = 1). 1 start conditions can be generated even if a stop condition is not detected following operation enable (iicen bit = 1). condition for clearing (stcenn bit = 0) condition for setting (stcenn bit = 1) ? when start condition is detected ? after reset ? setting by instruction iicrsvn communication reserv ation function disable bit 0 communication reservation enabled 1 communication reservation disabled condition for clearing (iicrsvn bit = 0) condition for setting (iicrsvn bit = 1) ? clearing by instruction ? after reset ? setting by instruction cautions 1. write the stcenn bit only wh en operation is stopped (iicen bit = 0). 2. when the stcenn bit = 1, the bus rel eased status (iicbsyn bit = 0) is recognized regardless of the actual bus st atus immediately after the i 2 cn bus operation is enabled. therefore, to i ssue the first start condition (sttn bit = 1), it is necessary to confirm that the bus has been released, so as to not disturb other communications. 3. write the iicrsvn bit only when operation is stopped (iicen bit = 0). remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 946 (4) iic clock select register n (iiccln) the iiccln registers set the transfer clock for the i 2 c0n bus. these registers can be read or written in 8-bit or 1-bit units. however, the cldn and dadn bits are read-only. set the iiccln register when the iiccn.iicen bit = 0. the smcn, cln1, and cln0 bits are set by the co mbination of the iicxn.clxn bit and the ocksthm, ocksm1, and ocksm0 bits of the ocksm register (see 19.4 (6) i 2 c0n transfer clock setting method ). reset sets these registers to 00h. after reset: 00h r/w note 1 address: iiccl0 fffffd84h, iiccl1 fffffd94h, iiccl2 fffffda4h, iiccl3 fffffdb4h, iiccl4 fffffdc4h note 2 , iiccl5 fffffdd4h note 2 7 6 <5> <4> 3 2 1 0 iiccln 0 0 cldn dadn smcn dfcn cln1 cln0 cldn detection of scl0n pin level (valid only when iiccn.iicen bit = 1) 0 the scl0n pin was detected at low level. 1 the scl0n pin was detected at high level. condition for clearing (cldn bit = 0) condition for setting (cldn bit = 1) ? when the scl0n pin is at low level ? when the iicen bit = 0 (operation stop) ? after reset ? when the scl0n pin is at high level dadn detection of sda0n pin level (valid only when iicen bit = 1) 0 the sda0n pin was detected at low level. 1 the sda0n pin was detected at high level. condition for clearing (dadn bit = 0) condition for setting (dadn bit = 1) ? when the sda0n pin is at low level ? when the iicen bit = 0 (operation stop) ? after reset ? when the sda0n pin is at high level smcn operation mode switching 0 operation in standard mode. 1 operation in high-speed mode. dfcn digital filter operation control 0 digital filter off. 1 digital filter on. the digital filter can be used only in high-speed mode. in high-speed mode, the transfer clock does not vary regardless of the dfcn bit setting (on/off). the digital filter is used to e liminate noise in high-speed mode. notes 1. bits 4 and 5 of iiccln are read-only bits. 2. other than the pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) caution be sure to set bits 7 and 6 of iiccln to 0. remarks 1. when the iiccn.iicen bit = 0, 0 is r ead when reading the cldn and dadn bits. 2. only pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3, m = 0, 1 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5, m = 0, 1, 3
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 947 (5) iic function expansion register n (iicxn) the iicxn registers set i 2 c0n function expansion (valid only in the high-speed mode). these registers can be read or wri tten in 8-bit or 1-bit units. setting of the clxn bit is performed in combination wit h the smcn, cln1, and cln0 bits of the iiccln register and the ocksthm, ocksm1, and ocksm0 bi ts of the ocksm register (see 19.4 (6) i 2 c0n transfer clock setting method ). set the iicxn register when the iiccn.iicen bit = 0. reset sets these registers to 00h. iicxn after reset: 00h r/w address: iicx0 fffffd85h, iicx1 fffffd95h, iicx2 fffffda5h, iicx3 fffffdb5h, iicx4 fffffdc5h note , iicx5 fffffdd5h note 0 0 0 0 0 0 0 clxn < > note other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3- h) remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3, m = 0, 1 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5, m = 0, 1, 3 (6) i 2 c0n transfer clock setting method the i 2 c0n transfer clock frequency (f scl ) is calculated using the following expression. f scl = 1/(m t + t r + t f ) m = 12, 18, 24, 36, 44, 48, 54, 60, 66, 72, 86, 88, 90, 96, 132, 172, 176, 198, 220, 258, 264, 330, 344, 430 (see table 19-5 clock settings ). t: 1/f xp t r : scl0n pin rise time t f : scl0n pin fall time f xp : peripheral clock frequency (pre scaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock for example, the i 2 c0n transfer clock frequency (f scl ) when f xp = 19.2 mhz, m = 198, t r = 200 ns, and t f = 50 ns is calculated using following expression. f scl = 1/(198 52 ns + 200 ns + 50 ns) ? 94.7 khz
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 948 m t + t r + t f m/2 t t f t r m/2 t scl0n scl0n inversion scl0n inversion scl0n inversion the clock to be selected can be set by the combinat ion of the smcn, cln1, and cln0 bits of the iiccln register, the clxn bit of the iicxn register, and the ocksthm, ocksm1, and ocksm0 bits of the ocksm register. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3, m = 0, 1 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5, m = 0, 1, 3
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 949 table 19-5. clock settings (1/3) iicxa iiccla bit 0 bit 3 bit 1 bit 0 clxa smca cla1 cla0 selection clock transfer clock settable peripheral clock frequency (f xp ) range operating mode f xp (when ocks0 = 18h set) f xp /44 2.00 mhz f xp 4.19 mhz f xp /2 (when ocks0 = 10h set) f xp /88 4.00 mhz f xp 8.38 mhz f xp /3 (when ocks0 = 11h set) f xp /132 6.00 mhz f xp 12.57 mhz f xp /4 (when ocks0 = 12h set) f xp /176 8.00 mhz f xp 16.76 mhz 0 0 0 0 f xp /5 (when ocks0 = 13h set) f xp /220 10.00 mhz f xp 20.95 mhz f xp (when ocks0 = 18h set) f xp /86 4.19 mhz f xp 8.38 mhz f xp /2 (when ocks0 = 10h set) f xp /172 8.38 mhz f xp 16.76 mhz f xp /3 (when ocks0 = 11h set) f xp /258 12.57 mhz f xp 25.14 mhz f xp /4 (when ocks0 = 12h set) f xp /344 16.76 mhz f xp 32.00 mhz 0 0 0 1 f xp /5 (when ocks0 = 13h set) f xp /430 20.95 mhz f xp 32.00 mhz 0 0 1 0 f xp note f xp /86 4.19 mhz f xp 8.38 mhz f xp (when ocks0 = 18h set) f xp /66 6.40 mhz f xp /2 (when ocks0 = 10h set) f xp /132 12.80 mhz f xp /3 (when ocks0 = 11h set) f xp /198 19.20 mhz f xp /4 (when ocks0 = 12h set) f xp /264 25.60 mhz 0 0 1 1 f xp /5 (when ocks0 = 13h set) f xp /330 32.00 mhz standard mode (smca bit = 0) f xp (when ocks0 = 18h set) f xp /24 4.19 mhz f xp 8.38 mhz f xp /2 (when ocks0 = 10h set) f xp /48 8.00 mhz f xp 16.76 mhz f xp /3 (when ocks0 = 11h set) f xp /72 12.00 mhz f xp 25.14 mhz 0 1 0 f xp /4 (when ocks0 = 12h set) f xp /96 16.00 mhz f xp 32.00 mhz 0 1 1 0 f xp note f xp /24 4.00 mhz f xp 8.38 mhz f xp (when ocks0 = 18h set) f xp /18 6.40 mhz f xp /2 (when ocks0 = 10h set) f xp /36 12.80 mhz f xp /3 (when ocks0 = 11h set) f xp /54 19.20 mhz f xp /4 (when ocks0 = 12h set) f xp /72 25.60 mhz 0 1 1 1 f xp /5 (when ocks0 = 13h set) f xp /90 32.00 mhz f xp (when ocks0 = 18h set) f xp /12 4.00 mhz f xp 4.19 mhz f xp /2 (when ocks0 = 10h set) f xp /24 8.00 mhz f xp 8.38 mhz f xp /3 (when ocks0 = 11h set) f xp /36 12.00 mhz f xp 12.57 mhz f xp /4 (when ocks0 = 12h set) f xp /48 16.00 mhz f xp 16.67 mhz 1 1 0 f xp /5 (when ocks0 = 13h set) f xp /60 20.00 mhz f xp 20.95 mhz 1 1 1 0 f xp note f xp /12 4.00 mhz f xp 4.19 mhz high-speed mode (smca bit = 1) other than above setting prohibited ? ? ? note since the selection clock is f xp regardless of the value set to the oc ks0 register, clear the ocks0 register to 00h (i 2 c division clock stopped status). remarks 1. a = 0, 3 2. : don?t care 3. f xp : peripheral clock frequency (presca ler 1 input clock frequency) refer to remark 2 in table 19-1 for details.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 950 table 19-5. clock settings (2/3) iicxb iicclb bit 0 bit 3 bit 1 bit 0 clxb smcb clb1 clb0 selection clock transfer clock settable peripheral clock frequency (f xp ) range operating mode f xp (when ocks1 = 18h set) f xp /44 2.00 mhz f xp 4.19 mhz f xp /2 (when ocks1 = 10h set) f xp /88 4.00 mhz f xp 8.38 mhz f xp /3 (when ocks1 = 11h set) f xp /132 6.00 mhz f xp 12.57 mhz f xp /4 (when ocks1 = 12h set) f xp /176 8.00 mhz f xp 16.76 mhz 0 0 0 0 f xp /5 (when ocks1 = 13h set) f xp /220 10.00 mhz f xp 20.95 mhz f xp (when ocks1 = 18h set) f xp /86 4.19 mhz f xp 8.38 mhz f xp /2 (when ocks1 = 10h set) f xp /172 8.38 mhz f xp 16.76 mhz f xp /3 (when ocks1 = 11h set) f xp /258 12.57 mhz f xp 25.14 mhz f xp /4 (when ocks1 = 12h set) f xp /344 16.76 mhz f xp 32.00 mhz 0 0 0 1 f xp /5 (when ocks1 = 13h set) f xp /430 20.95 mhz f xp 32.00 mhz 0 0 1 0 f xp note f xp /86 4.19 mhz f xp 8.38 mhz f xp (when ocks1 = 18h set) f xp /66 6.40 mhz f xp /2 (when ocks1 = 10h set) f xp /132 12.80 mhz f xp /3 (when ocks1 = 11h set) f xp /198 19.20 mhz f xp /4 (when ocks1 = 12h set) f xp /264 25.60 mhz 0 0 1 1 f xp /5 (when ocks1 = 13h set) f xp /330 32.00 mhz standard mode (smcb bit = 0) f xp (when ocks1 = 18h set) f xp /24 4.19 mhz f xp 8.38 mhz f xp /2 (when ocks1 = 10h set) f xp /48 8.00 mhz f xp 16.76 mhz f xp /3 (when ocks1 = 11h set) f xp /72 12.00 mhz f xp 25.14 mhz 0 1 0 f xp /4 (when ocks1 = 12h set) f xp /96 16.00 mhz f xp 32.00 mhz 0 1 1 0 f xp note f xp /24 4.00 mhz f xp 8.38 mhz f xp (when ocks1 = 18h set) f xp /18 6.40 mhz f xp /2 (when ocks1 = 10h set) f xp /36 12.80 mhz f xp /3 (when ocks1 = 11h set) f xp /54 19.20 mhz f xp /4 (when ocks1 = 12h set) f xp /72 25.60 mhz 0 1 1 1 f xp /5 (when ocks1 = 13h set) f xp /90 32.00 mhz f xp (when ocks1 = 18h set) f xp /12 4.00 mhz f xp 4.19 mhz f xp /2 (when ocks1 = 10h set) f xp /24 8.00 mhz f xp 8.38 mhz f xp /3 (when ocks1 = 11h set) f xp /36 12.00 mhz f xp 12.57 mhz f xp /4 (when ocks1 = 12h set) f xp /48 16.00 mhz f xp 16.67 mhz 1 1 0 f xp /5 (when ocks1 = 13h set) f xp /60 20.00 mhz f xp 20.95 mhz 1 1 1 0 f xp note f xp /12 4.00 mhz f xp 4.19 mhz high-speed mode (smcb bit = 1) other than above setting prohibited ? ? ? note since the selection clock is f xp regardless of the value set to the oc ks1 register, clear the ocks1 register to 00h (i 2 c division clock stopped status). remarks 1. b = 1, 2 2. : don?t care 3. f xp : peripheral clock frequency (presca ler 1 input clock frequency) refer to remark 2 in table 19-1 for details.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 951 table 19-5. clock settings (3/3) iicxk iicclk bit 0 bit 3 bit 1 bit 0 clxk smck clk1 clk0 selection clock transfer clock settable peripheral clock frequency (f xp ) range operating mode f xp (when ocks3 = 18h set) f xp /44 2.00 mhz f xp 4.19 mhz f xp /2 (when ocks3 = 10h set) f xp /88 4.00 mhz f xp 8.38 mhz f xp /3 (when ocks3 = 11h set) f xp /132 6.00 mhz f xp 12.57 mhz f xp /4 (when ocks3 = 12h set) f xp /176 8.00 mhz f xp 16.76 mhz 0 0 0 0 f xp /5 (when ocks3 = 13h set) f xp /220 10.00 mhz f xp 20.95 mhz f xp (when ocks3 = 18h set) f xp /86 4.19 mhz f xp 8.38 mhz f xp /2 (when ocks3 = 10h set) f xp /172 8.38 mhz f xp 16.76 mhz f xp /3 (when ocks3 = 11h set) f xp /258 12.57 mhz f xp 25.14 mhz f xp /4 (when ocks3 = 12h set) f xp /344 16.76 mhz f xp 32.00 mhz 0 0 0 1 f xp /5 (when ocks3 = 13h set) f xp /430 20.95 mhz f xp 32.00 mhz 0 0 1 0 f xp note f xp /86 4.19 mhz f xp 8.38 mhz 0 0 1 1 setting prohibited ? ? standard mode (smck bit = 0) f xp (when ocks3 = 18h set) f xp /24 4.19 mhz f xp 8.38 mhz f xp /2 (when ocks3 = 10h set) f xp /48 8.00 mhz f xp 16.76 mhz f xp /3 (when ocks3 = 11h set) f xp /72 12.00 mhz f xp 25.14 mhz 0 1 0 f xp /4 (when ocks3 = 12h set) f xp /96 16.00 mhz f xp 32.00 mhz 0 1 1 0 f xp note f xp /24 4.00 mhz f xp 8.38 mhz 0 1 1 1 setting prohibited ? ? f xp (when ocks3 = 18h set) f xp /12 4.00 mhz f xp 4.19 mhz f xp /2 (when ocks3 = 10h set) f xp /24 8.00 mhz f xp 8.38 mhz f xp /3 (when ocks3 = 11h set) f xp /36 12.00 mhz f xp 12.57 mhz f xp /4 (when ocks3 = 12h set) f xp /48 16.00 mhz f xp 16.67 mhz 1 1 0 f xp /5 (when ocks3 = 13h set) f xp /60 20.00 mhz f xp 20.95 mhz 1 1 1 0 f xp note f xp /12 4.00 mhz f xp 4.19 mhz high-speed mode (smck bit = 1) other than above setting prohibited ? ? ? note since the selection clock is f xp regardless of the value set to the oc ks3 register, clear the ocks3 register to 00h (i 2 c division clock stopped status). remarks 1. k = 4, 5 2. : don?t care 3. f xp : peripheral clock frequency (presca ler 1 input clock frequency) refer to remark 2 in table 19-1 for details.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 952 (7) iic division clock select register m (ocksm) the ocksm registers control the i 2 c0n division clock. these registers control the i 2 c00 and i 2 c03 division clock via the ocks0 register, the i 2 c01 and i 2 c02 division clocks via the ocks1 register, and the i 2 c04 and i 2 c05 division clocks via the ocks3 register. these registers can be read or written in 8-bit units. reset sets these registers to 00h. 0 ocksm 0 0 ocksenm ocksthm 0 ocksm1 ocksm0 after reset: 00h r/w address: ocks0 fffff340h, ocks1 fffff344h, ocks3 fffff34ch note disable i 2 c division clock operation enable i 2 c division clock operation ocksenm 0 1 operation setting of i 2 c division clock ocksm1 0 0 1 1 0 other than above ocksm0 0 1 0 1 0 selection of i 2 c division clock f xp /2 f xp /3 f xp /4 f xp /5 f xp setting prohibited ocksthm 0 0 0 0 1 note other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) remarks 1. only pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), 70f3933 (v850e/sj3-h): m = 0, 1 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), 70f3933 (v850e/sj3-h): m = 0, 1, 3 2. f xp : peripheral clock frequency (pre scaler 1 input clock frequency) in clock mode 1, f xp = f xx in clock mode 2, f xp = f xmpll /2 (14.64 to 16 mhz) in clock mode 3, f xp = f xmpll (29.28 to 32 mhz) in clock mode 4, f xp = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clock
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 953 (8) iic shift register n (iicn) the iicn registers are used for serial transmission/reception (shift operations) synchronized with the serial clock. these registers can be read or written in 8-bit units, but data should not be written to the iicn register during a data transfer. access (read/write) the iicn register only during the wait period. accessi ng this register in communication states other than the wa it period is prohibited. howe ver, for the master device, t he iicn register can be written once only after the transmission trigger bit (iiccn.sttn bit) has been set to 1. a wait state is released by writi ng the iicn register during the wait period, and data transfer is started. reset sets these registers to 00h. after reset: 00h r/w address: iic0 fffffd80h, iic1 fffffd90h, iic2 fffffda0h, iic3 fffffdb0h, iic4 fffffdc0h note , iic5 fffffdd0h note 7 6 5 4 3 2 1 0 iicn note other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h) remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 (9) slave address register n (svan) the svan registers hold the i 2 c bus?s slave addresses. these registers can be read or written in 8-bit units, but bit 0 should be fixed to 0. however, rewriting these registers is prohibited when the iicsn.s tdn bit = 1 (start condition detection). reset sets these registers to 00h. after reset: 00h r/w address: sva0 fffffd83h, sva1 fffffd93h, sva2 fffffda3h, sva3 fffffdb3h, sva4 fffffdc3h note , sva5 fffffdd3h note 7 6 5 4 3 2 1 0 svan 0 note other than the pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h) remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 954 19.5 i 2 c bus mode functions 19.5.1 pin configuration the serial clock pin (scl0n) and serial data bus pin (sda0n) are configured as follows. scl0n ................th is pin is used for serial clock input and output. this pin is an n-ch open-drain output for both ma ster and slave devices. input is schmitt input. sda0n ................th is pin is used for serial data input and output. this pin is an n-ch open-drain output for both ma ster and slave devices. input is schmitt input. since outputs from the serial clock line and the serial dat a bus line are n-ch open-drain outputs, an external pull-up resistor is required. figure 19-3. pin configuration diagram v dd scl0n sda0n scl0n sda0n v dd clock output master device (clock input) data output data input (clock output) clock input data output data input slave device remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 955 19.6 i 2 c bus definitions and control methods the following section describes the i 2 c bus?s serial data communication format and the signals used by the i 2 c bus. the transfer timing for the ?start condition?, ?address?, ?tr ansfer direction specification? , ?data?, and ?stop condition? generated on the i 2 c bus?s serial data bus is shown below. figure 19-4. i 2 c bus serial data transfer timing 1 to 7 8 9 1 to 8 9 1 to 8 9 scl0n sda0n r/w start condition address ack data data stop condition ack ack remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 the master device generates the start condition, slave address, and stop condition. ack can be generated by either the master or slave device (normally, it is generated by the devic e that receives 8- bit data). the serial clock (scl0n) is continuous ly output by the master device. however, in t he slave device, the scl0n pin?s low-level period can be extended and a wait state can be inserted.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 956 19.6.1 start condition a start condition is met when the scl0n pin is high level and the sda0n pin changes from high level to low level. the start condition for the scl0n and sda 0n pins is generated that the master device to the slave device when starting a serial transfer. the slave device can defect the start condition. figure 19-5. start condition h scl0n sda0n remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 a start condition is generated when the iiccn.sttn bit is set (1) after a stop condition has been detected (iicsn.spdn bit = 1). when a start condition is detected, the iicsn.stdn bit is set (1). caution when the iiccn.iicen bit of the v850e/sj3-h and v850e/sk3-h is set to 1 while communications with other devices are in progress, the start condi tion may be detected depending on the status of the communication line. be sure to set th e iiccn.iicen bit to 1 when the scl0n and sda0n lines are high level.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 957 19.6.2 addresses the 7 bits of data that follow the st art condition are defined as an address. an address is a 7-bit data segment that is output in order to select one of t he slave devices that are connected to the master device via the bus lines. therefore, each slave device connect ed via the bus lines must have a unique address. the slave devices include hardware that detects the start condition and chec ks whether or not the 7-bit address data matches the data values stored in t he svan register. if the address data matc hes the values of the svan register, the slave device is selected and communicates with the ma ster device until the master device generates a start condition or stop condition. figure 19-6. address address scl0n 1 sda0n intiicn note 23456789 ad6 ad5 ad4 ad3 ad2 ad1 ad0 r/w note the interrupt request signal (int iicn) is generated if a local addre ss or extension code is received during slave device operation. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 the slave address and the eighth bit, which specif ies the transfer direction as described in 19.6.3 transfer direction specification below, are written together to iic shift regi ster n (iicn) and then out put. received addresses are written to the iicn register. the slave address is assigned to the hi gher 7 bits of the iicn register.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 958 19.6.3 transfer dir ection specification in addition to the 7-bit address data, the master device sends 1 bit that specif ies the transfer direction. when this transfer direction specification bit has a value of 0, it indicates that the mast er device is transmitting data to a slave device. when the transfer direction specification bit has a val ue of 1, it indicates that t he master device is receiving data from a slave device. figure 19-7. transfer direction specification scl0n 1 sda0n intiicn 23456789 ad6 ad5 ad4 ad3 ad2 ad1 ad0 r/w transfer direction specification note note the intiicn signal is generated if a local address or extension code is re ceived during slave device operation. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 959 19.6.4 ack ack is used to confirm the serial data stat us of the transmitting and receiving devices. the receiving device returns ack for every 8 bits of data it receives. the transmitting device normally receives ack after transmi tting 8 bits of data. when ack is returned from the receiving device, the reception is j udged as normal and processing continues. t he detection of ack is confirmed with the iicsn.ackdn bit. when the master device is the receivi ng device, after receiving the final dat a, it does not return ack and generates the stop condition. when the slave dev ice is the receiving device and does not return ack, the master device generates either a stop condition or a rest art condition, and then stops the current transmission. failure to return ack may be caused by the following factors. (a) reception was not performed normally. (b) the final data was received. (c) the receiving device (slave) does not exist for the specified address. when the receiving device sets the sda0n line to low level during the ninth clo ck, ack is generated (normal reception). when the iiccn.acken bit is set to 1, automatic ac k generation is enabled. trans mission of the eighth bit following the 7 address data bits causes the iicsn.trcn bit to be set. normally, set the acken bit to 1 for reception (trcn bit = 0). when the slave device is receiving (when trcn bit = 0), if the slave device cannot rece ive data, clear the acken bit to 0 to indicate to the master that no more data can be received. similarly, when the master device is receiving (when trcn bit = 0) and the subsequent data is not needed, clear the acken bit to 0 to prevent ack from being generated. th is notifies the slave device (transmitting device) of the end of the data transmissi on (transmission stopped). figure 19-8. ack scl0n 1 sda0n 23456789 ad6 ad5 ad4 ad3 ad2 ad1 ad0 r/w ack remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 when the local address is received, ack is automatically generated regardless of the value of the acken bit. no ack is generated if the received addre ss is not a local address (nack). when receiving the extension code, set the acken bit to 1 in advance to generate ack. the ack generation method during data rec eption is based on the wait timing setti ng, as described by the following. ? when 8-clock wait is selected (iiccn.wtimn bit = 0): ack is generated at the falling edge of t he scl0n pin?s eighth clock if the acken bit is set to 1 before the wait state cancellation. ? when 9-clock wait is selected (iiccn.wtimn bit = 1): ack is generated if the acken bit is set to 1 in advance.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 960 19.6.5 stop condition when the scl0n pin is high level, changing the sda0n pin fr om low level to high level generates a stop condition. a stop condition is generated when serial transfer from the ma ster device to the slave device has been completed. when used as the slave device, t he start condition can be detected. figure 19-9. stop condition h scl0n sda0n remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e /sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 a stop condition is generated when the ii ccn.sptn bit is set to 1. when the stop condition is detected, the iicsn.spdn bit is set to 1 and the interrupt request signal (i ntiicn) is generated when the iiccn .spien bit is set to 1.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 961 19.6.6 wait state a wait state is used to notify the comm unication partner that a device (master or slave) is preparing to transmit or receive data (i.e., is in a wait state). setting the scl0n pin to low level notifies the communication partner of the wait state. when the wait state has been canceled for both the master and slave de vices, the next data transfer can begin. figure 19-10. wait state (1/2) (a) when master device has a nine-clock wa it and slave device has an eight-clock wait (master: transmission, slave: recep tion, and iiccn.acken bit = 1) scl0n 6 sda0n 78 9 123 scl0n iicn 6 h 78 123 d2 d1 d0 ack d7 d6 d5 9 iicn scl0n acken master master returns to high impedance but slave is in wait state (low level). wait after output of ninth clock. iicn data write (cancel wait state) slave wait after output of eighth clock. ffh is written to iicn register or iiccn.wreln bit is set to 1. transfer lines wait state from slave wait state from master remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 962 figure 19-10. wait state (2/2) (b) when master and slave d evices both have a nine-clock wait (master: transmission, slave: reception, and acken bit = 1) scl0n 6 sda0n 789 123 scl0n iicn 6 h 78 1 23 d2 d1 d0 ack d7 d6 d5 9 iicn scl0n acken master master and slave both wait after output of ninth clock. iicn data write (cancel wait state) slave ffh is written to iicn register or wreln bit is set to 1. generated according to previously set acken bit value transfer lines wait state from master/ slave wait state from slave remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 a wait state is automatically generated after generation of the start conditi on. a wait state is also automatically generated depending on the setting of the iiccn.wtimn bit. normally, when the iiccn.wreln bit is set to 1 or when ffh is written to the iicn register on the receiving side, the wait state is canceled and the trans mitting side writes data to the iicn regi ster to cancel the wait state. the master device can also cancel the wait state via either of the following methods. ? by setting the iiccn.sttn bit to 1 ? by setting the iiccn.sptn bit to 1
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 963 19.6.7 wait state cancellation method in the case of i 2 c0n, wait state can be canceled normally in the following ways. ? by writing data to the iicn register ? by setting the iiccn.wreln bit to 1 (wait state cancellation) ? by setting the iiccn.sttn bit to 1 (start condition generation) note ? by setting the iiccn.sptn bit to 1 (stop condition generation) note note master only if any of these wait state canc ellation actions is performed, i 2 c0n will cancel wait state and restart communication. when canceling wait state and s ending data (including address), writ e data to the iicn register. to receive data after canceling wait state, or to complete data transmission, set the wreln bit to 1. to generate a restart condition after canceli ng wait state, set the sttn bit to 1. to generate a stop condition after canceling wait state, set the sptn bit to 1. execute cancellation only once for each wait state. for example, if data is written to t he iicn register following wait state canc ellation by setting the wreln bit to 1, conflict between the sdan line change timing and iicn register write timing may resu lt in the data output to the sdan line may be incorrect. even in other operations, if communication is stopped halfway, clearing the iiccn.iicen bit to 0 will stop communication, enabling wait state to be cancelled. if the i 2 c bus dead-locks due to noise, etc., setting the iiccn.lre ln bit to 1 causes the communication operation to be exited, enabling wait st ate to be cancelled. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 964 19.7 i 2 c interrupt request signals (intiicn) the following shows the value of the iic sn register at the intiicn interr upt request signal generation timing and at the intiicn signal timing. remarks 1. st: start condition ad6 to ad0: address r/w: transfer direction specification ack: acknowledge d7 to d0: data sp: stop condition 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 965 19.7.1 master device operation (1) start ~ address ~ data ~ data ~ stop (normal transmission/reception) <1> when iiccn.wtimn bit = 0 iiccn.sptn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 s 4 5 s 1: iicsn register = 1000x110b s 2: iicsn register = 1000x000b s 3: iicsn register = 1000x000b (wtimn bit = 1 note ) s 4: iicsn register = 1000xx00b 5: iicsn register = 00000001b note set the wtimn bit (1) and change the timing of generating the inte rrupt request signal (intiicn) to generate the stop condition. remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 sptn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 4 s 1: iicsn register = 1000x110b s 2: iicsn register = 1000x100b s 3: iicsn register = 1000xx00b 4: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 966 (2) start ~ address ~ data ~ star t ~ address ~ data ~ stop (restart) <1> when wtimn bit = 0 sttn bit = 1 sptn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 s 4 s 5 s 6 7 s 1: iicsn register = 1000x110b s 2: iicsn register = 1000x000b (wtimn bit = 1 note 1 ) s 3: iicsn register = 1000xx00b (wtimn bit = 0 note 2 ) s 4: iicsn register = 1000x110b s 5: iicsn register = 1000x000b (wtimn bit = 1 note 3 ) s 6: iicsn register = 1000xx00b 7: iicsn register = 00000001b notes 1. set the wtimn bit (1) and change the timing of generating the interrupt request signal (intiicn) to generate the start condition. 2. clear the wtimn bit (0) to restore the original setting. 3. set the wtimn bit (1) and change the timing of generating the interrupt request signal (intiicn) to generate the stop condition. remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 sttn bit = 1 sptn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 s 4 5 s 1: iicsn register = 1000x110b s 2: iicsn register = 1000xx00b s 3: iicsn register = 1000x110b s 4: iicsn register = 1000xx00b 5: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 967 (3) start ~ code ~ data ~ data ~ stop (extension code transmission) <1> when wtimn bit = 0 sptn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 s 4 5 s 1: iicsn register = 1010x110b s 2: iicsn register = 1010x000b s 3: iicsn register = 1010x000b (wtimn bit = 1 note ) s 4: iicsn register = 1010xx00b 5: iicsn register = 00000001b note set the wtimn bit (1) and change the timing of generating the inte rrupt request signal (intiicn) to generate the stop condition. remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 sptn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 4 s 1: iicsn register = 1010x110b s 2: iicsn register = 1010x100b s 3: iicsn register = 1010xx00b 4: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 968 19.7.2 slave device operation (when r eceiving slave address (address match)) (1) start ~ address ~ data ~ data ~ stop <1> when iiccn.wtimn bit = 0 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 4 s 1: iicsn register = 0001x110b s 2: iicsn register = 0001x000b s 3: iicsn register = 0001x000b 4: iicsn register = 00000001b remarks 1. s : always generated : generated only when iiccn.spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 4 s 1: iicsn register = 0001x110b s 2: iicsn register = 0001x100b s 3: iicsn register = 0001xx00b 4: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 969 (2) start ~ address ~ data ~ start ~ address ~ data ~ stop <1> when wtimn bit = 0 (after restart, address match) st ad6 to ad0 r/w ack d7 to d0 ack st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 s 4 5 s 1: iicsn register = 0001x110b s 2: iicsn register = 0001x000b s 3: iicsn register = 0001x110b s 4: iicsn register = 0001x000b 5: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 (after restart, address match) st ad6 to ad0 r/w ack d7 to d0 ack st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 s 4 5 s 1: iicsn register = 0001x110b s 2: iicsn register = 0001xx00b s 3: iicsn register = 0001x110b s 4: iicsn register = 0001xx00b 5: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 970 (3) start ~ address ~ data ~ start ~ code ~ data ~ stop <1> when wtimn bit = 0 (after restart, a ddress mismatch (extension code reception)) st ad6 to ad0 r/w ack d7 to d0 ack st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 s 4 5 s 1: iicsn register = 0001x110b s 2: iicsn register = 0001x000b s 3: iicsn register = 0010x010b s 4: iicsn register = 0010x000b 5: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 (after restart, a ddress mismatch (extension code reception)) st ad6 to ad0 r/w ack d7 to d0 ack st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 s 4 s 5 6 s 1: iicsn register = 0001x110b s 2: iicsn register = 0001xx00b s 3: iicsn register = 0010x010b s 4: iicsn register = 0010x110b s 5: iicsn register = 0010xx00b 6: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 971 (4) start ~ address ~ data ~ start ~ address ~ data ~ stop <1> when wtimn bit = 0 (after restart, address mismatch (= not extension code)) st ad6 to ad0 r/w ack d7 to d0 ack st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 4 s 1: iicsn register = 0001x110b s 2: iicsn register = 0001x000b s 3: iicsn register = 00000110b 4: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 (after restart, address mismatch (= not extension code)) st ad6 to ad0 r/w ack d7 to d0 ack st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 4 s 1: iicsn register = 0001x110b s 2: iicsn register = 0001xx00b s 3: iicsn register = 00000110b 4: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 972 19.7.3 slave device operation (w hen receiving extension code) always under communication when re ceiving the extension code. (1) start ~ code ~ data ~ data ~ stop <1> when iiccn.wtimn bit = 0 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 4 s 1: iicsn register = 0010x010b s 2: iicsn register = 0010x000b s 3: iicsn register = 0010x000b 4: iicsn register = 00000001b remarks 1. s : always generated : generated only when iiccn.spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 s 4 5 s 1: iicsn register = 0010x010b s 2: iicsn register = 0010x110b s 3: iicsn register = 0010x100b s 4: iicsn register = 0010xx00b 5: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 973 (2) start ~ code ~ data ~ st art ~ address ~ data ~ stop <1> when wtimn bit = 0 (after restart, address match) st ad6 to ad0 r/w ack d7 to d0 ack st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 s 4 5 s 1: iicsn register = 0010x010b s 2: iicsn register = 0010x000b s 3: iicsn register = 0001x110b s 4: iicsn register = 0001x000b 5: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 (after restart, address match) st ad6 to ad0 r/w ack d7 to d0 ack st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 s 4 s 5 6 s 1: iicsn register = 0010x010b s 2: iicsn register = 0010x110b s 3: iicsn register = 0010xx00b s 4: iicsn register = 0001x110b s 5: iicsn register = 0001xx00b 6: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 974 (3) start ~ code ~ data ~ st art ~ code ~ data ~ stop <1> when wtimn bit = 0 (after restart, extension code reception) st ad6 to ad0 r/w ack d7 to d0 ack st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 s 4 5 s 1: iicsn register = 0010x010b s 2: iicsn register = 0010x000b s 3: iicsn register = 0010x010b s 4: iicsn register = 0010x000b 5: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 (after restart, extension code reception) st ad6 to ad0 r/w ack d7 to d0 ack st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 s 4 s 5 s 6 7 s 1: iicsn register = 0010x010b s 2: iicsn register = 0010x110b s 3: iicsn register = 0010xx00b s 4: iicsn register = 0010x010b s 5: iicsn register = 0010x110b s 6: iicsn register = 0010xx00b 7: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 975 (4) start ~ code ~ data ~ st art ~ address ~ data ~ stop <1> when wtimn bit = 0 (after restart, address mismatch (= not extension code)) st ad6 to ad0 r/w ack d7 to d0 ack st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 4 s 1: iicsn register = 0010x010b s 2: iicsn register = 0010x000b s 3: iicsn register = 00000110b 4: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 (after restart, address mismatch (= not extension code)) st ad6 to ad0 r/w ack d7 to d0 ack st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 s 4 5 s 1: iicsn register = 0010x010b s 2: iicsn register = 0010x110b s 3: iicsn register = 0010xx00b s 4: iicsn register = 00000110b 5: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 976 19.7.4 operation without communication (1) start ~ code ~ data ~ data ~ stop st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp 1 1: iicsn register = 00000001b remarks 1. : generated only when spien bit = 1 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 977 19.7.5 arbitration loss operation (opera tion as slave after arbitration loss) when the device is used as t he master in a multi-master system, read the iicsn.mstsn bit to check the arbitration result each time the intiic n interrupt has been generated. (1) when arbitration loss occurs duri ng transmission of slave address data <1> when iiccn.wtimn bit = 0 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 4 s 1: iicsn register = 0101x110b s 2: iicsn register = 0001x000b s 3: iicsn register = 0001x000b 4: iicsn register = 00000001b remarks 1. s : always generated : generated only when iiccn.spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 4 s 1: iicsn register = 0101x110b s 2: iicsn register = 0001x100b s 3: iicsn register = 0001xx00b 4: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 978 (2) when arbitration loss occurs dur ing transmission of extension code <1> when wtimn bit = 0 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 4 s 1: iicsn register = 0110x010b s 2: iicsn register = 0010x000b s 3: iicsn register = 0010x000b 4: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 s 4 5 s 1: iicsn register = 0110x010b s 2: iicsn register = 0010x110b s 3: iicsn register = 0010x100b s 4: iicsn register = 0010xx00b 5: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 979 19.7.6 operation when arbitrat ion loss occurs (no communicat ion after arbitration loss) when the device is used as t he master in a multi-master system, read the iicsn.mstsn bit to check the arbitration result each time the intiic n interrupt has been generated. (1) when arbitration loss occurs dur ing transmission of slave address data st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 2 s 1: iicsn register = 01000110b 2: iicsn register = 00000001b remarks 1. s : always generated : generated only when iiccn.spien bit = 1 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 (2) when arbitration loss occurs during transmission of extension code st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 2 s 1: iicsn register = 0110x010b iiccn.lreln bit is set to 1 by software 2: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 980 (3) when arbitration loss o ccurs during data transfer <1> when iiccn.wtimn bit = 0 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 3 s 1: iicsn register = 10001110b s 2: iicsn register = 01000000b 3: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 3 s 1: iicsn register = 10001110b s 2: iicsn register = 01000100b 3: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 981 (4) when arbitration loss occurs due to restart condition duri ng data transfer <1> not extension code (example: address mismatch) st ad6 to ad0 r/w ack d7 to dn st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 3 s 1: iicsn register = 1000x110b s 2: iicsn register = 01000110b 3: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care dn = d6 to d0 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> extension code st ad6 to ad0 r/w ack d7 to dn st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 3 s 1: iicsn register = 1000x110b s 2: iicsn register = 0110x010b iiccn.lreln bit is set to 1 by software 3: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care dn = d6 to d0 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 982 (5) when arbitration loss occurs due to stop condition during data transfer st ad6 to ad0 r/w ack d7 to dn sp s 1 2 s 1: iicsn register = 1000x110b 2: iicsn register = 01000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care dn = d6 to d0 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 983 (6) when arbitration loss occurs due to low level of sda0n pin when attempting to generate a restart condition <1> when wtimn bit = 0 iiccn.sttn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 s 4 5 s 1: iicsn register = 1000x110b s 2: iicsn register = 1000x000b (wtimn bit = 1) s 3: iicsn register = 1000x100b (wtimn bit = 0) s 4: iicsn register = 01000000b 5: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 iiccn.sttn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 4 s 1: iicsn register = 1000x110b s 2: iicsn register = 1000x100b s 3: iicsn register = 01000100b 4: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 984 (7) when arbitration loss occurs due to a stop conditi on when attempting to gene rate a restart condition <1> when wtimn bit = 0 sttn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 s 3 4 s 1: iicsn register = 1000x110b s 2: iicsn register = 1000x000b (wtimn bit = 1) s 3: iicsn register = 1000xx00b 4: iicsn register = 01000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 sttn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack sp s 1 s 2 3 s 1: iicsn register = 1000x110b s 2: iicsn register = 1000xx00b 3: iicsn register = 01000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 985 (8) when arbitration loss occurs due to low level of sda0n pin wh en attempting to generate a stop condition <1> when wtimn bit = 0 iiccn.sptn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 s 4 5 s 1: iicsn register = 1000x110b s 2: iicsn register = 1000x000b (wtimn bit = 1) s 3: iicsn register = 1000x100b (wtimn bit = 0) s 4: iicsn register = 01000100b 5: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 <2> when wtimn bit = 1 iiccn.sptn bit = 1 st ad6 to ad0 r/w ack d7 to d0 ack d7 to d0 ack d7 to d0 ack sp s 1 s 2 s 3 4 s 1: iicsn register = 1000x110b s 2: iicsn register = 1000x100b s 3: iicsn register = 01000100b 4: iicsn register = 00000001b remarks 1. s : always generated : generated only when spien bit = 1 x: don?t care 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 986 19.8 interrupt request signal (intiicn) generation timing and wait control the setting of the iiccn.wtimn bit determines the timi ng by which the intiicn r egister is generated and the corresponding wait control, as shown below. table 19-6. intiicn genera tion timing and wait control during slave device operation du ring master device operation wtimn bit address data reception data transmission address data reception data transmission 0 9 notes 1, 2 8 note 2 8 note 2 9 8 8 1 9 notes 1, 2 9 note 2 9 note 2 9 9 9 notes 1. the slave device?s intiicn signal and wait period o ccur at the falling edge of the ninth clock only when there is a match with the addre ss set to the svan register. at this point, ack is generated regardless of the va lue set to the iiccn.acken bit. for a slave device that has received an extension code, the intiicn signal occurs at t he falling edge of the eighth clock. when the address does not match after restart, the intiicn signal is generated at the falling edge of the ninth clock, but no wait occurs. 2. if the received address does not ma tch the contents of the svan regi ster and an extension code is not received, neither the intiicn signal nor a wait state is generated. remarks 1. the numbers in the table indicate the number of the serial clock?s clock signals. interrupt requests and wait control are both synchronized wit h the falling edge of these clock signals. 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 (1) during address transmission/reception ? slave device operation: interrupt and wait timi ng are determined depending on the conditions in notes 1 and 2 above regardless of the wtimn bit. ? master device operation: interrupt and wait timing occur at the falling edge of the ninth clock regardless of the wtimn bit. (2) during data reception ? master/slave device operation: interrupt and wait timing is determined according to the wtimn bit. (3) during data transmission ? master/slave device operation: interrupt and wait timing is determined according to the wtimn bit.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 987 (4) wait state cancellation method the four wait state cancella tion methods are as follows. ? by writing data to the iicn register ? by setting the iiccn.wreln bit to 1 (wait cancellation) ? by setting the iiccn.sttn bit to 1 (start condition generation) note ? by setting the iiccn.sptn bi t to 1 (stop condition generation) note note master only when an 8-clock wait has been selected (wtimn bit = 0), whether or not ac k has been generated must be determined prior to wait cancellation. (5) stop condition detection the intiicn signal is generated w hen a stop condition is detected. 19.9 address match detection method in i 2 c bus mode, the master dev ice can select a particular slave devic e by transmitting the corresponding slave address. address match detection is performed aut omatically by hardware. the int iicn signal occurs when a local address has been set to the svan register and when the address set to the svan register matches the slave address sent by the master device, or when an extension code has been received. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 19.10 error detection in i 2 c bus mode, the status of the serial data bus pin (sda0n) during data transmission is captured by the iicn register of the transmitting device, so the data of the iicn regi ster prior to transmissi on can be compared with the transmitted iicn data to enable detection of transmission erro rs. a transmission error is judged as having occurred when the compared data values do not match. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 988 19.11 extension code remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 (1) when the higher 4 bits of the receive address are either 0000 or 1111, the ext ension code flag (iicsn.excn bit) is set for extension code reception and an interrupt request signal (intiicn) is issued at the falling edge of the eighth clock. the local address stored in the svan register is not affected. (2) if 11110xx0 is set to the svan register by a 10- bit address transfer and 11110xx0 is transferred from the master device, the results are as fo llows. note that the intiicn signal occurs at the falling edge of the eighth clock. ? higher four bits of data match: excn bit = 1 ? seven bits of data match: iicsn.coin bit = 1 (3) since the processing after the interrupt request signal occurs differs according to the data that follows the extension code, such processi ng is performed by software. the device participates in communication when it receives the extension code while it is operating as a slave, even if the address does not match. for example, when operation as a sl ave is not desired after the ext ension code is received, set the iiccn.lreln bit to 1 and the cpu will enter the next communication wait state. table 19-7. extension code bit definitions slave address r/w bit description 0000 000 0 general call address 1111 0xx 0 10-bit slave address spec ification (upon address authentication) 1111 0xx 1 10-bit slave address specificat ion (upon read command issuance after address matches) remark for the extension codes other than above, see the i 2 c bus specifications issued by nxp semiconductors.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 989 19.12 arbitration when several master devices simultaneous ly generate a start condition (when the iiccn.sttn bit is set to 1 before the iicsn.stdn bit is set to 1), communication between the ma ster devices is performed wh ile the number of clocks is adjusted until the data differs. this ki nd of operation is called arbitration. when one of the master devices loses in arbitration, an arbitration loss flag ( iicsn.aldn bit) is set to 1 via the timing by which the arbitration loss occurred, and the scl0n and sda0n lines are both set to high impedance, which releases the bus. arbitration loss is detected based on t he timing of the next interrupt request signal (intiicn) (the eighth or ninth clock, when a stop condition is detected, etc.) and the setting of the aldn bit to 1, which is made by software. for details of interrupt request timing, see 19.7 i 2 c interrupt request signals (intiicn) . figure 19-11. arbitration timing example master 1 master 2 transfer lines scl0n sda0n scl0n sda0n scl0n sda0n master 1 loses arbitration hi-z hi-z remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 990 table 19-8. status during arbitration a nd interrupt request si gnal generation timing status during arbitration inte rrupt request generation timing transmitting address transmission read/write data after address transmission transmitting extension code read/write data after extension code transmission transmitting data ack transfer period after data reception when restart condition is det ected during data transfer at falling edge of eighth or ninth clock following byte transfer note 1 when stop condition is detected duri ng data transfer when stop condition is generated (when iiccn.spien bit = 1) note 2 when sda0n pin is low level while attempting to generate restart condition at falling edge of eighth or ninth clock following byte transfer note 1 when stop condition is detected while attempting to generate restart condition when stop condition is generated (when iiccn.spien bit = 1) note 2 when sda0n pin is low level while attempting to generate stop condition when scl0n pin is low level while attempting to generate restart condition at falling edge of eighth or ninth clock following byte transfer note 1 notes 1. when the iiccn.wtimn bit = 1, an intiicn signal o ccurs at the falling edge of the ninth clock. when the wtimn bit = 0 and the extension code?s slave address is received, an intiicn signal occurs at the falling edge of the eighth clock. 2. when there is a possibility that ar bitration will occur, set the spien bi t to 1 for master device operation. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 19.13 wakeup function the i 2 c bus slave function is a function that generates an interrupt request si gnal (intiicn) when a local address and extension code have been received. this function makes processing more efficient by prev enting unnecessary the intiicn signal from occurring when addresses do not match. when a start condition is detected, wa keup standby mode is set. this wak eup standby mode is in effect while addresses are transmitted due to the possi bility that an arbitration loss may change the master device (which has generated a start condition) to a slave device. however, when a stop condition is detect ed, the iiccn.spien bit is set regardl ess of the wakeup function, and this determines whether intiicn signal is enabled or disabled. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 991 19.14 communication reservation 19.14.1 when communication reservation functi on is enabled (iicfn.iicrsvn bit = 0) to start master device communications when not current ly using the bus, a communication reservation can be made to enable transmission of a start condition when the bus is released. there are two modes in which the bus is not used. ? when arbitration results in neit her master nor slave operation ? when an extension code is received and slave operation is disabled (ack is not returned and the bus was released when the iiccn.lreln bit was set to 1). if the iiccn.sttn bit is set to 1 while the bus is not used, a start condition is aut omatically generated and a wait state is set after the bus is releas ed (after a stop condition is detected). the device automatically starts comm unication as the master when an address is written to the iicn register after the iiccn.spien bit has been set (1) and release of t he bus has been detected (i.e., the stop condition has been detected) by generation of an in terrupt request (intiicn). data written to the iicn register is invalid before the stop condition is detected. when the sttn bit has been set to 1, the operation mode (a s start condition or as communication reservation) is determined according to the bus status. if the bus has been re leased ............................................. a start condition is generated if the bus has not been released (standby mode) ............. comm unication reservation to detect which operation mode has been det ermined for the sttn bit, set the sttn bit to 1, wait for the wait period, then check the iicsn.mstsn bit. the wait periods, which should be set via software, are list ed in table 19-9. these wait periods can be set by the smcn, cln1, and cln0 bits of the ii ccln register and the iicxn.clxn bit.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 992 table 19-9. wait periods clxn bit smcn bit cln1 bit cln0 bit ocksm register wait time 0 0 0 0 18h 23 clocks 0 0 0 0 10h 46 clocks 0 0 0 0 11h 69 clocks 0 0 0 0 12h 92 clocks 0 0 0 0 13h 115 clocks 0 0 0 1 18h 43 clocks 0 0 0 1 10h 86 clocks 0 0 0 1 11h 129 clocks 0 0 0 1 12h 172 clocks 0 0 0 1 13h 215 clocks 0 0 1 0 00h 43 clocks 0 0 1 1 18h 34 clocks note 0 0 1 1 10h 68 clocks note 0 0 1 1 11h 102 clocks note 0 0 1 1 12h 136 clocks note 0 0 1 1 13h 170 clocks note 0 1 0 18h 15 clocks 0 1 0 10h 30 clocks 0 1 0 11h 45 clocks 0 1 0 12h 60 clocks 0 1 0 13h 75 clocks 0 1 1 0 00h 15 clocks 0 1 1 1 18h 12 clocks note 0 1 1 1 10h 24 clocks note 0 1 1 1 11h 36 clocks note 0 1 1 1 12h 48 clocks note 0 1 1 1 13h 60 clocks note 1 1 0 18h 9 clocks 1 1 0 10h 18 clocks 1 1 0 11h 27 clocks 1 1 0 12h 36 clocks 1 1 0 13h 45 clocks 1 1 1 0 00h 9 clocks note settings are prohibited for i 2 c04 and i 2 c05. remarks 1. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3, m = 0, 1 other than pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5, m = 0, 1, 3 2. = don?t care 3. clock = f cpu (cpu clock frequency) the communication reservation timing is shown below.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 993 figure 19-12. communication reservation timing 2 1 3456 2 13456 789 scl0n sda0n program processing hardware processing write to iicn set spdn and intiicn sttn =1 communication reservation set stdn generated by master with bus access remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 iicn: iiccn shift register n sttn: bit of iiccn register stdn: bit of iicsn register spdn: bit of iicsn register communication reservations are accepted via the following timing. after the iicsn.stdn bit is set to 1, a communication reservation can be made by setting the iiccn.s ttn bit to 1 before a stop condition is detected (n = 0 to 5). figure 19-13. timing for accep ting communication reservations scl0n sda0n stdn spdn standby mode remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 994 the communication reservation flowchart is illustrated below. figure 19-14. communication reservation flowchart di set1 sttn define communication reservation wait cancel communication reservation no yes iicn register xxh ei mstsn bit = 0? (communication reservation) note (generate start condition) sets sttn bit (communication reservation). secures wait period set by software (see table 19-9 ). confirmation of communication reservation clears user flag. iicn register write operation defines that communication reservation is in effect (defines and sets user flag to any part of ram). note the communication reservation operation execut es a write to the iic n register when a stop condition interrupt request occurs. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 995 19.14.2 when communication reservation functi on is disabled (iicfn.iicrsvn bit = 1) when the iiccn.sttn bit is set when the bus is not us ed in a communication during bus communication, this request is rejected and a start condition is not generated. there are two modes in wh ich the bus is not used. ? when arbitration results in nei ther master nor slave operation ? when an extension code is received and slave operation is disabled (ack is not returned and the bus was released when the iiccn.lreln bit was set to 1). to confirm whether the start conditi on was generated or request was rejected, check the iicfn.stcfn flag. the time shown in table 19-10 is required until the stcfn flag is set after setting the sttn bit to 1. therefore, secure the time by software. table 19-10. wait periods cln1 bit cln0 bit ocksm register wait time 0 18h 5 clocks 0 10h 10 clocks 0 11h 15 clocks 0 12h 20 clocks 0 13h 25 clocks 1 0 00h 5 clocks 1 1 18h 5 clocks note 1 1 10h 10 clocks note 1 1 11h 15 clocks note 1 1 12h 20 clocks note 1 1 13h 25 clocks note note settings are prohibited for i 2 c04 and i 2 c05. remarks 1. only pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3, m = 0, 1 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5, m = 0, 1, 3 2. = don?t care 3. clock = f cpu (cpu clock frequency)
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 996 19.15 cautions remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 (1) when iicfn.stcenn bit = 0 immediately after the i 2 c0n operation is enabled, the bus communica tion status (iicfn.iicbsyn bit = 1) is recognized regardless of the actual bus status. to execute master comm unication in the status where a stop condition has not been detect ed, generate a stop condition and then releas e the bus before st arting the master communication. use the following sequence for generating a stop condition. <1> set the iiccln register. <2> set the iiccn.iicen bit. <3> set the iiccn.sptn bit. (2) when iicfn.stcenn bit = 1 immediately after i 2 c0n operation is enabled, the bus released st atus (iicbsyn bit = 0) is recognized regardless of the actual bus status. to generate the first start condition (iiccn.sttn bit = 1), it is necessary to confirm that the bus has been released, so as to not disturb other communications. (3) while communications with other devices are in progress when the iiccn.iicen bit of the v850e/sj3-h or v850e /sk3-h is set to 1 while communications with other devices are in progress, the start condition may be detected depending on the st atus of the communication line. be sure to set the iiccn.iic en bit to 1 when the scl0n and sda0n lines are high level. (4) setting the operation clock frequency determine the operation clock frequency by the iicc ln, iicxn, and ocksm registers before enabling the operation (iiccn.iicen bit = 1). to change the operation clock frequency, clear the iiccn.iicen bit to 0 once. (5) caution on iiccn register setting after the iiccn.sttn and iiccn.sptn bits have been set to 1, they must not be re -set without being cleared to 0 first. (6) transmission reservation if transmission has been reserved, set the iiccn.spien bit to 1 so that an interrupt request is generated by the detection of a stop condition. after an interrupt r equest has been generated, the wait state will be released by writing communication data to i 2 cn, then transferring will begin. if an inte rrupt is not generat ed by the detection of a stop condition, transmission will hal t in the wait state because an in terrupt request was not generated. however, it is not necessary to set the spien bit to 1 for the software to detect the iicsn.mstsn bit.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 997 (7) switching dma transfer start factor (a) switching dma transfer start factor between intua1r and intiic2 signals setting the dma transfer start factor to other than the following combinat ions is prohibited. <1> when using uarta1 and i 2 c02 simultaneously, and the int ua1r signal is specified as the dma transfer start factor (v850e/sk3-h only) when the dtfrn.ifcn5 to ifcn0 bits = 28h, se t the dtfrob1 bit of the option byte (0000007ah) (see chapter 33 option byte function ) to 1. this disables the dma transfer start factor for the intiic2 signal. therefore, a dma transfer starts only when the intua1r signal is generated. even if the intiic2 signal is gener ated, dma transfer does not start. <2> when not using uarta1 and using only i 2 c02, and the intiic2 si gnal is specified as the dma transfer start factor when the dtfrn.ifcn5 to ifcn0 bits = 28h, se t the dtfrob1 bit of the option byte (0000007ah) to 0. a dma transfer starts only when t he intua1r or intiic2 signal is generated. <3> when not using i 2 c02 and using only uarta1, and the in tua1r signal is specified as the dma transfer start factor when the dtfrn.ifcn5 to ifcn0 bits = 28h, se t the dtfrob1 bit of the option byte (0000007ah) to 0. a dma transfer starts only when t he intua1r or intiic2 signal is generated. remark for details, see table 22-1 dma transfer start factors . (b) switching dma transfer start factor between intua2r and intiic0 signals setting the dma transfer start factor to other than the following combinat ions is prohibited. <1> when using uarta2 and i 2 c00 simultaneously, and the int ua2r signal is specified as the dma transfer start factor (v850e/sk3-h only) when the dtfrn.ifcn5 to ifcn0 bits = 2ah, se t the dtfrob1 bit of the option byte (0000007ah) (see chapter 33 option byte function ) to 1. this disables the dma transfer start factor for the intiic0 signal. therefore, a dma transfer starts only when the intua2r signal is generated. even if the intiic0 signal is gener ated, dma transfer does not start. <2> when not using uarta2 and using only i 2 c00, and the intiic0 si gnal is specified as the dma transfer start factor when the dtfrn.ifcn5 to ifcn0 bits = 2ah, se t the dtfrob1 bit of the option byte (0000007ah) to 0. a dma transfer starts only when t he intua2r or intiic0 signal is generated. <3> when not using i 2 c00 and using only uarta2, and the in tua2r signal is specified as the dma transfer start factor when the dtfrn.ifcn5 to ifcn0 bits = 2ah, se t the dtfrob1 bit of the option byte (0000007ah) to 0. a dma transfer starts only when t he intua2r or intiic0 signal is generated. remark for details, see table 22-1 dma transfer start factors .
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 998 19.16 communication operations the following shows three operati on procedures with the flowchart. (1) master operation in single master system the flowchart when using the v850e/sj3-h or v850e/sk3-h as the master in a single master system is shown below. this flowchart is broadly divided into the initial setti ngs and communication processi ng. execute the initial settings at startup. if communica tion with the slave is required, pr epare the communication and then execute communication processing. (2) master operation in multimaster system in the i 2 c0n bus multimaster system, whether the bus is released or used cannot be judged by the i 2 c bus specifications when the bus takes part in a communicati on. here, when data and clock are at a high level for a certain period (1 frame), the v850e/sj3-h or v850e/ sk3-h takes part in a communication with bus released state. this flowchart is broadly divided into the initial setti ngs, communication waiting, and communication processing. the processing when the v850e/sj3-h or v850e/sk3-h looses in arbitrati on and is specified as the slave is omitted here, and only the processing as the master is shown. execute the initial settings at startup to take part in a communication. then, wait for the communicati on request as the master or wait for the specification as the slave. the actual communi cation is performed in the communica tion processing, and it supports the transmission/reception with the slave and the arbitration wit h other masters. (3) slave operation an example of when the v850e/sj3-h or v 850e/sk3-h is used as the slave of the i 2 c0n bus is shown below. when used as the slave, operation is st arted by an interrupt. execute the in itial settings at st artup, then wait for the intiicn interrupt occurrence (communication waiting). when the intiicn interrupt occurs, the communication status is judged and its result is pa ssed as a flag over to the main processing. by checking the flags, necessary communication processing is performed. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 999 19.16.1 master operation in single master system figure 19-15. master operati on in single master system iicxn 0xh iiccln xxh iicfn 0xh set stcenn, iicrsvn = 0 iiccn xxh acken = wtimn = spien = 1 iicen = 1 sptn = 1 svan xxh iicn write iicn write sptn = 1 wreln = 1 start end acken = 0 wtimn = wreln = 1 no no yes no no no yes yes yes yes stcenn = 1? acken = 1 wtimn = 0 trcn = 1? ackdn = 1? ackdn = 1? no yes no yes yes no intiicn interrupt occurred? yes no intiicn interrupt occurred? yes no yes no yes no sttn = 1 set ports initialize i 2 c bus note iic read intiic interrupt occurred? transfer completed? transfer completed? restarted? ackd bit = 1? see table 4-25 using port pin as alternate-function pin to set the i 2 c mode before this function is used. transfer clock selection local address setting start condition setting communication start preparation (start condition generation) communication start (address, transfer direction specification) waiting for ack detection waiting for data transmission transmission start communication processing initial settings reception start waiting for data reception intiic interrupt occurred? waiting for ack detection communication start preparation (stop condition generation) waiting for stop condition detection intiic interrupt occurred? note release the i 2 c0n bus (scl0n, sda0n pins = high level) in conformity with the s pecifications of the product in communication. for example, when the eeprom tm outputs a low level to the sda0n pi n, set the scl0n pin to the output port and output clock pulses from t hat output port until when the sda0n pin is constantly high level. remarks 1. for the transmission and reception formats, confo rm to the specificati ons of the product in communication. 2. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 1000 19.16.2 master operation in multimaster system figure 19-16. master operation in multimaster system (1/3) iicxn 0xh iiccln xxh iicfn 0xh set stcenn, set iicrsvn bit iiccn xxh acken = wtimn = spien = 1 iicen = 1 sptn = 1 svan xxh spien = 1 start yes spdn = 1? stcenn = 1? iicrsvn = 0? a no yes yes no intiicn interrupt occurred? intiicn interrupt occurred? yes no yes no spdn = 1? yes no no intiicn interrupt occurred? yes no 1 b spien = 0 yes no set ports slave operation slave operation bus release status for a certain period confirmation of bus status is in progress confirm bus status note master operation started? communication reservation enable communication reservation disable see table 4-25 using port pin as alternate-function pin to set the i 2 c mode before this function is used. transfer clock selection local address setting start condition setting (communication start request issued) (no communication start request) ? waiting for slave specification from another master ? waiting for communication start request (depending on user program) communication start preparation (stop condition generation) waiting for stop condition detection slave operation waiting for communication request communication waiting initial settings note confirm that the bus release stat us (iiccln.cldn bit = 1, iiccln.da dn bit = 1) has been maintained for a certain period (1 frame, for example). when the sd a0n pin is constantly lo w level, determine whether to release the i 2 c0n bus (scl0n, sda0n pins = high level) by referring to the spec ifications of the product in communication. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 1001 figure 19-16. master operation in multimaster system (2/3) sttn = 1 yes mstsn = 1? excn = 1 or coin =1? no intiicn interrupt occurred? yes yes no no a c sttn = 1 yes iicbsyn = 0? excn = 1 or coin =1? no no intiicn interrupt occurred? yes yes no yes stcfn = 0? no b d c d wait slave operation communication start preparation (start condition generation) securing wait time by software (see table 19-9 ) waiting for bus release (communication reserved) wait status after stop condition detection and start condition generation by communication reservation function wait slave operation communication start preparation (start condition generation) communication reservation disabled communication reservation enabled securing wait time by software (see table 19-10 ) waiting for bus release stop condition detection communication processing communication processing remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 1002 figure 19-16. master operation in multimaster system (3/3) iicn write wtimn = 1 wreln = 1 iicn read acken = 1 wtimn = 0 wtimn = wreln = 1 acken = 0 iicn write yes trcn = 1? mstsn = 1? no yes yes no intiicn interrupt occurred? yes no yes no intiicn interrupt occurred? yes no intiicn interrupt occurred? no yes ackdn = 1? no yes no c 2 yes mstsn = 1? no yes no yes ackdn = 1? no 2 yes mstsn = 1? no 2 yes no intiicn interrupt occurred? yes mstsn = 1? no c 2 yes excn = 1 or coin = 1? no 1 2 sptn = 1 sttn = 1 end restarted? communication start (address, transfer direction specification) transmission start waiting for data transmission reception start transfer completed? waiting for ack detection waiting for data transmission not in communication transfer completed? waiting for ack detection slave operation communication processing communication processing remarks 1. conform the transmission and reception formats to t he specifications of t he product in communication. 2. when using the v850e/sj3-h or v850e/sk3-h as the master in the mult imaster system, read the iicsn.mstsn bit for each intiicn interrupt o ccurrence to confirm the arbitration result. 3. when using the v850e/sj3-h or v850e/sk3-h as t he slave in the multimaster system, confirm the status using the iicsn and iicfn registers for eac h intiicn interrupt occurrence to determine the next processing. 4. only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/s j3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 1003 19.16.3 slave operation the following shows the processing procedure of the slave operation. basically, the operation of the slave device is event-dri ven. therefore, processing by an intiicn interrupt (processing requiring a significant change of the operat ion status, such as stop condition detection during communication) is necessary. the following description assumes that data communication does not support extension codes. also, it is assumed that the intiicn interrupt servicing performs only status change processing and t hat the actual data communication is performed during the main processing. figure 19-17. software out line during slave operation i 2 c intiicn signal setting, etc. setting, etc. flag data main processing interrupt servicing therefore, the following three flags are prepared so that the data trans fer processing can be performed by transmitting these flags to the main processing instead of intiicn signal. (1) communication mode flag this flag indicates the following communication statuses. clear mode: data communication not in progress communication mode: data communication in progress (valid address detection stop condition detection, ack from master not detected, address mismatch) (2) ready flag this flag indicates that data communication is enabled. th is is the same status as an intiicn interrupt during normal data transfer. this flag is set in the interrupt servicing block and cleared in the main processing block. the ready flag for the first data for transmission is not set in the interrupt servicing bl ock, so the first data is transmitted without clear processing (the address ma tch is regarded as a request for the next data). (3) communication direction flag this flag indicates the direction of communication and is the same as the value of iicsn.trcn bit.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 1004 the following shows the operation of the main processing block during slave operation. start i 2 c0n and wait for the communication enabled status. when communication is enabled, perform transfer using the communication mode flag and ready flag (the pr ocessing of the stop condition and start condition is performed by interrupts, conditions are confirmed by flags). for transmission, repeat the transmission operation until the master device stops returning ack. when the master device stops returning ack , transfer is complete. for reception, receive the required number of data and do not return ack for the next data immediately after transfer is complete. after that, the master device generates the stop condition or restart c ondition. this causes exit from communications.
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 1005 figure 19-18. slave operation flowchart (1) yes yes yes yes yes yes yes no no no no no no iicn read wreln = 1 ackdn = 1? clear communication mode flag wreln = 1 iicn write iiccn xxh acken = wtimn = 1 spien = 0, iicen = 1 svan xxh iicxn 0xh iiccln xxh iicfn 0xh set iicrsvn no yes no yes no start communication mode flag = 1? communication mode flag = 1? communication direction flag = 1? ready flag = 1? communication direction flag = 0? clear ready flag clear ready flag communication direction flag = 1? local address setting set ports transfer clock selection start condition setting transmission start reception start communication mode flag = 1? ready flag = 1? see table 4-25 using port pin as alternate-function pin to set the i 2 c mode before this function is used. initial settings communication processing remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 1006 the following shows an example of the proc essing of the slave device by an int iicn interrupt (it is assumed that no extension codes are used here). during an intiicn interr upt, the status is confirm ed and the following steps are executed. <1> when a stop condition is detect ed, communication is terminated. <2> when a start condition is detected, the address is confirmed. if the address does not match, communication is terminated. if the address matches, the communi cation mode is set and wait state is released, and operation returns from the interr upt (the ready flag is cleared). <3> for data transmission/reception, w hen the ready flag is set, operation retu rns from the interrupt while the i 2 c0n bus remains in the wait state. remark <1> to <3> in the above correspond to <1> to <3> in figure 19-19 slave operation flowchart (2) . figure 19-19. slave operation flowchart (2) yes yes yes no no no intiicn occurred spdn = 1? stdn = 1? coin = 1? communication direction flag trcn set communication mode flag clear ready flag set ready flag interrupt servicing completed clear communication direction flag, ready flag, and communication mode flag <1> <2> <3> remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 1007 19.17 timing of data communication when using i 2 c bus mode, the master dev ice generates an address via the serial bus to select one of several slave devices as its communication partner. after outputting the slave address, t he master device transmits the iicsn .trcn bit, which specifies the data transfer direction, and then starts seri al communication with the slave device. the shift operation of the iicn register is synchronized with the falling edge of the serial clock pin (scl0n). the transmit data is transferred to the so latch and is output (msb first) via the sda0n pin. data input via the sda0n pin is captured by the iicn register at the ri sing edge of the scl0n pin. the data communication timing is shown below. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 1008 figure 19-20. example of m aster to slave communication (when 9-clock wait is selected for both master and slave) (1/3) (a) start condition ~ address iicn ackdn stdn spdn wtimn h h l l l l h h l l acken mstsn sttn sptn wreln intiicn trcn iicn ackdn stdn spdn wtimn acken mstsn sttn sptn wreln intiicn trcn scl0n sda0n processing by master device transfer lines processing by slave device 123456789 4 3 2 1 ad6 ad5 ad4 ad3 ad2 ad1 ad0 w ack d4 d5 d6 d7 iicn address iicn data iicn ffh transmit start condition receive note 2 note 2 note 1 notes 1. cancel the wait during a master transmission by writing data to iicn, not by setting wreln. 2. cancel the slave wait by writing ffh to iicn or setting wreln. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 1009 figure 19-20. example of m aster to slave communication (when 9-clock wait is selected for both master and slave) (2/3) (b) data iicn ackdn stdn spdn wtimn h h l l l l l l h h h h l l l l l acken mstsn sttn sptn wreln intiicn trcn iicn ackdn stdn spdn wtimn acken mstsn sttn sptn wreln intiicn trcn scl0n sda0n processing by master device transfer lines 1 9 8 23456789 3 2 1 d7 d0 d6 d5 d4 d3 d2 d1 d0 d5 d6 d7 iicn data note 1 iicn ffh note 2 iicn ffh note 2 iicn data note1 transmit receive note 2 note 2 ack ack processing by slave device notes 1. cancel the wait during a master transmission by writing data to iicn, not by setting wreln. 2. cancel the slave wait by writing ffh to iicn or setting wreln. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 1010 figure 19-20. example of m aster to slave communication (when 9-clock wait is selected for both master and slave) (3/3) (c) stop condition iicn ackdn stdn spdn wtimn h h l l l l h h l acken mstsn sttn sptn wreln intiicn trcn iicn ackdn stdn spdn wtimn acken mstsn sttn sptn wreln intiicn trcn scl0n sda0n processing by master device transfer lines 123456789 2 1 d7 d6 d5 d4 d3 d2 d1 d0 ad5 ad6 iicn data note 1 iicn address iicn ffh note 2 iicn ffh note 2 stop condition start condition note 2 note 2 (when spien = 1) receive (when spien = 1) ack transmit processing by slave device notes 1. cancel the wait during a master transmission by writing data to iicn, not by setting wreln. 2. cancel the slave wait by writing ffh to iicn or setting wreln. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 1011 figure 19-21. example of sl ave to master communication (when 8-clock wait for master and 9-cl ock wait for slave are selected) (1/3) (a) start condition ~ address iicn ackdn stdn spdn wtimn h h l l l h l acken mstsn sttn l l sptn wreln intiicn trcn iicn ackdn stdn spdn wtimn acken mstsn sttn sptn wreln intiicn trcn scl0n sda0n processing by master device transfer lines processing by slave device 123456789 4 56 3 2 1 ad6 ad5 ad4 ad3 ad2 ad1 ad0 d4 d3 d2 d5 d6 d7 iicn address iicn ffh note 1 note 1 iicn data note 2 transmit transmit receive receive ack r notes 1. cancel the master wait by writing ffh to iicn or setting wreln. 2. cancel the wait during a slave transmission by writing to iicn, not by setting wreln. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 1012 figure 19-21. example of sl ave to master communication (when 8-clock wait for master and 9-cl ock wait for slave are selected) (2/3) (b) data iicn ackdn stdn spdn wtimn h h h l l l l l l l h h l l l l l acken mstsn sttn sptn wreln intiicn trcn iicn ackdn stdn spdn wtimn acken mstsn sttn sptn wreln intiicn trcn scl0n sda0n processing by master device transfer lines 1 89 2345678 9 3 2 1 d7 d0 ack d6 d5 d4 d3 d2 d1 d0 ack d5 d6 d7 note 1 note 1 receive transmit iicn data note 2 iicn data note 2 iicn ffh note 1 iicn ffh note 1 processing by slave device notes 1. cancel the master wait by writing ffh to iicn or setting wreln. 2. cancel the wait during a slave transmission by writing to iicn, not by setting wreln. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 19 i 2 c bus user?s manual u19201ej3v0ud 1013 figure 19-21. example of sl ave to master communication (when 8-clock 9-clock wait for master and 9-clo ck wait for slave are selected) (3/3) (c) stop condition iicn ackdn stdn spdn wtimn h h l l l acken mstsn sttn sptn wreln intiicn trcn iicn ackdn stdn spdn wtimn acken mstsn sttn sptn wreln intiicn trcn scln sdan processing by master device transfer lines 12345678 9 1 d7 d6 d5 d4 d3 d2 d1 d0 ad6 iicn address iic0 ffh note 1 note 1 notes 1, 3 iicn data note 2 receive transmit receive stop condition start condition (when spien = 1) nack (when spien = 1) processing by slave device iicn ffh note 1 note 3 notes 1. cancel the wait by writing ffh to iicn, or setting wreln. 2. cancel the wait during a slave transmission by writing to iicn, not by setting wreln. 3. when the wait during a slave transmission is canceled by setting wreln, trcn is cleared. remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5
user?s manual u19201ej3v0ud 1014 chapter 20 iebus controller iebus (inter equipment bus) is a small-scale digital dat a transfer system that transfe rs data between units. to implement iebus with the v850e/sj3-h and v850e/sk3-h, an external iebus driver and receiver are necessary because they are not provided. the internal iebus controllers of the v850e/s j3-h and v850e/sk3-h are of negative logic. 20.1 functions 20.1.1 communication protocol of iebus the communication protocol of the iebus is as follows. (1) multi-task mode all the units connected to the iebus c an transfer data to the other units. (2) broadcasting comm unication function communication between one unit and multiple units can be performed as follows. ? group-unit broadcast communication: broadcast communication to group units ? all-unit broadcast communication: broadcast communication to all units. (3) effective transfer rate the effective transfer rate is in mode 1 or mode 2 (the v850e/sj3-h and v850e/ sk3-h do not support mode 0 for the effective transfer rate). ? mode 1: approx. 17 kbps ? mode 2: approx. 26 kbps caution different modes (mode 1, mode 2) must not be mixed on one iebus. (4) communication mode data transfer is executed in half-duplex asynchronous communication mode. (5) access control: csma/cd (carrier sense multiple access with collision detection) the priority of the iebus is as follows: <1> broadcast communication takes precedence over individual communication (communication from one unit to another). <2> the lower master address takes precedence. (6) communication scale the communication scale of iebus is as follows. ? number of units: 50 max. ? cable length: 150 m max. (when twisted pair cable is used) caution the communication scale in an actual system differs depending on the characteristics of the cables, etc., constituting the ie bus driver/receiver and iebus.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1015 20.1.2 determination of bus mastership (arbitration) an operation to occupy the bus is performed when a unit connected to the iebus controls the other units. this operation is called arbitration. when two or more units simultaneously start transmission, arbitration is used to grant one of the units the permission to occupy the bus. because only one unit is granted the bus ma stership as a result of arbitration, the priority conditions of the bus are predetermined as follows. caution the bus mastership is rele ased if communication is aborted. (1) priority by communication type broadcast communication (communication from one unit to multiple units) takes precedence over normal communication (communication from one unit to another). (2) priority by master address if the communication type is the same, communication with the lower master address takes precedence. a master address consists of 12 bi ts, with unit 000h having the highest priority and unit fffh having the lowest priority. 20.1.3 communication mode the iebus has three communication modes each having a different transfer rate. the v850e/sj3-h and v850e/sk3-h support communication modes 1 and 2. the transfer rate and the maximum number of transfer bytes in one communication frame in communication modes 1 and 2 are as shown in table 20-1. table 20-1. transfer rate and maximum number of transfer bytes in each communication mode communication mode maximum number of transfer byte s (bytes/frame) effective transfer rate (kbps) note 1 32 approx. 17 2 128 approx. 26 note the effective transfer rate when the maxi mum number of transfer bytes is transmitted select the communication mode for each unit connected to the iebus before starting communication. if the communication mode of the master unit an d that of the part ner unit (slave unit) are not the same, communication is not correctly executed. 20.1.4 communication address with the iebus, each unit is assigned a specific 12-bi t address. this communication address consists of the following identifi cation numbers. ? higher 4 bits: group number (number to identify the group to which each unit belongs) ? lower 8 bits: unit number (number to identify each unit in a group)
chapter 20 iebus controller user?s manual u19201ej3v0ud 1016 20.1.5 broadcast communication normally, transmission or reception is performed betwee n the master unit and its partner slave unit on a one-to- one basis. during broadcast communication, however, two or more slave units exist and the master unit executes transmission to these slave units. because two or more slave units exist, the nack signal is returned by the communicating slave unit as an acknowledge bit. whether broadcast communication or normal communication is to be executed is selected by the broadcast bit (for this bit, see 20.1.6 (2) broadcast bit ). broadcast communication is classified into two types: group-unit broadcast communication and all-unit broadcast communication. group-unit broadcast and all-unit broadcast are identified by the value of the slave address (for the slave address, see 20.1.6 (4) slave address field ). (1) group-unit broadcast communication broadcast communication is performed to the units in a group identified by the group number indicated by the higher 4 bits of the communication address. (2) all-unit broadcast communication broadcast communication is performed to all the uni ts, regardless of the value of the group number. 20.1.6 transfer format of iebus figure 20-1 shows the transfer signal format of the iebus. figure 20-1. iebus transfer signal format header master address field slave address field control field telegraph length field data field start bit broad- cast bit master address bit p frame format slave address bit pa control bit pa tele- graph length bit pa data bit pa data bit pa remarks 1. p: parity bit a: acknowledge (ack/nack) bit 2. the master unit ignores the acknowled ge bit during broadcast communication. (1) start bit the start bit is a signal that informs t he other units of the start of data transfe r. the unit that is to start data transfer outputs a high-level signal (start bit) from the ietx pin for a specific time, and then starts outputting the broadcast bit. if another unit has already output its st art bit when one unit is to output the start bit, this unit does not output the start bit but waits for completion of output of the st art bit by the other unit. when the output of the start bit by the other unit is complete, the unit starts outputti ng the broadcast bit in synchr onization with the completion of the start bit output by the other unit. the units other than the one that has started communication detect th is start bit, and enter the reception status.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1017 (2) broadcast bit this bit indicates whether the master selects one sl ave (individual communication) or multiple slaves (broadcast communication) as the other party of communication. when the broadcast bit is 0, it indicates broadcast co mmunication; when it is 1, individual communication is indicated. broadcast communication is classified into two types: group-unit communication and all-unit communication. these communication types are identified by the value of the slave address (for the slave address, see 20.1.6 (4) slave address field ). because two or more slave units exist as a partner slave unit of communication in the case of broadcast communication, the nack signal is returned as an acknowledge bit in each field subsequent to the master address field. if two or more units start transmitting a communica tion frame at the same time, broadcast communication takes precedence over individual communication, and wins in arbitration. if one unit occupies the bus as the master, the value set to the broadcast request flag (bcr.allrq bit) is output. (3) master address field the master address field is out put by the master to inform a sl ave of the master?s address. the configuration of the master address field is as shown in figure 20-2. if two or more units start transmitting the broadcast bit at the same time, the master address field makes a judgment of arbitration. the master address field compares the da ta it outputs with the data on the bus each time it has output one bit. if the master address output by the master address field is found to be different from the data on the bus as a result of comparison, it is assumed that the master has lost in arbitrat ion. as a result, the master stops transmission and enters the reception status. because the iebus is configured of wired and, the unit having the mini mum master address of the units participating in arbitration (arbitration masters) wins in arbitration. after a 12-bit master address has been output, only one uni t remains in the transmission status as one master unit. next, this master unit outputs a parity bit, determines th e master address of other unit, and starts outputting a slave address field. if one unit occupies the bus as the master, the address set by the uar register is output. figure 20-2. master address field master address field master address (12 bits) msb lsb parity
chapter 20 iebus controller user?s manual u19201ej3v0ud 1018 (4) slave address field the master outputs the addr ess of the unit with which it is to communicate. figure 20-3 shows the configuratio n of the slave address field. a parity bit is output after a 12-bit slave address has been transmitted in order to prevent a wrong slave address from being received by mistake. next, the ma ster unit detects an ack signal from the slave unit to confirm that the slave unit exists on the bus. when the master has detected the ack si gnal, it starts outputting the control field. during broadcast communication, howe ver, the master does not co nfirm the acknowledge bit but starts outputting the control field. the slave unit outputs the ack signal if its slave address matches and if t he slave detects that the parities of both the master address and slave addre ss are even. the slave unit judges that the master address or slave address has not been correctly received and outputs the nack signal if the parities are odd. at this time, the master unit is in the standby (monitor) status, and communication ends. during broadcast communication, the slave address is used to identify group-unit broadcast or all-unit broadcast, as follows:. if slave address is fffh: all-unit broadcast communication if slave address is other than fffh: gr oup-unit broadcast communication remark the group no. during group-unit broadcasting communi cation is the value of the higher 4 bits of the slave address. if one unit occupies the bus as the master, the address set by the sar register is output. figure 20-3. slave address field slave address field unit no. msb lsb ack parity slave address (12 bits) group no. (5) control field the master outputs the operation it requires the slave to perform, by using this field. the configuration of t he control field is as shown in figure 20-4. if the parity following the control bit is even and if the slave unit can execute the function required by the master unit, the slave unit outputs an ack signal and starts outputting the telegraph length field. if the slave unit cannot execute the function required by the master unit even if the parity is even, or if the parity is odd, the slave unit outputs the nack signal, and returns to the standby (monitor) status. the master unit starts outputting the telegr aph field after detecting the ack signal. if the master can detect the nack signal, the master unit enters the standby status, and communication ends. during broadcast communication, however, the master unit does not confirm the acknowledge bit, and starts outputting the telegraph length field. the contents of the contro l bits are shown below.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1019 table 20-2. contents of control bits bit 3 note 1 bit 2 bit 1 bit 0 function 0 0 0 0 read slave status 0 0 0 1 undefined 0 0 1 0 undefined 0 0 1 1 read data and lock note 2 0 1 0 0 read lock address (lower 8 bits) note 3 0 1 0 1 read lock address (higher 4 bits) note 3 0 1 1 0 read slave status and unlock note 2 0 1 1 1 read data 1 0 0 0 undefined 1 0 0 1 undefined 1 0 1 0 write command and lock note 2 1 0 1 1 write data and lock note 2 1 1 0 0 undefined 1 1 0 1 undefined 1 1 1 0 write command 1 1 1 1 write data notes 1. the telegraph length bit of the telegraph length fi eld and data transfer dire ction of the data field change as follows depending on the value of bit 3 (msb). if bit 3 is ?1?: transfer from master unit to slave unit if bit 3 is ?0?: transfer from slave unit to master unit 2. this is a control bit that specifies locking or unlocking (see 20.1.7 (4) locking and unlocking ). 3. the lock address is transferred in 1-byte (8-bit) units and is configured as follows: msb lower 8 bits undefined higher 4 bits control bit: 4h control bit: 5h lsb
chapter 20 iebus controller user?s manual u19201ej3v0ud 1020 if the control bit received from the mast er unit is not as shown in table 20- 3, the unit locked by the master unit rejects acknowledging the control bit, and outputs the nack signal. table 20-3. control fi eld for locked slave unit bit 3 bit 2 bit 1 bit 0 function 0 0 0 0 read slave status 0 1 0 0 read lock address (lower 8 bits) 0 0 0 1 read lock address (higher 4 bits) moreover, units for which lock is not set by the mast er unit reject acknowledgment and output a nack signal when the control data shown in table 20-4 is acknowledged. table 20-4. control fiel d for unlocked slave unit bit 3 bit 2 bit 1 bit 0 function 0 1 0 0 lock address r ead (lower 8 bits) 0 1 0 1 lock address read (higher 4 bits) if one unit occupies the bus as the master, t he value set to the cdr register is output. figure 20-4. control field msb lsb ack parity control bit (4 bits) control field
user?s manual u19201ej3v0ud 1021 chapter 20 iebus controller table 20-5. acknowledge signal ou tput condition of control field (a) if received control da ta is ah, bh, eh, or fh received control data communication type (usr.alltrans bit) individual communication = 0 broadcast communication = 1 communication target (usr.slvrq bit) slave specification = 1 no specification = 0 lock status (usr.lock bit) lock = 1 unlock = 0 master unit identification (match with par register) lock request unit = 1 other = 0 slave transmission enable (bcr.enslvtx bit) slave reception enable (bcr.enslvrx bit) ah bh eh fh 0 don?t care 0 1 1 1 don?t care 1 other than above (b) if received control data is 0h, 3h, 4h, 5h, 6h, or 7h received control data communication type (usr.alltrans bit) individual communication = 0 broadcast communication = 1 communication target (usr.slvrq bit) slave specification = 1 no specification = 0 lock status (usr.lock bit) lock = 1 unlock = 0 master unit identification (match with par register) lock request unit = 1 other = 0 slave transmission enable (bcr.enslvtx bit) slave reception enable (bcr.enslvrx bit) 0h 3h 4h 5h 6h 7h 0 0 don?t care 1 0 don?t care 0 0 1 1 1 1 don?t care other than above caution if the received control data is ot her than the data shown in table 20-5, (nack signal is returned) is unconditiona lly assumed. remark : ack signal is returned. : nack signal is returned.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1022 (6) telegraph length field this field is output by the transmission side to inform t he reception side of the number of bytes of the transmit data. the configuration of the telegraph length field is as shown in figure 20-5. table 20-6 shows the relationship between the tele graph length bit and the number of transmit data. figure 20-5. telegraph length field msb lsb telegraph length field telegraph length bit (8 bits) parity ack table 20-6. contents of telegraph length bit telegraph length bit (hex) number of transmit data bytes 01h 1 byte 02h 2 bytes | | ffh 255 bytes 00h 256 bytes the operation of the telegraph lengt h field differs depending on whether the master transmits data (when control bit 3 is 1) or receives data (when control bit 3 is 0). (a) when master transmits data the telegraph length bit and parity bi t are output by the master unit and th e synchronization signals of bits are output by the master unit. when the slave unit detects that the parity is ev en, it outputs the ack signal, and starts outputting the dat a field. during broadcast communication, however, the slave unit outputs the nack signal. if the parity is odd, the slave unit j udges that the telegraph length bit has not been correctly received, outputs the nack signal, and returns to the standby (monitor) status. at this time, the master unit also returns to the standby status, and communication ends. (b) when master receives data the telegraph length bit and parity bi t are output by the slave unit and the synchronization signals of bits are output by the master unit. if the master unit detects that the par ity bit is even, it outputs the ack signal. if the parity bit is odd, the master unit judges that t he telegraph length bit has not been correctly received, outputs the nack signal, and returns to the standby status. at this time, t he slave unit also returns to the standby status, and communication ends.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1023 (7) data field this is data output by the transmission side. the master unit transmits or receives data to or from a slave unit by using the data field. the configuration of the data field is as shown below. figure 20-6. data field data field (number specified by telegraph length field) msb lsb one data ack parity data bit (8 bits) ack parity following the data bit, the parity bit and acknowledge bit are respectively output by the master unit and slave unit. use broadcast communication only for when the master unit tr ansmits data. at this time, the acknowledge bit is ignored. the operation differs as follows depending on whether the master transmits or receives data. (a) when master transmits data when the master units writes data to a slave unit, the master unit transmits the data bit and parity bit to the slave unit. if the parity is even and the receive data is not stored in the dr register when the slave unit has received the data bit and parity bit, the slave unit outputs an ack signal. if the parity is odd or if the receive data is stored in the dr register, the slave unit rejects receiving the data, and outputs the nack signal. if the slave unit outputs the nack signal, the master unit transmits the same dat a again. this operation continues until the master detects the ack signal from the slave unit, or the data exceeds the maximum number of transmit bytes. if there is more data and the maximum number of tran smit bytes is not exceeded when the parity is even and when the slave unit outputs the ack signal , the master unit transmits the next data. during broadcast communication, the slave unit outputs the nack signal, and the master unit transfers 1 byte of data at a time. if the parity is odd or the dr register is storing receive data after the slave unit has received the data bit and parity bit during broadcast communication, the slave unit judges that reception has not been performed corre ctly, and stops reception.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1024 (b) when master receives data when the master unit reads data from a slave unit, the master unit outputs a sync signal corresponding to all the read bits. the slave unit outputs the co ntents of the data and parity bits to t he bus in response to the sync signal from the master unit. the master unit reads the data and parity bits out put by the slave unit, and checks the parity. if the parity is odd, or if the dr register is storing a receive data, the master unit rejects accepting the data, and outputs the nack signal. if the maximum number of transmit bytes is within the value that can be transmitted in one communication frame, the ma ster unit repeats reading the same data. if the parity is even and the dr regist er is not storing a receive data, the master unit accepts the data and outputs the ack signal. if the maximum number of transmit bytes is within the value that can be transmitted in one frame, the mast er unit reads the next data. caution do not operate master reception in broadcast comm unication, because the slave unit cannot be defined and da ta transfer cannot be performed correctly. (8) parity bit the parity bit is used to check to s ee if the transmit data has no error. the parity bit is appended to each data of the master address, slave addre ss, control, telegraph length, and data bits. the parity is an even parity. if the number of bits in data that are ?1? is odd, the parity bit is ?1?. if the number of bits in the data that are ?1? is even, the parity bit is ?0?. (9) acknowledge bit during normal communication (communication from one unit to another), an acknowledge bit is appended to the following locations to check if the data has been correctly received. ? end of slave address field ? end of control field ? end of telegraph length field ? end of data field the definition of the ackno wledge bit is as follows. ? 0: indicates that the transmit data is recognized (ack signal). ? 1: indicates that the transmit data is not recognized (nack signal). during broadcast communication, however, the c ontents of the acknowledge bit are ignored. (a) last acknowledge bit of slave field the last acknowledge bit of the slave field serves as a nack signal in any of the following cases, and transmission is stopped. ? if the parity of the master address bit or slave address bit is incorrect ? if a timing error (error in bit format) occurs ? if a slave unit does not exist
chapter 20 iebus controller user?s manual u19201ej3v0ud 1025 (b) last acknowledge bit of control field the last acknowledge bit of the control field serves as a nack signal in any of the following cases, and transmission is stopped. ? if the parity of the control bit is incorrect ? if control bit 3 is ?1? (write operation) when the slave reception enable flag (bcr.enslvrx bit) is not set (1) note ? if the control bit indicates reading of data (3h or 7h) when the slave transmission enable flag (bcr.enslvtx bit) is not set (1) note ? if a unit other than that has set locking requests 3h, 6h, 7h, ah, bh, eh, or fh of the control bit when locking is set ? if the control bit indicates reading of lock a ddresses (4h, 5h) even when locking is not set ? if a timing error occurs ? if the control bit is undefined note see 20.3 (1) iebus control register (bcr) . cautions 1. the ack signal is always returned wh en the control data of the slave status request is received, even if the enslvtx bit = 0. 2. the nack signal is returned by the ackno wledge bit in the control field when the control data for data/comma nd writing is received, even if the enslvrx bit = 0. slave reception can be di sabled (communication stopped) by enslvrx bit only in the case of individual comm unication. in the case of broadcast communication, communication is maintained and the data request interrupt request signal (intie1) or iebus end interrupt request signal (intie2) is generated. (c) last acknowledge bit of telegraph length field the last acknowledge bit of the tel egraph length field serves as a nack signal in any of the following cases, and transmission is stopped. ? if the parity of the telegraph length bit is incorrect ? if a timing error occurs (d) last acknowledge bit of data field the last acknowledge bit of the data field serves as a nack signal in any of the following cases, and transmission is stopped. ? if the parity of the data bit is incorrect note ? if a timing error occurs after the preceding acknowledge bit has been transmitted ? if the receive data is stored in the dr register and no more data can be received note note in this case, when the communication executed is individual communication, if the maximum number of transmit bytes is within the valu e that can be transmitted in one frame, the transmission side executes transmission of that dat a field again. for broadcast communication, the transmission side does not execute transmission again, a communication error occurs on the reception side and reception stops.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1026 20.1.7 transfer data (1) slave status the master unit can learn why the slave unit did not return the ack signal by reading the slave status. the slave status is determined according to the result of the last communication the slave unit has executed. all the slave units can supply in formation on the slave status. the configuration of the slav e status is shown below. figure 20-7. bit configuration of slave status msb lsb bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 0 note 1 function 0 transmit data is not written in dr register 1 transmit data is written in dr register bit 1 note 2 function 0 receive data is not stored in dr register 1 receive data is stored in dr register bit 2 function 0 unit is not locked 1 unit is locked bit 3 function 0 fixed to 0 bit 4 note 3 function 0 slave transmission is stopped 1 slave transmission is ready bit 5 function 0 fixed to 0 bit 7 bit 6 function 0 0 mode 0 0 1 mode 1 1 0 mode 2 1 1 not used indicates the highest mode supported by the unit note 4 . notes 1. after reset: bit 0 is set to 1. 2. the receive buffer size is 1 byte. 3. when the v850e/sj3-h or v850e/sk3-h serves as a slave unit, this bit corresponds to the status indicated by bcr.enslvtx bit. 4. bits 7 and 6 are fixed to ?10? because the v850e/sj3-h and v850e/sk3-h can support modes 1 and 2.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1027 (2) lock address when the lock address is read (control bit: 4h or 5h), the address (12 bits) of the master unit that has issued the lock instruction is configured in 1- byte units as shown below and read. figure 20-8. configuration of lock address msb lower 8 bits undefined higher 4 bits control bit: 4h control bit: 5h lsb (3) data if the control bit indicates reading of data (3h or 7h), the data in the data buffer of the slave unit is read by the master unit. if the control bit indicates writing of data (bh or fh), the data received by the slave unit is processed according to the operation rule of that slave unit. (4) locking and unlocking the lock function is used when a message is transferred in two or more communication frames. the unit that is locked does not receive data from units other than the one that has locked the unit (does not receive broadcast communication). a unit is locked or unlocked as follows. (a) locking if the communication frame is completed without succeedi ng to transmit or receive data of the number of bytes specified by the telegraph length bit after t he telegraph length field has been transmitted or received (ack = 0) by the control bit that specifies locking (3h, ah, or bh), the slave unit is locked by the master unit. at this time, the bit (bit 2) in the byte indicating the slave status is set to ?1?. (b) unlocking after transmitting or receiving data of the number of data byte s specified by the telegraph length bit in one communication frame by the control bit that has specified locking (3h, ah, or bh), or the control bit that has specified unlocking (6h), the slave unit is unlocked by the master unit. at this time, the bit related to locking (bit 2) in the byte indicating the slave status is reset to ?0?. locking or unlocking is not performed during broadcast communication. locking and unlocking conditions are shown below.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1028 table 20-7. lock setting conditions broadcast communication i ndividual communication control data communication end frame end communication end frame end 3h, 6h note cannot be locked lock set ah, bh cannot be locked cannot be locked cannot be locked lock set 0h, 4h, 5h, eh, fh cannot be locked cannot be locked cannot be locked cannot be locked note the frame end of control data 6h (s lave status read/unlock) occurs when the parity in the data field is odd, and when the nack signal from the iebus unit is r epeated up to the maximum number of transfer bytes with being output. table 20-8. unlock release conditions (while locked) broadcast communication from lock request unit individual communication from lock request unit control data communication end frame end communication end frame end 3h, 6h note unlocked remains locked ah, bh unlocked unlocked unlocked remains locked 0h, 4h, 5h, eh, fh remains locked remains locked remains locked remains locked note the frame end of control data 6h (s lave status read/unlock) occurs when the parity in the data field is odd, and when the nack signal from the iebus unit is r epeated up to the maximum number of transfer bytes with being output. 20.1.8 bit format the format of the bits constituting the communi cation frame of the iebus is shown below. figure 20-9. bit format of iebus logic ?1? logic ?0? preparation period synchronization period data period stop period preparation period: first low-level (logic ?1?) period synchronization period: next high-level (logic ?0?) period data period: period indicating value of bit stop period: last low-level (logic ?1?) period the synchronization period and data period are almost equal to each other in length. the iebus synchronizes each bit. the specifications on the time of the entire bit and the time related to the period allocated to that bit differ depending on the type of the transm it bit, or whether the unit is the master unit or a slave unit. the master and slave units monitor whether each period (p reparation period, synchronization period, data period, and stop period) is output for specified time while they are in communication. if a period is not output for the specified time, the master and slave units report a timing error, immediately terminate communication and enter the standby status.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1029 20.2 configuration the block diagram of the iebu s controller is shown below. figure 20-10. iebus cont roller block diagram ietx0 f ie to f ie /5 ierx0 uar, sar ocks2 prescaler prescaler block 8 bcr, psr, isr esr, cdr, dlr, dr reception block transmission block transmit shift register receive shift register field processing block bit processing block interrupt control block internal register block iebus interface block interrupt request signal iebus controller internal bus ssr, usr, fsr, scr, ccr rar, rsa noise filter remark f ie : iebus clock frequency in clock mode 1, f ie = f xx in clock mode 2, f ie = f xmpll (29.28 to 32 mhz) in clock mode 3, f ie = f xmpll (29.28 to 32 mhz) in clock mode 4, f ie = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clocks (1) hardware configuration and functions iebus mainly consists of the following six internal blocks. ? interrupt control block ? internal registers ? bit processing block ? field processing block ? iebus interface block ? prescaler block
chapter 20 iebus controller user?s manual u19201ej3v0ud 1030 (a) interrupt control block this control block transfers interrupt request si gnals from the iebus controller to the cpu. (b) internal registers these registers set data to the control registers and fields that control iebus (for t he internal registers, see 20.3 registers ). (c) bit processing block this block generates and breaks down bit timing, and ma inly consists of a bit sequence rom, 8-bit preset timer, and comparator. (d) field processing block this block generates each field in the communication frame, and mainly consists of a field sequence rom, 4-bit down counter, and comparator. (e) iebus interface block this is the interface block for an external driver/receive r, and mainly consists of a noise filter, shift register, and transmission/reception block (collision detecto r, parity detector, parit y generator, and ack/nack generator). (f) prescaler block this block selects the clock to be supplied to the iebus controller.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1031 20.3 registers the registers that control the i ebus controller are shown below. table 20-9. control registers of iebus controller bit unit for manipulation address function register name symbol r/w 1 8 16 after reset fffff348h iebus clock select register ocks2 fffff360h iebus control register bcr fffff361h iebus power save register psr r/w 00h fffff362h iebus slave status register ssr 81h fffff363h iebus unit status register usr r fffff364h iebus interrupt status register isr fffff365h iebus error status register esr 00h fffff366h iebus unit address register uar fffff368h iebus slave address register sar r/w fffff36ah iebus partner address register par fffff36ch iebus receive slave address register rsa r 0000h fffff36eh iebus control data register cdr 00h fffff36fh iebus telegraph length register dlr 01h fffff370h iebus data register dr r/w fffff371h iebus field status register fsr 00h fffff372h iebus success count register scr 01h fffff373h iebus communication count register ccr r 20h
chapter 20 iebus controller user?s manual u19201ej3v0ud 1032 (1) iebus control register (bcr) the bcr register is an 8-bit register that cont rols the operations of the iebus controller. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. after reset: 00h r/w address: fffff360h <7> <6> <5> <4> <3> 2 1 0 bcr eniebus mstrq allrq enslvtx enslvrx 0 0 0 eniebus communication enable flag 0 iebus unit stopped 1 iebus unit active mstrq master request flag 0 iebus unit not requested as master 1 iebus unit requested as master allrq broadcast request flag 0 individual communication requested 1 broadcast communication requested enslvtx slave transmission enable flag 0 slave transmission disabled 1 slave transmission enabled enslvrx slave reception enable flag 0 slave reception disabled 1 slave reception enabled cautions 1. while iebus is opera ting as the master, writing to the bcr register (including bit manipulation instructions) is disabled until eith er the end of that communication or frame, or until communication is stopped by the occu rrence of an arbitrat ion-loss communication error. master requests cannot therefore be multiplexed. ho wever, the case when communication has been forcibly stopped (eniebus flag = 0) is not problem. 2. if a bit manipulation inst ruction for the bcr register conflic ts with a hardware reset of the mstrq bit, the bcr register may not operat e normally. the following countermeasures are recommended in this case. ? because the hardware reset is instigated in the acknowledgment period of the slave address field, be sure to observe caution 1 of (b) master request flag (mstrq) below. ? be sure to observe the caution above regarding writing to the bcr register. 3. be sure to set bits 0 to 2 to ?0?.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1033 (a) communication enable flag (eniebus)...bit 7 set: by software clear: by software the iebus controller participates in communication di fferently depending on the timing of setting the eniebus bit (1), as follows. table 20-10. timing of setting eniebus bit and participation in communication timing of setting eniebus bit how iebus c ontroller participates in communication if communication is not performed on iebus participat es in communication from the next frame or starts communication. if other bus master is communicating start bit while communication is in progress on iebus participates in communication from that frame if the start bit is detected. if the start bit is not detected, participates in communication from the next frame. if communication is in progress on iebus after start bit from other bus master is detected participates in communication from the next frame. if the eniebus bit is cleared (0), communication is i mmediately stopped even while it is in progress, and the internal flags and registers are reset, with some e xceptions. the registers t hat are not reset by the eniebus bit are listed in the table below. the iebus controller does not respond even if another unit starts communication when the eniebus bit = 0. table 20-11. registers that are not reset by eniebus bit registers not reset by eniebus bit remark uar not reset sar not reset cdr data written from cpu is not reset but data received during communication is reset. dlr data written from cpu is not reset but data received during communication is reset. dr data written from cpu is not reset but data received during communication is reset. caution before setting the eniebus bit (1), the follow ing registers must be set depending on the mode of communication to be started. table 20-12. registers that must be set before each communication mode of communication registers that must be set in advance master transmission uar, sar, cdr, dlr, dr (first 1-byte data) master reception uar, sar, cdr slave transmission note uar, dlr, dr (first 1-byte data) note slave reception uar note when starting slave transmission, information such as the value to be set to the dlr register and which data is to be returned (value to be set to t he dr register) must be assigned in advance.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1034 (b) master request flag (mstrq)...bit 6 set: by software clear: cleared (0) by hardware when master communica tion is started and immediately before the start interrupt of the master occurs. cleared (0) by hardware before a communication error occurs. when the eniebus bit is cleared. when the mstrq bit is set (1), the iebus controlle r starts communication on iebus as the master. if communication is in progress on iebus (if the start bit cannot be detected whil e the start bit is being communicated or if communication is in progress a fter the start bit has been detected), however, the controller waits until the current fram e ends (holds the master request pe nding), outputs the start bit after the frame has ended, and starts communication as the master. cautions 1. if the iebus contro ller has lost in arbitration, i ssue the master request again by software. in doing so, set (1) the mstrq bit at a timing other than that illustrated below. figure 20-11. timing at which mstrq bit cannot be set mstrq bit mstrq bit cannot be set (1) (approx. 167 ns (mode 1, at 6.29 mhz)). mstrq bit clear signal start interrupt request signal (intie2, intsta) 2. when a master request has been sent and bus mastersh ip acquired, do not set the mstrq, enslvtx, or enslvrx bit unti l the end of commu nication (i.e. the communication end flag (isr.endtrns bit) or frame end flag (isr.endfram bit) is set (1)) as setting these flags di sables interrupt request signal generation. however, these flags can be set if comm unication has been aborted. (c) broadcast request flag (allrq)...bit 5 set: by software clear: by software caution when requesting broad cast communication, always set (1 ) the allrq bit, then the mstrq bit.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1035 (d) slave transmission enable flag (enslvtx)...bit 4 set: by software clear: by software cautions 1. the enslvtx bit must be set before the parity bit in the c ontrol field is received. 2. clear the enslvtx bit (0 ) before setting the mstrq bi t (1) when making a master request. this is to avoid transmission of the data of the dr register that tries master transmission if the controller loses in arbitr ation after master operation and if slave transmission is requested by the master. 3. when returning to an enabled state from a disabled state, transmission becomes valid from the next frame. 4. if control data (3h or 7h) for data/command writing is received when the enslvtx bit = 0, the nack signal is returned by the acknowledge bit in th e control field. 5. the status interrupt request signals (intie2, intsta) will be generated and communication continued when the control data of a slave status request is returned, even if the enslvtx bit = 0. (e) slave reception enable flag (enslvrx)...bit 3 set: by software clear: by software cautions 1. the enslvrx bit must be set before the parity bit in the c ontrol field is received. 2. while the cpu is busy with other proc essing, slave reception can be prevented by clearing the enslvrx bit (0). during in dividual communication, the nack signal is returned in the cont rol field and communicat ion is completed. during broadcast communication, communicati on cannot be completed b ecause the acknowledge bit is ignored. however, the iebus contro ller does not respond to the broadcast communication and does not generate an interrupt request signal. 3. when returning to an enabled state from a disabled state, transmission becomes valid from the next frame.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1036 (2) iebus power save register (psr) the psr register is an 8-bit register that controls the internal clock and communication mode of the iebus controller. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. after reset: 00h r/w address: fffff361h <7> <6> 5 4 3 2 1 0 psr enclk iemode 0 0 0 0 0 0 enclk internal clock operation enable flag 0 stop internal clock of iebus controller 1 enable internal clock of iebus controller iemode iebus communication mode setting flag 0 set communication mode 1 1 set communication mode 2 cautions 1. do not set the psr register while communication is enabled (bcr.eniebus bit = 1). 2. be sure to clear bits 5 to 0 to ?0?.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1037 (3) iebus slave status register (ssr) the ssr register is an 8-bit register that indicates the communication status of the slave unit. after receiving a slave status transmission request from the master, read th is register by software, and write a slave status to the dr register to transmit the slave status. at this time , the telegraph length is automatically set to ?01h?, so setting of the dlr register is not requir ed (because it is preset by hardware). bits 6 and 7 indicate the highest mode supported by the unit, and are fixed to ?10? (mode 2). this register is read-only, in 8-bit or 1-bit units. reset sets this register to 81h. after reset: 81h r address: fffff362h 7 6 5 <4> 3 <2> <1> <0> ssr 1 0 0 statslv 0 statlock statrx stattx statslv slave transmission status flag 0 slave transmission stops 1 slave transmission enabled statlock lock status flag 0 unlock status 1 lock status statrx dr register receive status 0 receive data not stored in dr register 1 receive data stored in dr register stattx dr register transmit status 0 transmit data not stored in dr register 1 transmit data stored in dr register (a) slave transmission status flag (statslv)...bit 4 reflects the contents of the slave tr ansmission enable flag (bcr.enslvtx bit). (b) lock status flag (statlock)...bit 2 reflects the contents of the lock flag (usr.lock bit). (c) dr register reception status (statrx)...bit 1 this flag indicates the dr r egister reception state. (d) dr register transmission status (stattx)...bit 0 this flag indicates the dr register transmission state.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1038 (4) iebus unit status register (usr) the usr register is an 8-bit register that indicates the iebus unit status. this register is read-only, in 8-bit or 1-bit units. reset sets this register to 00h. after reset: 00h r address: fffff363h 7 <6> <5> <4> <3> 2 1 0 usr 0 slvrq arbit alltrns ack lock 0 0 slvrq slave request flag 0 no request from master to slave 1 request from master to slave arbit arbitration result flag 0 arbitration loss not occurred 1 arbitration loss occurred alltrns broadcast communication flag 0 individual communication status 1 broadcast communication status ack acknowledge tran smission flag 0 nack signal transmitted 1 ack signal transmitted lock lock status flag 0 unit unlocked 1 unit locked caution be sure to set bits 0, 1, and 7 to ?0?.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1039 (a) slave request flag (slvrq)...bit 6 a flag indicating whether there has been a slave request from the master. set: when the unit is requested as a slave (if the condition in table 20-13 slave request condition (slvrq bit setting condition ) is satisfied), this flag is set (1) by hardware when the acknowledge period of the slave address field starts. clear: this flag is cleared (0) by hardware when the un it is not requested as a slave (if the condition in table 20-13 slave request condit ion (slvrq bit setting condition ) is not satisfied). the reset timing is the same as the set timing. if the unit is requested as a slave immediately after communication has been correctly received (when the slvrq bit = 1), and if a parity error occurs in the slave address field for that communication, the flag is not cleared. table 20-13. slave request condition (slvrq bit setting condition) status of unit received master address communication mode rece ived slave address individual uar register matching group matching not locked don?t care broadcast fffh individual uar register matching group matching locked locked master matching broadcast fffh caution if a unit other than th e locked master communicates with th e unit while the unit is locked, the slvrq bit is not set but the ack signal is returned to the slave a ddress field. this is because communication must be continued, even if a unit other than the locked master returns the signal, if the control data is a slave status request. (b) arbitration result flag (arbit)...bit 5 a flag that indicates the result of arbitration. set: this flag is set (1) when the data output by t he iebus unit during the ar bitration period does not match the bus line data. clear: this flag is cleared (0) by the start bit timing. cautions 1. the timing at which th e arbitration result flag (arbit bi t) is cleared differs depending on whether the unit outputs a start bit. ? if start bit is output: the flag is cleared at the output start timing. ? if start bit is not output: the flag is clear ed at the detection ti ming of the start bit (approx. 160 s (mode 1, at 6.29 mhz) after output) 2. the flag is cleared (0) at the detection timing of the start bit if the other unit outputs the start bit earlier and the unit does not outpu t the start bit after the master request.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1040 (c) broadcast communicati on flag (alltrns)...bit 4 flag indicating whether the unit is performing broadc ast communication. the contents of the flag are updated in the broadcast field of each frame. except for initialization (reset) by system reset, the set/clear conditions vary depending on the receive data of the broadcast field bit. set: when ?broadcast? is received by the broadcast field clear: when ?individual? is received by the broadc ast field, or upon the input of a system reset. caution the broadcast flag is up dated regardless of whether ie bus is the communication target or not. figure 20-12. example of broad cast communication flag operation broadcast communication flag clear set not cleared by start bit iebus sequence start m11 broad- cast m10 m11 individual m10 start (d) acknowledge transmission flag (ack)...bit 3 a flag that indicates whether the ack signal has b een transmitted in the acknowledge bit period of the acknowledge bit field when iebus is the receiving uni t. the contents of the fl ag are updated in the acknowledge bit period of each frame. however, if the internal circuit is initialized by the occurrence of a parity error, etc., the contents are not updated in the acknowle dge bit period of that field. (e) lock status flag (lock)...bit 2 a flag that indicates whether the unit is locked. set: this flag is set (1) when the communication end flag (isr.endtrns bit) goes low and the frame end flag (isr.endfram bit) goes high after receipt of a lock specification (3h, 6h, ah, bh) in the control field. clear: when the communication enable flag (bcr.eniebus bit) is cleared (0). when the communication end flag (endtrns bit) is se t (1) after receipt of a lock release (3h, 6h, ah, bh) in the control field. caution lock specification/release is not possible in broadcast communication. in the lock status, individual communication from a unit other th an the one that requests locking is not acknowledged. however, even communication from a unit other than the one that requests locking is acknowledged as long as the communication is a slave status request.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1041 (5) iebus interrupt status register (isr) the isr register indicates the interrupt source when iebu s issues an interrupt request signal. this register is read to generate an interrupt request signal, after wh ich the specified interrupt servicing is carried out. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. after reset: 00h r/w note 1 address: fffff364h 7 <6> <5> <4> <3> <2> 1 0 isr 0 ieerr startf statusf endtrns endfram 0 0 ieerr communication error flag (during communication) 0 no communication error 1 communication error startf start interrupt flag 0 start interrupt request signal did not occur 1 start interrupt request signal occurred statusf status transmission flag (slave) 0 no slave status/lock address (higher 4 bits, lower 8 bits) transmission request 1 slave status/lock address (higher 4 bi ts, lower 8 bits) transmission request endtrns communication end flag 0 communication does not end after the number of bytes set in the telegraph length field have been transferred 1 communication ends after the number of bytes set in the telegraph length field have been transferred endfram frame end flag 0 the frame (transfer of the maximum number of bytes note 2 ) does not end 1 the frame (transfer of the maximum number of bytes note 2 ) ends notes 1. only the ieerr bit can be written, and only to 0 (i.e., the ieerr bit can only be cleared). the ieerr bit is not set (1) even if 1 is written to it. 2. mode 1: 32 bytes mode 2: 128 bytes caution be sure to set bits 0, 1, and 7 to ?0?.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1042 (a) communication error flag (ieerr)...bit 6 a flag that indicates a communication error has o ccurred. when a communication error occurs, the intie2 and interr interrupt request signals are generated. set: the flag is set (1) if a timing error, parity e rror (except in the data field), nack reception error (except in the data field), underrun error, overrun error (that occurs during broadcast communication reception), or write error occurs. clear: by software (b) start interrupt flag (startf)...bit 5 a flag that indicates the start interrupt. when a star t interrupt occurs, the in tie2 and intsta interrupt request signals are generated. set: this flag is set (1) in the slave address field, upon a master request. when iebus is a slave unit, this flag is set (1) upon a request from the master (only if it was a slave request in the locked state from the unit requesting a lock). clear: this flag is cleared (0) if the status transmission interrupt, communication end interrupt, frame end interrupt, or intie1 interrupt request signal is generated. (c) status transmission flag (statusf)...bit 4 a flag that indicates the master requested transmission of the slave status and lock address (higher 4 bits and lower 8 bits) when the controller was serving as a slave. set: this flag is set (1) when 0h, 4h, 5h, or 6h is re ceived in the control field from the master when the iebus is a slave unit. clear: this flag is cleared (0) if the start interr upt, communication end interrup t, frame end interrupt, or intie1 interrupt request signal is generated. (d) communication end flag (endtrans)...bit 3 a flag that indicates whether communication ends afte r the number of bytes set in the telegraph length field have been transferred. when a communicati on error occurs, the intie2 and intsta interrupt request signals are generated. set: this flag is set (1) when the count value of the scr register is 00h. clear: this flag is cleared (0) if the start interrupt, st atus transmission interrupt, frame end interrupt (if the communication end interrupt does not occur), or intie1 interrupt request signal is generated.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1043 (e) frame end flag (endfram)...bit 2 a flag that indicates whether communication ends afte r the maximum number of bytes (mode 1: 32 bytes, mode 2: 128 bytes) have been transferred. set: this flag is set (1) when the count value of the ccr register is 00h. clear: this flag is cleared (0) if the start inte rrupt, status transmission interrupt, communication end interrupt (if the frame end interrupt does not occur), or intie1 interrupt request signal is generated cautions 1. if both the ccr and scr regist ers are cleared to 00h, the endtrns and endfram bits are set (1) at the same time. 2. if the last data fi eld is the nack signal when the maximum number of transmitted bytes is reached as a result of retransmi tting the data, the endfram bit and ieerr (nack reception error) bit are set at the same time.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1044 (6) iebus error status register (esr) the esr register indicates the source of the communicati on error interrupt request signal of iebus. each bit of this register is set (1) as soon as the communication error flag (isr.ieerr bit) is set (1). the source of a communication error, if any, can be identified by checking the contents of this register. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. after reset: 00h r/w address: fffff365h <7> <6> <5> <4> <3> <2> 1 <0> esr terr perr nerr uerr oerr werr 0 deflag terr timing error occurrence flag 0 timing error did not occur 1 timing error occurred perr parity error occurrence flag 0 parity error did not occur 1 parity error occurred nerr nack reception error occurrence flag 0 nack reception error does not occur 1 nack reception error occurred uerr underrun error occurrence flag 0 underrun error did not occur 1 underrun error occurred oerr overrun error occurrence flag 0 overrun error did not occur 1 overrun error occurred werr write error occurrence flag 0 write error did not occur 1 write error occurred deflag third party error occurrence flag 0 error occurred during communication with unit 1 error occurred during communica tion with station other than unit cautions 1. each bit can only be cleared (0). it cannot be set (1) even if 1 is written to it. 2. the value of the esr register is updated wh en an error occurs. if the esr register is read at this time, however, an undefined value is read. it is recommended to read the esr register in error interrupt servicing. 3. if a communication error oc curs, the iebus controller return s to the default status and makes preparation for communi cation. if communication is started without the error corrected, the error fl ag accumulates the error. corr ect the error before the next communication is started. 4. be sure to set bit 1 to ?0?.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1045 (a) timing error occurr ence flag (terr)?bit 7 set: this flag is set (1) if a timing error occurs. clear: by software a timing error occurs if the high-/low-level width of the communication bit is not the defined value. the defined value of the high- and low-level width is se t to the bit processing block and monitored by the internal timer. if a timing erro r occurs, the interr and intie2 interrupt request signals are generated. (b) parity error occurr ence flag (perr)?bit 6 set: this flag is set (1) if a parity error occurs. clear: by software a parity error occurs if the parity generated in ea ch field does not match the received parity while the controller is serving as a receiver unit. if the par ity does not match in the data field during individual communication, however, the nack signal is returned and retransmission of data is requested. therefore, the parity error does not occur. table 20-14. operation if parity does not match field communication mode operati on if parity does not match master address field i ndividual/broadcast parity error occurs. slave address field individual/br oadcast parity error occurs. control data field individual/br oadcast parity error occurs. telegraph length field i ndividual/broadcast parity error occurs. individual retransmission is req uested by returning nack signal. data field broadcast parity error occurs. (c) nack reception error occurrence flag (nerr)?bit 5 set: this flag is set (1) if a nack reception error occurs. clear: by software a nack reception error occurs if the nack signal is received during the acknowledge bit period of the slave address field, control data field, or telegraph length field during individual communication, regardless of whether the controller is operati ng as the master or a slave. if the nack signal is received during the acknowledge bit period of the data field, a nack reception error does not occur because data is retransmitted. if the nack signal is received during t he acknowledge period of the last data field when the maximum number of transfer bytes is reached, the nack reception error occurs. the nack reception error does not occur during broa dcast communication because the ack/nack signal is not identified. the nack reception error does not occur during third- party communication because only the timing/parity error is detected as an error.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1046 (d) underrun error occurrence flag (uerr) ? bit 4 set: this flag is set (1) if an underrun error occurs. clear: by software an underrun error occurs if the next data is not tr ansmitted to the dr register in time before the ack signal is received. if the nack signal is received during individual communication and during the acknowledge bit period, the underrun error does not occur because the data is retransmitted. figure 20-13. timing of underrun error occurrence p . . . a data field data field pa request to write data to dr register underrun error occurs if data is not written to dr register during this period. intie1 remark p: parity bit a: acknowledge bit
chapter 20 iebus controller user?s manual u19201ej3v0ud 1047 (e) overrun error occurre nce flag (oerr) ? bit 3 set: this flag is set (1) if an overrun error occurs. clear: by software if 1-byte data is stored in the dr register while the i ebus controller serves as a receiver unit, the data request interrupt request signal (int ie1) is generated, and the dr register is read by means of dma or by software. if this reading is delayed and the ne xt data is received, an overrun error occurs. cautions 1. if the dr register is not read and the number of retransm itted data reaches the maximum number of transmitted bytes (32 byt es) after the overrun error has occurred, the frame end interrupt request signal (intst a or intie2) occurs. the overrun status is maintained until the dr register is read, even after the frame has ended. 2. the overrun status is cleared only when the dr register is re ad and when the system is reset. therefore, be sure to read the dr register in the communication error interrupt servicing program. 3. the next data cannot be transmitted in th e overrun status if it is 2 bytes or more. because the data request interrupt request signal (intie1) do es not occur, the transmit data cannot be set and an underr un error occurs. therefore, be sure to execute transmission after cl earing the overrun status. remark during individual communication reception, the nack signal is returned during the acknowledge bit period of the next data. in re sponse, the transmitter unit retransmits data. therefore, the ccr register is decremented but the scr re gister is not decremented. during broadcast communication reception, t he communication error interrupt request signal (intie2) is generated and recept ion is stopped. at this time, the dr register is not updated. the intie1 signal is not generat ed. the statrx bit of the ssr r egister is held set (to 1). the overrun status is cleared when data is re ceived after the dr register has been read. figure 20-14. timing of overrun error occurrence p . . . . . . a data field data field pa request to write data to dr register overrun error occurs if data is not written to dr register during this period. intie1 remark p: parity bit a: acknowledge bit
chapter 20 iebus controller user?s manual u19201ej3v0ud 1048 (f) write error occurrenc e flag (werr) ? bit 2 set: this flag is set (1) if a write error occurs. clear: by software a write error occurs if the data written to the dr regi ster is not transmitted in the data field during unit transmission. the timing of occurrence of a write error is illustrated below. figure 20-15. timing of write error occurrence . . . . . . data field acknowledge bit write error occurs if data is not written to dr register during this period. approx. 170 ns intie1 cautions 1. even when the we rr bit is set (1), the intie1 interrupt request signal may be generated. 2. if the nack signal is returned, th e werr bit is not set because data is retransmitted. (g) third-party error occu rrence flag (deflag)?bit 0 set: this flag is set (1) if a timing error or par ity error occurs during commu nication regardless of the unit (during communication between third parties). clear: by software caution if an error occurs be fore the third-party communicatio n starts even when the slave address field does not match that of the uni t (for example, if the nack signal is received when the received address does not match that of the unit in the slave address field (if the nerr bit is set (1))), the deflag bit is not set (1). remark communication between third parties may ta ke place in the fo llowing two cases. <1> if the received address in the slave address fi eld does not match that of the unit (during individual communication: matching with uar register, during broadcast communication: matching with group or fffh) and if communi cation continues after the ack signal has been received, the unit monitors that communication. <2> if the unit cannot respond to the received control data in the control field during broadcast communication and if communication continues, the unit monitors that communication. for example, this happens when the unit re ceives control data fh from master during broadcast communication but the slave rec eption enable flag of the unit is disabled (bcr.enslvrx bit = 0) (the nack signal is returned and communication ends during individual communication).
chapter 20 iebus controller user?s manual u19201ej3v0ud 1049 (7) iebus unit address register (uar) the uar register sets the unit address of an iebus uni t. this register must always be set before starting communication. sets the unit address (12 bits) to bits 11 to 0. this register can be read or written in 16-bit units. reset sets this register to 0000h. 15 0 14 0 13 0 12 0 uar 11 10 9 8 7 6 5 4 3 2 1 0 address fffff366h after reset 0000h r/w r/w caution do not set the uar register while co mmunication is enabled (bcr.eniebus bit = 1). (8) iebus slave address register (sar) during a master request, the value of this register is reflected in the value of the transmit data in the slave address field. the sar register must a lways be set before starting communication. the sar register sets the slave address (12 bits) to bits 11 to 0. this register can be read or written in 16-bit units. reset sets this register to 0000h. 15 0 14 0 13 0 12 0 sar 11 10 9 8 7 6 5 4 3 2 1 0 address fffff368h after reset 0000h r/w r/w caution be sure to set the sar re gister only at the following timing. ? when the bcr.eniebus bit is 0 ? between when the eniebus bit becomes 1 and the first master request is sent (the bcr.mstrq bit is set to 1) ? when the eniebus bit is 1, and the mstrq bi t is 0 and between eith er the end of that communication, frame, or error and the next m aster request (the mstrq bit is set to 1) (9) iebus partner address register (par) the par register stores the master address value received in the master address field regardless of whether the unit is operating as the master or a slave. if a request ?4h? to read the lock address (lower 8 bits) is received from the master, read the value of this register by software, and write the data of the lower 8 bits to the dr register. if a request ?5h? to read the lock address (higher 4 bits ) is received from the master, read the value of this register by software and write the data of bits 11 to 8 to the higher 4 bits of the dr register. the par register sets the partner address (12 bits) to bits 11 to 0. this register is read-only, in 16-bit units. reset sets this register to 0000h.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1050 15 0 14 0 13 0 12 0 par 11 10 9 8 7 6 5 4 3 2 1 0 address fffff36ah after reset 0000h r/w r caution the par register stores an address value if the parity is correct and the unit is not locked when the parity period of the m aster address field expires. if the par register is read at this time, an undefined value is read. (10) iebus receive slave address register (rsa) the rsa register stores the slave address value received in the slave address field regardless of whether the unit is operating as the master or a slave. this register is read-only, in 16-bit units. reset sets this register to 0000h. 15 0 14 0 13 0 12 0 rsa 11 10 9 8 7 6 5 4 3 2 1 0 address fffff36ch after reset 0000h r/w r caution the rsa register stores an address value if the parity is correct and the unit is not locked when the parity period of the slave address field expires. if th e rsa register is read at this time, an undefined value is read. (11) iebus control data register (cdr) the cdr register can be read or written in 8-bit units. reset sets this register to 00h. remark the cdr register consists of a write register and a read regist er and data written to the cdr register cannot be read as is. the data read from this register is the data received by iebus communication. (a) when master unit the data of the lower 4 bits is refl ected in the data transmitted in t he control field. during a master request, the cdr register must be set in advance before starting communication. (b) when slave unit the data received in the control field is written to the lower 4 bits. when the status transmission flag (isr.statusf bit) is set (1), an interrupt request signal (intie2) is issued, and each processing should be performed by soft ware, according to the value of the lower 4 bits of the cdr register.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1051 after reset: 00h r/w address: fffff36eh 7 6 5 4 3 2 1 0 cdr 0 0 0 0 mod selcl2 selcl1 selcl0 mod selcl2 selcl1 selcl0 function 0 0 0 0 read slave status 0 0 0 1 undefined 0 0 1 0 undefined 0 0 1 1 read data and lock 0 1 0 0 read lock address (lower 8 bits) 0 1 0 1 read lock address (lower 4 bits) 0 1 1 0 read slave status and unlock 0 1 1 1 read data 1 0 0 0 undefined 1 0 0 1 undefined 1 0 1 0 write command and lock 1 0 1 1 write data and lock 1 1 0 0 undefined 1 1 0 1 undefined 1 1 1 0 write command 1 1 1 1 write data cautions 1. because the slave unit mu st judge whether the received da ta is a ?command? or ?data?, read the value of the cdr register after completing communication. 2. if the master unit sets an undefined val ue, the slave unit retu rns the nack signal and communication is aborted. du ring broadcast communication, the master unit ignores the acknowledge bit and continues communication. therefore, do not se t an undefined value. 3. be sure to set bits 4 to 7 to ?0?.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1052 (c) slave status return operation when iebus receives a request to transfer from master to slave status or a lock address request (control data: 0h, 6h), whether the ack/nack signal in the control field is re turned or not depends on the status of the iebus unit. (1) if 0h or 6h control data was received in the unlocked state ack signal returned (2) if 4h or 5h control data was received in the unlocked state nack signal returned (3) if 0h, 4h, 5h or 6h control data was received in the locked state from the unit t hat sent the lock request ack signal returned (4) if 0h, 4h, or 5h control data was received in the locked state from other than the unit that sent the lock request ack signal returned (5) if 6h control data was received in the locked state from other than the unit that sent the lock request nack signal returned in all of the above cases, the a cknowledgment of a slave status or lock request will cause the statusf bit to be set (1) and the status interrupt signal (intie 2, intsta) to be generated. the generation timing is at the end of the control fiel d parity bit (at the start of the acknowled ge bit). however, if nack is returned, a nack receive error is generated after the acknowledge bit, and communication is terminated. figure 20-16. interrupt request signal ge neration timing (for (1), (3), and (4)) intie2, intsta signal set by reception of 0h, 4h, 5h, 6h iebus sequence cleared by software control field telegraph length field statusf bit internal nack flag 0 control bits (4 bits) parity bit (1 bit) acknowledge bit (1 bit) telegraph length bits (8 bits)
chapter 20 iebus controller user?s manual u19201ej3v0ud 1053 figure 20-17. interrupt request signa l generation timing (for (2) and (5)) intie2 intsta interr set by reception of 0h, 4h, 5h, 6h iebus sequence cleared by software set by detection of nack signal control field statusf bit internal nack flag control bit (4 bits) parity bit (1 bit) acknowledge bit (1 bit) terminated by communication error because in (4) and (5) the communication was from other than the unit that s ent the lock request while iebus was in the locked state, the start or communication end interrupt request signals (intie2, intsta) are not generated, even if the iebus unit is the communication targe t. the statusf bit is set (1) and the status interrupt request signals (intie2, intsta) are generated, however, if a slav e status or lock address request is acknowledged. note that even if the same control data is received while iebus is in the locked state, the interrupt generation timing for intie2 and in tsta differs depending on whether the master unit (3) or another unit (4) is requesting the locked state. figure 20-18. timing of intie2 and intsta interrupt request si gnal generation in locked state (for (4) and (5)) intie2, intsta iebus sequence status interrupt start master address (12 + p) broad- cast slave address (12 + p + a) control (4 + p + a) telegraph length note (8 + p + a) data note (8 + p + a) note the telegraph length and data modes are not set in t he case of (5) because the nack signal is returned. remark p: parity bit, a: acknowledge bit
chapter 20 iebus controller user?s manual u19201ej3v0ud 1054 figure 20-19. timing of intie2 a nd intsta interrupt request signal generation in locked state (for (3)) intie2, intsta iebus sequence status interrupt start master address (12 + p) broad- cast slave address (12 + p + a) control (4 + p + a) telegraph length (8 + p + a) communication end interrupt data (8 + p + a) start interrupt remark p: parity bit, a: acknowledge bit
chapter 20 iebus controller user?s manual u19201ej3v0ud 1055 (12) iebus telegraph length register (dlr) the dlr register can be read or written in 8-bit units. reset sets this register to 01h. (a) when transmission unit ... mast er transmission, slave transmission the data of this register is reflect ed in the data transmitted in the telegraph length field and indicates the number of bytes of the transmit data. the dlr register must be set in advance before transmission. (b) when reception unit ... mast er reception, slave reception the receive data in the telegraph length field trans mitted from the transmission unit is written to this register. remark the dlr register consists of a write register and a read register. consequently, data written to this register cannot be read as is. the data t hat can be read is the data received during iebus communication. after reset: 01h r/w address: fffff36fh 7 6 5 4 3 2 1 0 dlr bit 7 6 5 4 3 2 1 0 setting value remaining number of communication data bytes 0 0 0 0 0 0 0 1 01h 1 byte 0 0 0 0 0 0 1 0 02h 2 bytes : : : : : : : : : : 0 0 1 0 0 0 0 0 20h 32 bytes : : : : : : : : : : 1 1 1 1 1 1 1 1 ffh 255 bytes 0 0 0 0 0 0 0 0 00h 256 bytes cautions 1. when the master issu es a request (0h, 4h, 5h, or 6h) for transmission of a slave status or a lock address (higher 4 bits and lower 8 bits), 01h is transmitted as the telegr aph length regardless of the contents of the dlr register . it is therefore not necessary to set the dlr register by software. 2. when the iebus controller serves as a receiver unit, the dl r register stores a telegraph length if the value of the parity bit of the telegraph length field is correct. if the dlr register is read at this ti me, an undefined value is read.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1056 (13) iebus data register (dr) the dr register sets the communication data (8 bits) to bits 7 to 0. this register can be read or written in 8-bit units. reset sets this register to 00h. remark the dr register consists of a wr ite register and a read register. consequently, data written to this register cannot be read as is. the data that can be read is the data received during iebus communication. (a) when transmission unit the data (1 byte) written to the dr re gister is stored in the transmit shi ft register of the iebus interface block. it is then output from the most significant bit, and an interrupt request signal (intie1) is generated each time 1 byte has been transmitted. if the nack signal is received after 1-byte data has been transferred during individual transfer, data is not trans ferred from the dr register to the transmit shift register, and the same data is retransmitted. at this time, intie1 signal is not generated. intie1 signal is generated when the transmit shift register stores the dr register value. however, when the last byte and 32nd byte (the last byte of 1 co mmunication frame) is stored in the transmit shift register, the intie1 signal is not generated. (b) when reception unit one byte of the data received by t he receive shift register of the iebu s interface block is stored in this register. each time 1 byte has been correctly received, an interrupt request signal (intie1) is generated. when transmit/receive data is transferred to and from the dr register, using dma can reduce the cpu processing load. after reset: 00h r/w address: fffff370h 7 6 5 4 3 2 1 0 dr cautions 1. if the next data is not in time while the transmission unit is set , an underrun occurs, and a communication error interrupt request si gnal (intie2, interr) occurs, stopping transmission. 2. if data is not read in time before the next data is read when the iebus controller functions as a receiver unit during individual communicat ion reception, the nack signal is returned by the acknowledge bit of the data field, request ing the master to retransmit the data. if the dr register is not read after the data has reached the maximu m number of transmit bytes, however, the frame end interrupt re quest signal (intie2, intsta) and nack reception error interrupt request signal (intie 2, interr) are generated at the same time. 3. if data is not read in time before the next data is received wh en the iebus controller functions as a receiver unit during broadcast communication reception, an overrun error occurs and the communication erro r interrupt request signal (int ie2, interr) is generated. 4. when the iebus controller serves as a receiver unit, the dr register stores receive data if the value of the parity bit of the data field is correct. if the dr register is read at this time, an undefined value is read.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1057 (14) iebus field status register (fsr) the fsr register stores the status of the field status of the iebus controller if an interrupt request signal (intie1, intie2, intsta, or interr) is generated. this register is read-only, in 8-bit units. reset sets this register to 00h. cautions 1. if an interrupt request signal is generated during communicatio n between third parties, the fsr register is cleared to 00h. how ever, because only an in terrupt request signal that is generated if an error occurs is generated during comm unication between third parties, the error can be id entified as that during communi cation between third parties, by reading third-party error flag (esr.deflag bit). 2. the fsr register updates the status info rmation when an interrupt request signal is generated. if the fsr register is read at this time, however, an undefined value is read. 3. if another interrupt reque st signal is generate d before the fsr register is read, the status information when the preceding interrupt occurred is updated by the status information when the new interrupt occurs. 4. use the fsr register only for problem an alysis; do not use it with the actual software. 0 fsr 0 0 0 00 fstate1 fstate0 after reset: 00h r address: fffff371h 6543210 7 remark for the explanation of the fstate1 and fstate0 bits, see table 20-15 field status . table 20-15. field status explanation field status master/slave field tr ansmission/reception start field master address field slave address field control data field telegraph length field slave transmission status fsr = 00h slave operation data field reception telegraph length field slave transmission status fsr = 01h slave operation data field transmission telegraph length field master reception status fsr = 02h master operation data field reception start field master address field slave address field control data field telegraph length field master transmission status fsr = 03h master operation data field transmission
chapter 20 iebus controller user?s manual u19201ej3v0ud 1058 (15) iebus success count register (scr) the scr register indicates the number of remaining communication bytes. the count value of the counter in which the value set by the dlr register is decremented by the ack signal in the data field is read from this register. when the count value has reached ?00h?, the communication end flag (isr.endtrns bit) is set (1). this register is read-only, in 8-bit units. reset sets this register to 01h. after reset: 01h r address: fffff372h 7 6 5 4 3 2 1 0 scr bit 7 6 5 4 3 2 1 0 setting value remaining number of communication data bytes 0 0 0 0 0 0 0 1 01h 1 byte 0 0 0 0 0 0 1 0 02h 2 bytes : : : : : : : : : : 0 0 1 0 0 0 0 0 20h 32 bytes : : : : : : : : : : 1 1 1 1 1 1 1 1 ffh 255 bytes 0 0 0 0 0 0 0 0 00h 0 bytes (end of communication) or 256 bytes note note the actual counter consists of 9 bits. when ?00h? is read, it cannot be judged whether the remaining number of communication data bytes is 0 (end of communication) or 256. therefore, either the communication end flag (endtrns bit) is us ed, or if ?00h? is read when the first interrupt occurs at the beginning of communication, the re maining number of communication data bytes is judged to be 256. caution the scr register is updated when the pa rity period of the telegraph field expires and when the ack signal of the data field is received. if the scr re gister is read at this time, however, an undefined value is read.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1059 (16) iebus communication count register (ccr) the ccr register indicates the number of bytes remain ing from the communication byte number specified by the communication mode. this register indicates the number of transfer bytes. the maximum number of transmitted bytes per frame defi ned in each mode (mode 1: 32 bytes, mode 2: 128 bytes) is preset to this register. the count value of the counter that is decrem ented during the acknowledge bit period of the data field regardless of the ack/nack signal is read from this register. whereas the scr register is decremented during normal communication (a ck signal), the ccr register is decremented when 1 byte has been communicated, regardless of whether t he signal is ack or nack. when the count value has reached ?00h?, the frame end flag (isr.endfram bit) is set (1). the preset value of the maximum num ber of transmitted bytes per frame is 20h (32 bytes) in mode 1 and 80h (128 bytes) in mode 2. this register is read-only, in 8-bit units. reset sets this register to 20h. after reset: 20h r address: fffff373h 7 6 5 4 3 2 1 0 ccr caution the maximum number of transm it bytes is preset to the ccr register when the start bit is transmitted or received, and the register is d ecremented when the parity period of the data field expires. if the ccr register is read at this time, however, an und efined value is read.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1060 (17) iebus clock select register (ocks2) the ocks2 register selects the clock of iebus. the iebus clock frequencies (f ie ) that can be used are shown below. no other main clock frequencies can be used. this register can be read or written in 8-bit units. reset sets this register to 00h. ? 6.0 mhz/6.291456 mhz (6.29 mhz) ? 12.0 mhz/12.582912 mhz (12.58 mhz) ? 18.0 mhz/18.874368 mhz (18.87 mhz) ? 24.0 mhz/25.165824 mhz (25.16 mhz) ? 30.0 mhz/31.457280 mhz (31.45 mhz) 0 iebus clock operation stops iebus clock operation enabled ocksen2 0 1 iebus clock operation specification ocks2 0 0 ocksen2 ocksth2 0 ocks21 ocks20 f ie /2 (when f ie = 12.0 mhz or f ie = 12.58 mhz) f ie /3 (when f ie = 18.0 mhz or f ie = 18.87 mhz) f ie /4 (when f ie = 24.0 mhz or f ie = 25.16 mhz) f ie /5 (when f ie = 30.0 mhz or f ie = 31.45 mhz) f ie (when f ie = 6.0 mhz or f ie = 6.29 mhz) setting prohibited ocksth2 0 0 1 0 1 ocks21 0 0 1 1 0 ocks20 0 1 0 1 0 iebus clock selection after reset: 00h r/w address: fffff348h 6543210 7 other than above caution be sure to set bits 2 and 5 to 7 to ?0?. remark f ie : iebus clock frequency in clock mode 1, f ie = f xx in clock mode 2, f ie = f xmpll (29.28 to 32 mhz) in clock mode 3, f ie = f xmpll (29.28 to 32 mhz) in clock mode 4, f ie = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clocks
chapter 20 iebus controller user?s manual u19201ej3v0ud 1061 20.4 interrupt operations of iebus controller 20.4.1 interrupt control block interrupt request signal <1> communication error ieerr (i) timing error: terr (ii) parity error: perr (iii) nack receive error: nerr (iv) underrun error: uerr (v) overrun error: oerr (vi) write error: werr <2> start interrupt startf <3> status communication statusf <4> end of communication endtrns <5> end of frame endfram <6> transmit data write request stattx <7> receive data read request statrx a communication error <1> occurs if any of the above error sources (i) to (vi) is generated. these error sources are assigned to t he error status register (esr) (see table 20-18 communication error source processing list ). the above interrupt signals <1> to <5> ar e assigned to the isr register (see table 20-17 interrupt source list ). the configuration of t he interrupt control block is illustrated below.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1062 figure 20-20. configuration of interrupt control block intsta intie1 interr intie2 intc of v850e/sj3-h, v850e/sk3-h interrupt control block iebus controller startf statusf endtrns endfram stattx statrx terr perr nerr uerr oerr werr cautions 1. the logical sum (or) output of the st atrx and stattx signals is treated as an interrupt request signal (intie1). 2. the logical sum (or) output of the te rr, perr, nerr, uerr, oerr, and werr signals is treated as a communication error (ieerr) or an interrupt request signal (interr). 3. the logical sum (or) output of the startf, statusf, endtrns, and endfram signals is treated as an interrupt request signal (intsta). 4. the logical sum (or) output of the i eerr, startf, statusf, endtrns, and endfram signals (logical sum (or) output of intsta an d interr signals) is treated as an interrupt request signal (intie2). table 20-16. interrupt request signal generation source list interrupt request signal interrupt source symbol intie1 intie2 interr intsta communication error interrupt ieerr timing error terr parity error perr nack reception error nerr underrun error uerr overrun error oerr write error werr start interrupt startf status transmission statusf end of communication endtrns end of frame endfram transmit data write request stattx receive data write request statrx
chapter 20 iebus controller user?s manual u19201ej3v0ud 1063 20.4.2 example of identifying interrupt the iebus controller processes interrupts in the following two ways. ? using three interrupt request signals: intie1, interr, and intsta ? using two interrupt request signals: intie1 and intie2 caution mask the interrupt sources that are not used so that the interrupts do not occur. how an interrupt is identified in each of the above cases is explained below. (1) when intie1, interr, a nd intsta signals are used figure 20-21. example of identi fying intie1 signal interrupt (when intie1, interr, and intsta signals are used) transmission write processing intie1 signal generated reception read processing master transmission or slave transmission yes no figure 20 - 22. example of identifying interr signal interrupt (when intie1, interr, and intsta signals are used) interr signal generated esr register teer bit peer bit neer bit ueer bit oeer bit weer bit error source identification
chapter 20 iebus controller user?s manual u19201ej3v0ud 1064 figure 20-23. example of identi fying intsta signal interrupt (when intie1, interr, and intsta signals are used) intsta signal generated isr register ssr register startf bit start interrupt occurs cdr register statusf bit endtrns bit communication end identification endfram bit frame end identification status transmission identification status transmission processing arbitration loss detection arbit bit remaster processing 00h, 06h writing ssr register to dr register 04h writing lower 8 bits of par register to dr register 05h writing higher 4 bits of par register to dr register slvrq bit slave request identification (2) when intie1 and in tie2 signals are used figure 20-24. example of identifying intie1 signal in terrupt (when intie1 and intie2 signals are used) transmission write processing intie1 signal generated reception read processing master transmission or slave transmission yes no
chapter 20 iebus controller user?s manual u19201ej3v0ud 1065 figure 20-25. example of identifying intie2 signal in terrupt (when intie1 and intie2 signals are used) intie2 signal generated isr register ssr register startf bit ieerr bit start interrupt occurs communication error identification cdr register statusf bit endtrns bit communication end identification endfram bit frame end identification status transmission identification status transmission processing arbitration loss detection arbit bit remaster processing 00h, 06h 04h 05h slvrq bit slave request identification esr register teer bit peer bit neer bit ueer bit oeer bit weer bit error source identification writing ssr register to dr register writing lower 8 bits of par register to dr register writing higher 4 bits of par register to dr register
chapter 20 iebus controller user?s manual u19201ej3v0ud 1066 20.4.3 interrupt source list the interrupt request signals of the internal iebus c ontrollers in the v850e/sj3-h and v850e/sk3-h can be classified into vector interrupts and dma transfer interrupt s. these interrupt request signals can be specified via software manipulation. the interrupt sources are listed below. table 20-17. interrupt source list condition of generation interrupt source unit field software processing after generation of interrupt request signal remark timing error master/slave all fields other than data (individual) parity error reception all fields (broadcast) nack reception reception (transmission) other than data (individual) underrun error transmission data overrun error reception data (broadcast) communication error write error transmission data undo communication processing co mmunication error is logical sum (or) output of timing error, parity error, nack reception error, underrun error, overrun error, and write error. master slave/address slave request judgment arbitration judgment (if lost, remaster processing) communication preparation processing interrupt always occurs if lost in arbitration during master request start interrupt slave slave/address slave request judgment communication preparation processing generated only during slave request status transmission slave control refer to transmission processing example such as slave status. interrupt occurs regardless of slave transmission enable flag interrupt occurs if nack is returned in the control field. transmission data dma transfer end processing end of communication reception data dma transfer end processing receive data processing set if scr register is cleared to 00h transmission data retransmission preparation processing end of frame reception data re-reception preparation processing set if ccr register is cleared to 00h transmit data write transmission data reading of transmit data note set after transfer transmission data to internal shift register this does not occur when the last data is transferred. receive data read reception data reading of received data note set after normal data reception note if dma transfer or software manipulation is not executed.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1067 20.4.4 communication error source processing list the following table shows the occurrence conditions of t he communication errors (timing error, nack reception error, overrun error, underrun error, parity error, and write error), error processing by the iebus controller, and examples of processing by software. table 20-18. communication erro r source processing list (1/2) timing error unit status reception transmission occurrence condition if bit specification timing is not correct occurrence condition location of occurrence other than data field data field other than data field data field hardware processing ? reception stops. ? intie2 signal occurs. ? to start bit waiting status remark communication between other units does not end. ? transmission stops. ? intie2 signal occurs. ? to start bit waiting status broadcast communication software processing ? error processing (such as retransmission request) ? error processing (such as retransmission request) hardware processing ? reception stops. ? intie2 signal occurs. ? nack signal is returned. ? to start bit waiting status ? transmission stops. ? intie2 signal occurs. ? to start bit waiting status individual communication software processing ? error processing (such as retransmission request) ? error processing (such as retransmission request) nack reception error unit status reception transmission occurrence condition unit nack signal transmission unit nack signal transmission occurrence condition location of occurrence other than data field data field other than data field data field nack signal reception of data of 32nd byte hardware processing ? ? ? ? ? broadcast communication software processing ? ? ? ? ? hardware processing ? reception stops. ? intie2 signal occurs. ? to start bit waiting status ? intie2 signal does not occur. ? data retransmitted by other unit is received. ? reception stops. ? intie2 signal occurs. ? to start bit waiting status ? intie2 signal does not occur. ? retrans- mission processing ? intie2 signal occurs. ? to start bit waiting status individual communication software processing ? error processing (such as retransmission request) ? ? error processing (such as retransmission request) ? ? error processing (such as retransmission request)
chapter 20 iebus controller user?s manual u19201ej3v0ud 1068 table 20-18. communication erro r source processing list (2/2) overrun error underrun error/write error unit status reception transmission occurrence condition dr register cannot be read in time before the next data is received. dr register cannot be written in time before the next data is transmitted. occurrence condition location of occurrence other than data field data field other than data field data field hardware processing ? ? reception stops. ? intie2 signal occurs. ? to start bit waiting status remarks 1. communication between other units does not end. 2. data cannot be received until the overrun status is cleared. ? ? transmission stops. ? intie2 signal occurs. ? to start bit waiting status broadcast communication software processing ? ? dr register is read and overrun status is cleared. ? error processing (such as retransmission request) ? ? error processing (such as retransmission request) hardware processing ? ? intie2 signal does not occur. ? nack signal is returned. ? data is retransmitted from other unit. remark data cannot be received until overrun status is cleared. ? ? transmission stops. ? intie2 signal occurs. ? to start bit waiting status individual communication software processing ? ? dr register is read and overrun status is cleared. ? error processing (such as retransmission request) ? ? error processing (such as retransmission request) parity error unit status reception transmission occurrence condition received data and received parity do not match. ? occurrence condition location of occurrence other than data field data field other than data field data field hardware processing ? reception stops. ? intie2 signal occurs. ? to start bit waiting status remark communication between other units does not end. ? ? broadcast communication software processing ? error processing (such as retransmission request) ? ? hardware processing ? reception stops. ? intie2 signal occurs. ? to start bit waiting status ? reception does not stop. ? intie2 signal does not occur. ? nack signal is returned. ? data retransmitted by other unit is received. ? ? individual communication software processing ? error processing (such as retransmission request) ? ? ?
chapter 20 iebus controller user?s manual u19201ej3v0ud 1069 20.5 interrupt request signal generati on timing and main cpu processing 20.5.1 master transmission initial preparation processing: sets a unit address, slave address, control data, te legraph length, and the first byte of the transmit data. communication start processing: set the bcr register (enable communica tion, master request, and slave reception). figure 20-26. master transmission start broad- cast m address p s address p a control p a telegraph length p a data 1 pa data 1 data 2 p a data n ? 1 p a data n p a <1> <2> approx. 624 s (mode 1, at 6.29 mhz) approx. 390 s (mode 1, at 6.29 mhz) <1> interrupt request signal (intie2, intsta) occurrence judgment of occurrence of error note error processing judgment of slave request slave reception processing (see 20.5.1 (1) slave reception processing ) judgment of arbitration result remaster request processing <2> interrupt request signal (intie2, intsta) occurrence judgment of occurrence of error note error processing judgment of end of communication end of communication processing judgment of end of frame recommunication processing (see 20.5.1 (3) recommunication processing ) note this processing is necessary only when the intie2 in terrupt request signal is used as the start interrupt, and is not necessary when the intsta interrupt request signal is used (in this case, the error processing is performed by using the interr interrupt request signal). remarks 1. : interrupt request signal (intie1) occurrence (see 20.5.1 (2) interrupt request signal (intie1) occurrence ) the transmit data of the sec ond and subsequent bytes is wri tten to the dr register by dma transfer. at this time, the data transfer direction is ram on-chip peripheral i/o 2. : an interrupt request signal (intie1) does not occur. 3. n = final number of data bytes
chapter 20 iebus controller user?s manual u19201ej3v0ud 1070 (1) slave reception processing if a slave reception request is confirmed during vector in terrupt servicing, the data transfer direction of the macro service must change from ram on-chip peripheral i/o to on-chip peripheral i/o ram until the first data is received. the maximum pending period of this da ta transfer direction changing processing is about 1,040 s in communication mode 1 (at 6.29 mhz). (2) interrupt request signal (intie1) occurrence if the nack signal is received from the slave in the data field, an interrupt request signal (intie1) is not issued to the interrupt controller (intc), and the same data is retransmitted by hardware. if the transmit data is not written in time during the period of writing the next data, a communication error interrupt request signal (interr) occurs due to o ccurrence of underrun, and communication ends midway. (3) recommunication processing in the vector interrupt servicing in <2>, it is judg ed whether the data has been co rrectly transmitted within one frame. if the data has not been correctly transmitted (if the number of data to be transmitted in one frame could not be transmitted), the data must be retransmitted in the next frame, or the re mainder of the data must be transmitted.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1071 20.5.2 master reception before performing master reception, it is necessary to notify the unit that will be the sl ave of slave transmission. therefore, more than two communication fram es are necessary for master reception. the slave unit prepares the transmit data, sets (1) the slave transmission e nable flag (bcr.enslvtx bit), and waits. initial preparation processing: set a unit address, slave address, and control data. communication start processing: set the bcr register (enable communication and master request). figure 20-27. master reception approx. 1,014 s (mode 1, at 6.29 mhz) start broad- cast m address p s address p a control a p telegraph length a p data 1 approx. 390 s (mode 1, at 6.29 mhz) data 1 p a data 2 p a data n ? 1 p a data n p a < 2 > < 1 > <1> interrupt request signal (intie2, intsta) occurrence judgment of occurrence of error note error processing judgment of slave request slave processing judgment of arbitration result remaster request processing <2> interrupt request signal (intie2, intsta) occurrence judgment of occurrence of error note error processing judgment of end of communication end of communication processing judgment of end of frame frame end processing (see 20.5.2 (2) frame end processing ) note this processing is necessary only when the intie2 in terrupt request signal is used as the start interrupt, and is not necessary when the intsta interrupt request signal is used (in this case, the error processing is performed by using the interr interrupt request signal). remarks 1. : interrupt request signal (intie1) occurrence (see 20.5.2 (1) interrupt request signal (intie1) occurrence ) the receive data stored in the dr register is read by dma transfer. at this time, the data transfer direction is on-chip peripheral i/o ram. 2. n = final number of data bytes
chapter 20 iebus controller user?s manual u19201ej3v0ud 1072 (1) interrupt request signal (intie1) occurrence if the nack signal is transmitted (hardware processing) in the data field, an interrupt request signal (intie1) is not issued to the intc, and the same dat a is retransmitted from the slave. if the receive data is not read by the time the next dat a is received, the hardware automatically transmits the nack signal. (2) frame end processing in the vector interrupt servicing in <2>, it is judged whether the data has been correctly received within one frame. if the data has not been correctly received (if the number of data to be rece ived in one frame could not be received), a request to retransmit the data must be ma de to the slave in the next communication frame.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1073 20.5.3 slave transmission initial preparation processing: set a unit address, telegraph length, and the first byte of the transmit data. communication start processing: set the bcr register (enable communicati on, slave transmission, and slave reception). figure 20-28. slave transmission start m address p s address p a control p a data 1 pa data 1 data 2 p a data n ? 1 p a data n p a <1> <2> pa approx. 390 s (mode 1, at 6.29 mhz) approx. 624 s (mode 1, at 6.29 mhz) broad- cast telegraph length <1> interrupt request signal (intie2, intsta) occurrence judgment of occurrence of error note error processing judgment of slave request <2> interrupt request signal (intie2, intsta) occurrence judgment of occurrence of error note error processing judgment of end of communication end of communication processing judgment of end of frame frame end processing (see 20.5.3 (2) frame end processing ) note this processing is necessary only when the intie2 in terrupt request signal is used as the start interrupt, and is not necessary when the intsta interrupt request signal is used (in this case, the error processing is performed by using the interr interrupt request signal). remarks 1. : interrupt request signal (intie1) occurrence (see 20.5.3 (1) interrupt request signal (intie1) occurrence ). the transmit data of the sec ond and subsequent bytes is wri tten to the dr register by dma transfer. at this time, the data transfer direction is ram on-chip peripheral i/o. 2. : an interrupt request signal (intie1) does not occur. 3. : interrupt request signal (intie2) occurrence an interrupt request signal occurs only when 0h, 4h, 5h, or 6h is received in the control field in the slave status (for t he slave status response operatio n during the locked status, see 20.3 (11) iebus control data register (cdr) ). 4. n = final number of data bytes
chapter 20 iebus controller user?s manual u19201ej3v0ud 1074 (1) interrupt request signal (intie1) occurrence if the nack signal is received from the master in t he data field, an interrupt r equest signal (intie1) is not issued to the intc, and the same dat a is retransmitted by hardware. if the transmit data is not written in time during the period of writing the next data, a communication error interrupt request signal (interr) occurs due to occurrence of underrun, and communication is abnormally ended. (2) frame end processing in the vector interrupt servicing in <2>, it is judg ed whether the data has been co rrectly transmitted within one frame. if the data has not been correctly transmitted (if the number of data to be transmitted in one frame could not be transmitted), the data must be retransmitted in the next frame, or the remaining data must be transmitted.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1075 20.5.4 slave reception initial preparation processing: set a unit address. communication start processing: set the bcr register (enable communication, disa bles slave transmission, and enables slave reception). figure 20-29. slave reception start m address p s address p a control p a data 1 pa data 1 data 2 p a data n ? 1 p a data n p a <1> pa <2> approx. 390 s (mode 1, at 6.29 mhz) approx. 1,014 s (mode 1, at 6.29 mhz) broad- cast telegraph length <1> interrupt request signal (intie2, intsta) occurrence judgment of occurrence of error note error processing judgment of slave request slave processing <2> interrupt request signal (intie2, intsta) occurrence judgment of occurrence of error note error processing judgment of end of communication end of communication processing judgment of end of frame frame end processing (see 20.5.4 (2) frame end processing ). note this processing is necessary only when the intie2 in terrupt request signal is used as the start interrupt, and is not necessary when the intsta interrupt request signal is used (in this case, the error processing is performed by using the interr interrupt request signal). remarks 1. : interrupt request signal (intie1) occurrence (see 20.5.4 (1) interrupt request signal (intie1) occurrence ). the receive data stored in the dr register is read by dma transfer. at this time, the data transfer direction is on-chip peripheral i/o ram. 2. n = final number of data bytes
chapter 20 iebus controller user?s manual u19201ej3v0ud 1076 (1) interrupt request signal (intie1) occurrence if the nack signal is transmitted in the data field, an in terrupt request signal (intie1) is not issued to the intc, and the same data is retransmitted from the master. if the receive data is not read by the time the next data is received, the nack signal is automatically transmitted. (2) frame end processing in the vector interrupt servicing in <2>, it is judged whether the data has been correctly received within one frame.
chapter 20 iebus controller user?s manual u19201ej3v0ud 1077 20.5.5 interval of occurre nce of interrupt request signal for iebus control each control interrupt request signal must occur at each point of communication and perform the necessary processing until the next interrupt request signal occurs. t herefore, the iebus control blo ck is controlled by software, taking the shortest time of this interrupt reques t signal occurrence interval into consideration. the locations at which the following interrupt request signals may occur are indicated by in the field where it may occur. does not mean that the interrupt request signal occurs at each of the points indicated by . if an error interrupt request signal (timing error, parit y error, or nack receive error) occurs, t he iebus internal circuit is initialized. as a result, the following interrupt request signal does not occur in that communication frame. (1) master transmission figure 20-30. master transmission (interval of interrupt request signal occurrence) start bit t t1 t broad- cast master address t t2 p slave address t pa at t t3 control p a a t4 tat telegraph length p a data p a communication starts communication start interrupt pa data data a p data tt t4 end of communication end of frame u u t5 a remarks 1. t: timing error a: nack receive error u: underrun error : data set interrupt (intie1) 2. end of frame occurs at the end of 32-byte data. values in parentheses indicate mi n. value (iebus: mode 1, at 6.29 mhz). t1: communication starts timing error (approx. 93 s) t2: communication starts communication start interrupt (approx. 1,282 s) t3: communication start interrupt timing error (approx. 15 s) t4: communication start interrupt end of communication (approx. 1,012 s) t5: transmission data request interrupt interval (approx. 375 s)
chapter 20 iebus controller user?s manual u19201ej3v0ud 1078 (2) master reception figure 20-31. master reception (interval of interrupt request signal occurrence) pa pa pa pa pa p a data data data p t1 t communication starts start bit broad- cast master address slave address control telegraph length data tt a end of communication end of frame communication start interrupt tt t t t at t4 t4 t5 t2 a p t a t3 remarks 1. t: timing error p: parity error a: nack receive error : data set interrupt (intie1) 2. end of frame occurs at the end of 32-byte data. values in parentheses indicate mi n. value (iebus: mode 1, at 6.29 mhz). t1: communication starts timing error (approx. 93 s) t2: communication starts communication start interrupt (approx. 1,282 s) t3: communication start interrupt timing error (approx. 15 s) t4: communication start interrupt end of communication (approx. 1,012 s) t5: receive data read interval (approx. 375 s)
chapter 20 iebus controller user?s manual u19201ej3v0ud 1079 (3) slave transmission figure 20-32. slave transmission (interval of interrupt request signal occurrence) pa pa pa pa pa pa p t1 t tt u u tt t p p t t tt at t5 t4 t3 t6 t7 t7 t2 a p a communication starts end of communication end of frame communication start interrupt status request data data data start bit broad- cast master address slave address control data telegraph length remarks 1. t: timing error p: parity error a: nack receive error u: underrun error : data set interrupt (intie1) 2. end of frame occurs at the end of 32-byte data. values in parentheses indicate mi n. value (iebus: mode 1, at 6.29 mhz). t1: communication starts timing error (approx. 196 s) t2: communication starts communication start interrupt (approx. 1,192 s) t3: communication start interrupt timing error (approx. 15 s) t4: communication start interrupt status request (approx. 225 s) t5: transmission data request interrupt interval (approx. 375 s) t6: status request timing error (approx. 15 s) t7: status request end of communication (approx. 787 s)
chapter 20 iebus controller user?s manual u19201ej3v0ud 1080 (4) slave reception figure 20-33. slave reception (interval of interrupt request signal occurrence) pa pa pa pa pa p a p t1 t tt tt t p p tt at t4 t4 t5 t2 p a pt a t3 p o a p o p start bit data data data end of communication end of frame communication start interrupt communication starts broad- cast master address slave address control data telegraph length remarks 1. t: timing error p: parity error a: nack receive error o: overrun error : data set interrupt (intie1) 2. end of frame occurs at the end of 32-byte data. values in parentheses indicate mi n. value (iebus: mode 1, at 6.29 mhz). t1: communication starts timing error (approx. 196 s) t2: communication starts communication start interrupt (approx. 1,192 s) t3: communication start interrupt timing error (approx. 15 s) t4: communication start interrupt end of communication (approx. 1,012 s) t5: receive data read interval (approx. 375 s)
chapter 20 iebus controller user?s manual u19201ej3v0ud 1081 20.6 caution (1) switching dma transfer start factor in the v850e/sj3-h and v850e/sk3-h, the interr and intce0t signals note , and intsta and intce1t signals note , which are the dma transfer start factors, respective ly share the same pin, and they cannot be used at the same time. to use interr or intsta signal as the dma transfer start factor, set the dtfrob0 bit of the option byte 0000007ah to 0 (see chapter 33 option byte function ). in this case, the intce0t note and intce1t note signals cannot be used as the dma transfer start factor. note not available in the pd70f3931 (v850e/sj3 -h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) remark for details, see table 22-1 dma transfer start factors .
user?s manual u19201ej3v0ud 1082 chapter 21 can controller caution the can controller is allocated in the programmable peripheral i/o area. before using the can controller, enable use of the programmable periphe ral i/o area by using the bpc register. for details, refer to 3.4.7 pr ogrammable peripheral i/o registers. 21.1 overview the v850e/sj3-h and v850e/sk3-h feat ure an on-chip 1-channel or 2-channel can (controller area network) controller that complies with the can protocol as standardized in iso 11898. the v850e/sj3-h and v850e/sk3-h products with an on-chip can controller are as follows. ? pd70f3475, 70f3476, 70f 3478, 70f3479, 70f3481, 70f3482, 70f3487, 70f34 88, 70f3926, 70f3927, 70f3932, 70f3933, 70f3935, 70f3936, 70f3938, 70f3939 the v850e/sj3-h and v850e/sk3-h products with an on-ch ip 2-channel can controller are as follows. ? pd70f3476, 70f3479, 70f3 482, 70f3488, 70f3927, 70f 3933, 70f3936, 70f3939 21.1.1 features ? compliant with iso 11898 and tested according to iso/dis 16845 (can conformance test) ? standard frame and extended fram e transmission/reception enabled ? transfer rate: 1 mbps max. (can clock input 8 mhz) ? 32 message buffers/channels ? receive/transmit history list function ? automatic block transmission function ? multi-buffer receive block function ? mask setting of four patterns is possible for each channel
chapter 21 can controller user?s manual u19201ej3v0ud 1083 21.1.2 overview of functions table 21-1 presents an overview of the can controller functions. table 21-1. overview of functions function details protocol can protocol iso 11898 (standard and extended frame transmission/reception) baud rate maximum 1 mbps (can clock input 8 mhz) data storage storing messages in the can ram number of messages ? 32 message buffers/channels ? each message buffer can be set to be either a transmit message buffer or a receive message buffer. message reception ? unique id can be set to each message buffer. ? mask setting of four patterns is possible for each channel. ? a receive completion interrupt is generated each time a message is received and stored in a message buffer. ? two or more receive message buffers can be used as a fifo receive buffer (multi-buffer receive block function). ? receive history list function message transmission ? unique id can be set to each message buffer. ? transmit completion interrupt for each message buffer ? message buffer numbers 0 to 7 specified as transmit message buffers can be used for automatic block transfer. message transmis sion interval is programmable (automatic block transmission function (herea fter referred to as ?abt?)). ? transmission history list function remote frame processing remote frame processing by transmit message buffer time stamp function ? the time stamp function can be set for a re ceive message when a 16-bit timer is used in combination. ? the time stamp capture trigger can be se lected (sof or eof in a can message frame can be detected). diagnostic function ? readable error counters ? ?valid protocol operation flag? for verification of bus connections ? receive-only mode ? single-shot mode ? can protocol error type decoding ? self-test mode release from bus-off state ? can be forcibly released from bus-off by so ftware (timing restrictions are ignored). ? cannot be automatically released from bus-o ff (release request by software is required). power save mode ? can sleep mode (can be woken up by can bus) ? can stop mode (cannot be woken up by can bus)
chapter 21 can controller user?s manual u19201ej3v0ud 1084 21.1.3 configuration the can controller is composed of the following four blocks. (1) npb interface this functional block provides an npb (nec peripheral i/o bus) interf ace and means of transmitting and receiving signals between the can module and the host cpu. (2) mcm (memory control module) this functional block controls access to the can prot ocol layer and to the can ram within the can module. (3) can protocol layer this functional block is involved in the oper ation of the can protocol and its related settings. (4) can ram this is the can memory functional block, which is used to store message ids, message data, etc. figure 21-1. block diagram of can module ctxdn crxdn cpu can module can ram npb (nec peripheral i/o bus) mcm (memory control module) npb interface interrupt request intcntrx intcnrec intcnerr intcnwup can protocol layer can transceiver message buffer 0 message buffer 1 message buffer 2 message buffer 3 message buffer 31 cnmask1 cnmask2 cnmask3 cnmask4 ... can_hn can_ln can bus tsout remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1085 21.2 can protocol can (controller area network) is a high-speed multiplex communication protocol for real-time communication in automotive applications (class c). can is prescribed by iso 11898. for details, refer to the iso 11898 specifications. the can specification is generally divided into two layers : a physical layer and a data link layer. in turn, the data link layer includes logical link and medium access control. the composition of these layers is illustrated below. figure 21-2. composition of layers physical layer prescription of signal level and bit description data link layer note logical link control (llc) medium access control (mac) acceptance filtering overload report recovery management data capsuled/not capsuled frame coding (stuffing/no stuffing) medium access management error detection error report acknowledgment seriated/not seriated higher lower note can controller specification 21.2.1 frame format (1) standard format frame ? the standard format frame uses 11-bit identifiers, wh ich means that it can handle up to 2,048 messages. (2) extended format frame ? the extended format frame uses 29-bit (11 bits + 18 bits) identifiers, which increases the number of messages that can be handled to 2,048 2 18 messages. ? an extended format frame is set when ?recessive level? (cmos level of ?1?) is set for both the srr and ide bits in the arbitration field.
chapter 21 can controller user?s manual u19201ej3v0ud 1086 21.2.2 frame types the following four types of frames are used in the can protocol. table 21-2. frame types frame type description data frame frame used to transmit data remote frame frame used to request a data frame error frame frame used to report error detection overload frame frame used to delay the next data frame or remote frame (1) bus value the bus values are divided into dominant and recessive. ? dominant level is indicated by logical 0. ? recessive level is indicated by logical 1. ? when a dominant level and a recessive level are transmitted simultaneously, the bus value becomes dominant level. 21.2.3 data frame and remote frame (1) data frame a data frame is composed of seven fields. figure 21-3. data frame r d interframe space end of frame (eof) ack field crc field data field control field arbitration field start of frame (sof) data frame <1> <2> <3> <4> <5> <6> <7> <8> remark d: dominant = 0 r: recessive = 1
chapter 21 can controller user?s manual u19201ej3v0ud 1087 (2) remote frame a remote frame is composed of six fields. figure 21-4. remote frame r d interframe space end of frame (eof) ack field crc field control field arbitration field start of frame (sof) remote frame <1> <2> <3> <5> <6> <7> <8> remarks 1. the data field is not transferred even if the cont rol field?s data length code is not ?0000b?. 2. d: dominant = 0 r: recessive = 1 (3) description of fields <1> start of frame (sof) the start of frame field is located at t he start of a data frame or remote frame. figure 21-5. start of frame (sof) r d 1 bit start of frame (interframe space or bus idle) (arbitration field) remark d: dominant = 0 r: recessive = 1 ? if a dominant level is detected in the bus idle st ate, a hardware synchronization is performed (the current tq is assigned to be the sync segment). ? if a dominant level is sampled at the sample point following such a hardware synchronization, the bit is assigned to be a sof. if a recessive level is detec ted, the protocol layer returns to the bus idle state and regards the preceding domin ant pulse as a noise only. in this case an error frame is not generated.
chapter 21 can controller user?s manual u19201ej3v0ud 1088 <2> arbitration field the arbitration field is used to set the priori ty, data frame/remote frame, and frame format. figure 21-6. arbitration field (in standard format mode) r d ide (r1) r0 rtr identifier arbitration field (control field) (11 bits) id28 . . . . . . . . . . . . . . . . . . . . id18 (1 bit) (1 bit) cautions 1. id28 to id18 are identifiers. 2. an identifier is transmitted msb first. remark d: dominant = 0 r: recessive = 1 figure 21-7. arbitration field (in extended format mode) r d r1 r0 rtr ide srr identifier identifier arbitration field (control field) (11 bits) (18 bits) id28 id18 id17 id0 (1 bit) (1 bit) (1 bit) cautions 1. id28 to id18 are identifiers. 2. an identifier is transmitted msb first. remark d: dominant = 0 r: recessive = 1 table 21-3. rtr frame settings frame type rtr bit data frame 0 (d) remote frame 1 (r) table 21-4. frame format setting (ide bit) and number of identifier (id) bits frame format srr bit ide bit number of bits standard format mode none 0 (d) 11 bits extended format mode 1 (r) 1 (r) 29 bits
chapter 21 can controller user?s manual u19201ej3v0ud 1089 <3> control field the control field sets ?dlc? as the number of dat a bytes in the data field (dlc = 0 to 8). figure 21-8. control field r d r1 (ide) r0 rtr dlc2 dlc3 dlc1 dlc0 control field (data field) (arbitration field) remark d: dominant = 0 r: recessive = 1 in a standard format frame, the control fiel d?s ide bit is the same as the r1 bit. table 21-5. data length setting data length code dlc3 dlc2 dlc1 dlc0 data byte count 0 0 0 0 0 bytes 0 0 0 1 1 byte 0 0 1 0 2 bytes 0 0 1 1 3 bytes 0 1 0 0 4 bytes 0 1 0 1 5 bytes 0 1 1 0 6 bytes 0 1 1 1 7 bytes 1 0 0 0 8 bytes other than above 8 bytes regardless of the value of dlc3 to dlc0 caution in the remote frame, there is no data field even if the data length code is not 0000b.
chapter 21 can controller user?s manual u19201ej3v0ud 1090 <4> data field the data field contains the amount of data (byte units) se t by the control field. up to 8 units of data can be set. figure 21-9. data field r d data 0 (8 bits) msb lsb data 7 (8 bits) msb lsb data field (crc field) (control field) remark d: dominant = 0 r: recessive = 1 <5> crc field the crc field is a 16-bit field that is used to check for errors in transmit data. figure 21-10. crc field r d crc sequence crc delimiter (1 bit) (15 bits) crc field (ack field) (data field or control field) remark d: dominant = 0 r: recessive = 1 ? the polynomial p(x) used to generate the 15-bi t crc sequence is expressed as follows. p(x) = x 15 + x 14 + x 10 + x 8 + x 7 + x 4 + x 3 + 1 ? transmitting node: transmits the crc sequence calculat ed from the data (before bit stuffing) in the start of frame, arbitration fiel d, control field, and data field. ? receiving node: compares the crc sequence ca lculated using data bits that exclude the stuffing bits in the receive data with the crc sequence in the crc field. if the two crc sequences do not match, the node issues an error frame.
chapter 21 can controller user?s manual u19201ej3v0ud 1091 <6> ack field the ack field is used to acknowledge normal reception. figure 21-11. ack field r d ack slot (1 bit) ack delimiter (1 bit) ack field (end of frame) (crc field) remark d: dominant = 0 r: recessive = 1 ? if no crc error is detected, the receiving node sets the ack slot to the dominant level. ? the transmitting node outputs two recessive-level bits. <7> end of frame (eof) the end of frame field indicates the end of data frame/remote frame. figure 21-12. end of frame (eof) r d end of frame (7 bits) (interframe space or overload frame) (ack field) remark d: dominant = 0 r: recessive = 1
chapter 21 can controller user?s manual u19201ej3v0ud 1092 <8> interframe space the interframe space is inserted after a data frame, remote frame, error frame, or overload frame to separate one frame from the next. ? the bus state differs dep ending on the error status. (a) error active node the interframe space consists of a 3-bit intermission field and a bus idle field. figure 21-13. interframe space (error active node) r d interframe space intermission (3 bits) bus idle (0 to bits) (frame) (frame) remarks 1. bus idle: state in which the bus is not used by any node. 2. d: dominant = 0 r: recessive = 1 (b) error passive node the interframe space consists of an intermission fi eld, a suspend transmission field, and a bus idle field. figure 21-14. interframe space (error passive node) r d interframe space intermission (3 bits) suspend transmission (8 bits) bus idle (0 to bits) (frame) (frame) remarks 1. bus idle: state in which the bus is not used by any node. suspend transmission: sequence of 8 re cessive-level bits transmitted from the node in the error passive status. 2. d: dominant = 0 r: recessive = 1 usually, the intermission field is 3 bits. if the transmitting node detects a domin ant level at the third bit of the intermission field, ho wever, it executes transmission.
chapter 21 can controller user?s manual u19201ej3v0ud 1093 ? operation in error status table 21-6. operation in error status error status operation error active a node in this status can transmit immediately after a 3-bit intermission. error passive a node in this status can transmit 8 bits after the intermission.
chapter 21 can controller user?s manual u19201ej3v0ud 1094 21.2.4 error frame an error frame is output by a node that has detected an error. figure 21-15. error frame <1> r d <2> <3> 6 bits 0 to 6 bits 8 bits (<4>) (<5>) interframe space or overload frame error delimiter error flag 2 error flag 1 error bit error frame remark d: dominant = 0 r: recessive = 1 table 21-7. definition of error frame fields no. name bit count definition <1> error flag 1 6 error active node: outputs 6 domin ant-level bits consecutively. error passive node: outputs 6 rece ssive-level bits consecutively. if another node outputs a dominant level while one node is outputting a passive error flag, the passive error flag is not cleared until the same level is detected 6 bits in a row. <2> error flag 2 0 to 6 nodes receiving error flag 1 detect bit stuff errors and issues this error flag. <3> error delimiter 8 outputs 8 recessive-level bits consecutively. if a dominant level is detected at the 8th bit, an overload frame is transmitted from the next bit. <4> error bit ? the bit at which the error was detected. the error flag is output from the bit next to the error bit. in the case of a crc error, this bit is output following the ack delimiter. <5> interframe space/overload frame ? an interframe space or overload frame starts from here.
chapter 21 can controller user?s manual u19201ej3v0ud 1095 21.2.5 overload frame an overload frame is transmitted under the following conditions. ? when the receiving node has not co mpleted the reception operation note ? if a dominant level is detected at the first two bits during intermission ? if a dominant level is detected at the last bit (7th bit) of the end of frame or at the last bit (8th bit) of the error delimiter/overload delimiter note in this can controller, all reception frames can be loaded without outputti ng an overload frame because of the enough high-speed internal processing. figure 21-16. overload frame <1> r d <2> <3> 6 bits 0 to 6 bits 8 bits (<4>) (<5>) interframe space or overload frame overload delimiter overload flag (node n) overload flag (node m) frame overload frame remark d: dominant = 0 r: recessive = 1 node n node m table 21-8. definition of overload frame fields no name bit count definition <1> overload flag 6 outputs 6 domin ant-level bits consecutively. <2> overload flag from other node 0 to 6 the node that received an overload flag in the interframe space outputs an overload flag. <3> overload delimiter 8 outputs 8 recessive-level bits consecutively. if a dominant level is detected at the 8th bit, an overload frame is transmitted from the next bit. <4> frame ? output following an end of frame, error delimiter, or overload delimiter. <5> interframe space/overload frame ? an interframe space or overload frame starts from here.
chapter 21 can controller user?s manual u19201ej3v0ud 1096 21.3 functions 21.3.1 determining bus priority (1) when a node starts transmission: ? during bus idle, the node that out put data first transmits the data. (2) when more than one n ode starts transmission: ? the node that consecutively outputs the dominant level for the longest from the first bit of the arbitration field has the bus priority (if a dominant level and a recess ive level are simultaneously transmitted, the dominant level is taken as the bus value). ? the transmitting node compares its output arbi tration field and the data level on the bus. table 21-9. determining bus priority level match continuous transmission level mismatch continuous transmission (3) priority of data frame and remote frame ? when a data frame and a remote frame are on the bus, t he data frame has priority because its rtr bit, the last bit in the arbitration field, carries a dominant level. remark if the extended-format data frame and the standard-format remote frame conflict on the bus (if id28 to id18 of both of them are the same), the standard-format re mote frame takes priority. 21.3.2 bit stuffing bit stuffing is used to establish synchronization by appending 1 bit of inverted-level data if the same level continues for 5 bits, in order to prevent a burst error. table 21-10. bit stuffing transmission during the transmission of a data frame or remote frame, when the same level continues for 5 bits in the data between the start of frame and the ack field, 1 inverted-level bit of data is inserted before the following bit. reception during the reception of a data frame or remote frame, when the same level continues for 5 bits in the data between the start of frame and the ack field, re ception is continued after deleting the next bit. 21.3.3 multi masters as the bus priority (a node which acquires transmission ri ghts) is determined by the identifier, any node can be the bus master. 21.3.4 multi cast although there is one transmitting node, two or more nodes can receive the same data at the same time because the same identifier can be set to two or more nodes.
chapter 21 can controller user?s manual u19201ej3v0ud 1097 21.3.5 can sleep mode/can stop mode function the can sleep mode/can stop mode func tion puts the can controller in waiting mode to achieve low power consumption. the controller is woken up from the can sleep mode by bus operation but it is not woken up from the can stop mode by bus operation (the can stop mode is controlled by cpu access). 21.3.6 error control function (1) error types table 21-11. error types description of error detection state type detection method detection condition transmission/ reception field/frame bit error comparison of the output level and level on the bus mismatch of levels transmitting/ receiving node bit that is outputting data on the bus at the start of frame to end of frame, error frame and overload frame. stuff error check of the receive data at the stuff bit 6 consecutive bits of the same output level receiving node start of frame to crc sequence crc error comparison of the crc sequence generated from the receive data and the received crc sequence mismatch of crc receiving node crc field form error field/frame check of the fixed format detection of fixed format violation receiving node crc delimiter ack field end of frame error frame overload frame ack error check of the ack slot by the transmitting node detection of recessive level in ack slot transmitting node ack slot (2) output timing of error frame table 21-12. output timing of error frame type output timing bit error, stuff error, form error, ack error error frame output is started at the timing of the bit following the detected error. crc error error frame output is started at the timing of the bit following the ack delimiter. (3) processing in case of error the transmission node re-transmits the data frame or remo te frame after the error frame. (however, it does not re-transmit the frame in the single-shot mode.)
chapter 21 can controller user?s manual u19201ej3v0ud 1098 (4) error state (a) types of error states the following three types of error states are defined by the can specification. ? error active ? error passive ? bus-off these types of error states are classified by the values of the cnerc.tec7 to cnerc.tec0 bits (transmission error counter bits) and the cnerc.rec6 to cnerc.rec0 bits (reception error counter bits) as shown in table 21-13. the present error state is indi cated by the cninfo register. when each error counter value becomes equal to or greater than the error warning level (96), the cninfo.tecs0 or cninfo.recs0 bit is set to 1. in this case, the bus state must be tested because it is considered that the bus has a serious fault. an error counter value of 128 or more indicates an error passive state and the tecs1 or recs1 bit is set to 1. ? if the value of the transmission error counter is gr eater than or equal to 256 (actually, the transmission error counter does not indicate a value greater than or equal to 256), the bus-off state is reached and the cninfo.boff bit is set to 1. ? if only one node is active on the bus at startup (i.e., when the bus is connected only to the local station), ack is not returned even if data is transmitted. consequently, re-t ransmission of the error frame and data is repeated. in the error passive state, howev er, the transmission error c ounter is not incremented and the bus-off state is not reached. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1099 table 21-13. types of error states type operation value of error counter indication of cninfo register operation specific to error state transmission 0 to 95 tecs1, tecs0 = 00 reception 0 to 95 recs1, recs0 = 00 transmission 96 to 127 tecs1, tecs0 = 01 error active reception 96 to 127 recs1, recs0 = 01 ? outputs an active error flag (6 consecutive dominant- level bits) on detection of the error. transmission 128 to 255 tecs1, tecs0 = 11 error passive reception 128 or more recs1, recs0 = 11 ? outputs a passive error flag (6 consecutive recessive-level bits) on detection of the error. ? transmits 8 recessive-level bits, in between transmissions, following an intermission (suspend transmission). bus-off transmission 256 or more (not indicated) note boff = 1, tecs1, tecs0 = 11 ? communication is not possible. however, when the frame is received, no messages are stored and the following operations are performed. <1> tsout toggles. <2> rec is incremented/decremented. <3> valid bit is set. ? if the initialization mode is set, after request to transit to an operation mode other than the initialization mode, 11 consecutive rece ssive-level bits are generated 128 times, and then the error counter is reset to 0 and the error active state can be restored. note the value of the transmit error counter (tec) does not carry any meaning if boff has been set. if an error that increments the value of the trans mission error counter by 8 while the counter value is in a range of 248 to 255 occurs, the counter is not increment ed and the bus-off state is assumed. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1100 (b) error counter the error counter counts up when an error has occu rred, and counts down upon successful transmission and reception. the error counter count s up immediately after error detection. table 21-14. error counter state transmission error counter (tec7 to tec0 bits) reception error counter (rec6 to rec0 bits) receiving node detects an error (except bit error in the active error flag or overload flag). no change +1 (reps bit = 0) receiving node detects dominant level following error flag of error frame. no change +8 (reps bit = 0) transmitting node transmits an error flag. [as exceptions, the error counter does not change in the following cases.] <1> ack error is detected in error passive state and dominant level is not detected while the passive error flag is being output. <2> a stuff error is detected in an arbitration field that transmitted a recessive level as a stuff bit, but a dominant level is detected. +8 no change bit error detection while active error flag or overload flag is being output (error-active transmitting node) +8 no change bit error detection while active error flag or overload flag is being output (error-active receiving node) no change +8 (reps bit = 0) when the node detects 14 consecutive dominant-level bits from the beginning of the active error flag or overload flag, and then subsequently detects 8 consecutive dominant-level bits. when the node detects 8 consecutive dominant levels after a passive error flag +8 (transmitting) +8 (receiving, reps bit = 0) when the transmitting node has co mpleted transmission without error ( 0 if error counter = 0) ?1 no change when the receiving node has completed reception without error no change ? ?1 (1 rec6 to rec0 127, reps bit = 0) ? 0 (rec6 to rec0 = 0, reps bit = 0) ? any value of 119 to 127 is set (reps bit = 1) (c) occurrence of bit error in intermission an overload frame is generated. caution if an error occurs, it is controlled according to the cont ents of the transmission error counter and reception error counter before th e error occurred. the value of the error counter is incremented after th e error flag has been output.
chapter 21 can controller user?s manual u19201ej3v0ud 1101 (5) recovery from bus-off state when the can module is in the bus-off state, the transmission pins (ctxdn ) cut off from the can bus always output the recessive level. the can module recovers from the bus-off stat e in the following bus-off recovery sequence. <1> request to enter the can initialization mode <2> request to enter a can operation mode (a) recovery operation through normal recovery sequence (b) forced recovery operation that skips recovery sequence (a) recovery from bus-off state through normal recovery sequence the can module first issues a request to enter the init ialization mode (refer to timing <1> in figure 21-17). this request will be immediately acknowledged, and the c0ctrl.opmode2 to opmode0 bits are cleared to 000b. processing such as analyzing the fa ult that has caused the bus -off state, re-defining the can module and message buffer using application softw are, or stopping the oper ation of the can module can be performed by clearing the cngmctrl.gom bit to 0. next, the module requests to change the mode from t he initialization mode to an operation mode (refer to timing <2> in figure 21-17). this starts an operation to recover the can module from the bus-off state. the conditions under which the module can recove r from the bus-off state are defined by the can protocol iso 11898, and it is necessary to detect 11 c onsecutive recessive-level bits more than 128 times. at this time, the request to change the mode to an operation mode is held pending until the recovery conditions are satisfied. when the recovery conditions are satisfied (refer to timing <3> in figure 21-17), the can module can enter the oper ation mode it has requested. until the can module enters this operation mode, it stays in the init ialization mode. whether the can module has completed transition to any other operation mode can be confirmed by reading the opmode2 to opmode0 bits. before transition to any other operation mode is comple ted, opmode2 to opmode0 bits = 000b is read. during the bus-off period and bus-off recovery sequence, the cninfo.boff bit stays set (to 1). in the bus-off recovery sequence, the reception error c ounter (cnerc.rec0 to cnerc.rec6) counts the number of times 11 consecutive recessive-level bi ts have been detected on the bus. therefore, the recovery state can be checked by reading the rec0 to rec6 bits. cautions 1. if a request to change the mode fr om the initialization mode to any operation mode to execute the bus-off recover y sequence again during a bus-off recovery sequence, the bus-off recovery sequence starts from the beginning and 11 contiguous recessive bits are counted 128 times again on the bus. 2. in the bus-off recovery seq uence, the rec0 to rec6 bits counts up (+1) each time 11 consecutive recessive-level bits have been detected. even during the bus-off period, the can module can enter the can sleep mode or can stop mode. to be released from the bus-off state, the module must enter the initialization mode once. if the module is in the can sleep mode or can stop mode, however, it cannot directly enter the initialization mode. in this case, the bus off recovery sequence is started at the same time as the can sleep mode is released even without shifting to the initialization mode. in addition to clearing the cn ctrl.psmode1 and cnctrl.psmode0 bits by software, the bus off recovery sequence is also started due to wakeup by dominant edge detection on the can bus (while the can clock is supplied, the cnctrl.psmode0 bit must be cleared by software after a dominant edge is detected.) . remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1102 figure 21-17. recovery from bus-o ff state through normal recovery sequence ?error-passive? 00h 00h 00h 00h 80h tec[7:0] ffh boff bit in cninfo register opmode[2:0] in cnctrl register (written by user) opmode[2:0] in cnctrl register (read by user) tec[7:0] in cnerc register rec[7:0] in cnerc register tec > ffh 00h 00h 00h ffh < tec [7:0] ?bus-off? ?bus-off-recovery-sequence? ?error-active? 00h tec[7:0] < 80h 00h rec[7:0] < 80h 00h rec[7:0] 80h <1> <2> <3> undefined remark n = 0, 1 (b) forced recovery operation that skips bus-off recovery sequence the can module can be forcibly released from the bus -off state, regardless of the bus state, by skipping the bus-off recovery sequence. here is the procedure. first, the can module requests to enter the initiali zation mode. for the oper ation and points to be noted at this time, see 21.3.6 (5) (a) recovery from bus-off st ate through normal recovery sequence . next, the module requests to enter an operation mo de. at the same time, the cnctrl.ccerc bit must be set to 1. as a result, the bus-off recovery sequence defined by the can protocol is o 11898 is skipped, and the module immediately enters the operation mode. in this case, the module is connected to the can bus after it has monitored 11 consecutive recessive-level bits. for details, refer to the processing in figure 21-54. caution this function is not defined by the can pr otocol iso 11898. when using this function, thoroughly evaluate its effe ct on the network system. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1103 (6) initializing can module error counter re gister (cnerc) in initialization mode if it is necessary to initialize the cnerc and cninfo registers for debugging or evaluating a program, they can be initialized to the default value by setting the cnctrl.ccerc bit in the initialization mode. when initialization has been completed, the ccerc bit is automatically cleared to 0. cautions 1. this function is enabled only in the init ialization mode. even if the ccerc bit is set to 1 in a can operation mode, the cnerc and cn info registers are not initialized. 2. the ccerc bit can be set at the same ti me as the request to enter a can operation mode. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1104 21.3.7 baud rate control function (1) prescaler the can controller has a presca ler that divides the clock (f can ) supplied to can. this prescaler generates a can protocol layer base clock (f tq ) that is the can module system clock (f canmod ) divided by 1 to 256 (see 21.6 (12) cann module bit rate prescaler register (cnbrp) ). (2) data bit time (8 to 25 time quanta) one data bit time is defined as shown in figure 21-18. 1 time quanta = 1/f tq the can controller sets the data bit time by replacing it with the bit timing parameters such as time segment 1, time segment 2, and resynchronization jump width (sjw ), as shown in figure 21-18. time segment 1 is equivalent to the total of the prop agation (prop) segment and phase segment 1 that are defined by the can protocol specification. time segment 2 is equivalent to phase segment 2. figure 21-18. segment setting data bit time (dbt) phase segment 1 prop segment sync segment phase segment 2 time segment 1 (tseg1) time segment 2 (tseg2) sample point (spt) segment name settable range notes on setting to conform to can specification time segment 1 (tseg1) 2tq to 16tq ? time segment 2 (tseg2) 1tq to 8tq ipt of the can controller is 0tq. to conform to the can protocol specification, theref ore, a length equal or less to phase segment 1 must be set here. this means that the length of time segment 1 minus 1tq is the settable upper limit of time segment 2. resynchronization jump width (sjw) 1tq to 4tq the length of time segment 1 minus 1tq or 4tq, whichever smaller. remark ipt: information processing time tq: time quanta
chapter 21 can controller user?s manual u19201ej3v0ud 1105 remark the can protocol specification defines the segments constituting the data bit time as shown in figure 21-19. figure 21-19. configuration of data bit time defined by can specification phase segment 1 prop segment sync segment phase segment 2 sample point (spt) sjw data bit time (dbt) segment name segment length description sync segment (synchronization segment) 1 this segment starts at the edge where the level changes from recessive to dominant when hardware synchronization is established. prop segment (propagation segment) programmable to 1 to 8, or greater this segment absorbs the delay of the output buffer, can bus, and input buffer. the length of this segment is set so that ack is returned before the start of phase segment 1. time of prop segment (delay of output buffer) + 2 (delay of can bus) + (delay of input buffer) phase segment 1 (phase buffer segment 1) programmable to 1 to 8 phase segment 2 (phase buffer segment 2) phase segment 1 or ipt, whichever greater this segment compensates for an error in the data bit time. the longer this segment, the wider the permissible range but the slower the communication speed. sjw (resynchronization jump width) programmable from 1tq to segment 1tq to 4tq, whichever is smaller this width sets the upper limit of expansion or contraction of the phase segment during resynchronization. remark ipt: information processing time tq: time quanta
chapter 21 can controller user?s manual u19201ej3v0ud 1106 (3) synchronizing data bit ? the receiving node establishes synchronization by a level change on the bus because it does not have a sync signal. ? the transmitting node transmits data in synchroniza tion with the bit timing of the transmitting node. (a) hardware synchronization this synchronization is established when the receiving node detects the start of frame in the interframe space. ? when a falling edge is detected on the bus, that tq means the sync segment and the next segment is the prop segment. in this case, synchroni zation is established regardless of sjw. figure 21-20. hardware synchronization due to dominant level detect ion during bus idle start of frame interframe space can bus bit timing phase segment 1 prop segment sync segment phase segment 2
chapter 21 can controller user?s manual u19201ej3v0ud 1107 (b) resynchronization synchronization is established again if a level change is detected on t he bus during reception (only if a recessive level was sampled previously). ? the phase error of the edge is given by the relati ve position of the detected edge and sync segment. 0: if the edge is within the sync segment positive: if the edge is before the sample point (phase error) negative: if the edge is after the sample point (phase error) if phase error is positive: phase segment 1 is longer by specified sjw. if phase error is negative: phase segment 2 is shorter by specified sjw. ? the sample point of the data of t he receiving node moves relatively due to the ?discrepancy? in the baud rate between the transmitting node and receiving node. figure 21-21. resynchronization can bus bit timing can bus bit timing phase segment 1 prop segment sync segment phase segment 2 phase segment 1 prop segment sync segment phase segment 2 sample point sample point if phase error is negative if phase error is positive
chapter 21 can controller user?s manual u19201ej3v0ud 1108 21.4 connection with target system the microcontroller with on-chip can controller has to be connected to the can bus using an external transceiver. figure 21-22. connection to can bus microcontroller with on-chip can controller transceiver ctxdn crxdn canl canh remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1109 21.5 internal registers of can controller 21.5.1 can controller configuration table 21-15. list of can controller registers item register name cann global control register (cngmctrl) cann global clock select ion register (cngmcs) cann global automatic bl ock transmission contro l register (cngmabt) can global registers cann global automatic bloc k transmission delay setti ng register (cngmabtd) cann module mask 1 register (cnmask1l, cnmask1h) cann module mask 2 register (cnmask2l, cnmask2h) cann module mask 3 register (cnmask3l, cnmask3h) cann module mask 4 registers (cnmask4l, cnmask4h) cann module control register (cnctrl) cann module last error information register (cnlec) cann module information register (cninfo) cann module error counter register (cnerc) cann module interrupt enable register (cnie) cann module interrupt status register (cnints) cann module bit rate pres caler register (cnbrp) cann module bit rate register (cnbtr) cann module last in-pointer register (cnlipt) cann module receive histor y list register (cnrgpt) cann module last out-pointer register (cnlopt) cann module transmit histor y list register (cntgpt) can module registers cann module time stamp register (cnts) cann message data byte 01 register m (cnmdata01m) cann message data byte 0 register m (cnmdata0m) cann message data byte 1 register m (cnmdata1m) cann message data byte 23 register m (cnmdata23m) cann message data byte 2 register m (cnmdata2m) cann message data byte 3 register m (cnmdata3m) cann message data byte 45 register m (cnmdata45m) cann message data byte 4 register m (cnmdata4m) cann message data byte 5 register m (cnmdata5m) cann message data byte 67 register m (cnmdata67m) cann message data byte 6 register m (cnmdata6m) cann message data byte 7 register m (cnmdata7m) cann message data length register m (cnmdlcm) cann message configurati on register m (cnmconfm) cann message id register m (cnmidlm, cnmidhm) message buffer registers cann message control register m (cnmctrlm) remarks 1. the can global register is defined as cngm . the can module register is defined as cn . the message buffer register is defined as cnm . 2. n = 0, 1 m = 00 to 31
chapter 21 can controller user?s manual u19201ej3v0ud 1110 21.5.2 register access type table 21-16. register access types (1/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec000h can0 global control register c0gmctrl 0000h 03fec002h can0 global clock se lection register c0gmcs 0fh 03fec006h can0 global autom atic block transmission register c0gmabt 0000h 03fec008h can0 global autom atic block transmission delay register c0gmabtd 00h 03fec040h c0mask1l undefined 03fec042h can0 module mask 1 register c0mask1h undefined 03fec044h c0mask2l undefined 03fec046h can0 module mask 2 register c0mask2h undefined 03fec048h c0mask3l undefined 03fec04ah can0 module mask 3 register c0mask3h undefined 03fec04ch c0mask4l undefined 03fec04eh can0 module mask 4 register c0mask4h undefined 03fec050h can0 module control register c0ctrl 0000h 03fec052h can0 module last error code register c0lec r/w 00h 03fec053h can0 module information register c0info 00h 03fec054h can0 module error counter register c0erc r 0000h 03fec056h can0 module interrupt enable register c0ie 0000h 03fec058h can0 module interrupt status register c0ints 0000h 03fec05ah can0 module bit-rate prescaler register c0brp ffh 03fec05ch can0 module bit-rate register c0btr r/w 370fh 03fec05eh can0 module last in-pointer register c0lipt r undefined 03fec060h can0 module receive histor y list register c0rgpt r/w xx02h 03fec062h can0 module last out-pointer register c0lopt r undefined 03fec064h can0 module transmit history list register c0tgpt xx02h 03fec066h can0 module time stamp register c0ts r/w 0000h
chapter 21 can controller user?s manual u19201ej3v0ud 1111 table 21-16. register access types (2/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec100h can0 message data byte 01 register 00 c0mdata0100 undefined 03fec100h can0 message data byte 0 register 00 c0mdata000 undefined 03fec101h can0 message data byte 1 register 00 c0mdata100 undefined 03fec102h can0 message data byte 23 register 00 c0mdata2300 undefined 03fec102h can0 message data byte 2 register 00 c0mdata200 undefined 03fec103h can0 message data byte 3 register 00 c0mdata300 undefined 03fec104h can0 message data byte 45 register 00 c0mdata4500 undefined 03fec104h can0 message data byte 4 register 00 c0mdata400 undefined 03fec105h can0 message data byte 5 register 00 c0mdata500 undefined 03fec106h can0 message data byte 67 register 00 c0mdata6700 undefined 03fec106h can0 message data byte 6 register 00 c0mdata600 undefined 03fec107h can0 message data byte 7 register 00 c0mdata700 undefined 03fec108h can0 message data length register 00 c0mdlc00 0000xxxxb 03fec109h can0 message configurat ion register 00 c0mconf00 undefined 03fec10ah c0midl00 undefined 03fec10ch can0 message identifier register 00 c0midh00 undefined 03fec10eh can0 message control register 00 c0mctrl00 00x00000 000xx000b 03fec120h can0 message data byte 01 register 01 c0mdata0101 undefined 03fec120h can0 message data byte 0 register 01 c0mdata001 undefined 03fec121h can0 message data byte 1 register 01 c0mdata101 undefined 03fec122h can0 message data byte 23 register 01 c0mdata2301 undefined 03fec122h can0 message data byte 2 register 01 c0mdata201 undefined 03fec123h can0 message data byte 3 register 01 c0mdata301 undefined 03fec124h can0 message data byte 45 register 01 c0mdata4501 undefined 03fec124h can0 message data byte 4 register 01 c0mdata401 undefined 03fec125h can0 message data byte 5 register 01 c0mdata501 undefined 03fec126h can0 message data byte 67 register 01 c0mdata6701 undefined 03fec126h can0 message data byte 6 register 01 c0mdata601 undefined 03fec127h can0 message data byte 7 register 01 c0mdata701 undefined 03fec128h can0 message data length register 01 c0mdlc01 0000xxxxb 03fec129h can0 message configurat ion register 01 c0mconf01 undefined 03fec12ah c0midl01 undefined 03fec12ch can0 message identifier register 01 c0midh01 undefined 03fec12eh can0 message control register 01 c0mctrl01 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1112 table 21-16. register access types (3/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec140h can0 message data byte 01 register 02 c0mdata0102 undefined 03fec140h can0 message data byte 0 register 02 c0mdata002 undefined 03fec141h can0 message data byte 1 register 02 c0mdata102 undefined 03fec142h can0 message data byte 23 register 02 c0mdata2302 undefined 03fec142h can0 message data byte 2 register 02 c0mdata202 undefined 03fec143h can0 message data byte 3 register 02 c0mdata302 undefined 03fec144h can0 message data byte 45 register 02 c0mdata4502 undefined 03fec144h can0 message data byte 4 register 02 c0mdata402 undefined 03fec145h can0 message data byte 5 register 02 c0mdata502 undefined 03fec146h can0 message data byte 67 register 02 c0mdata6702 undefined 03fec146h can0 message data byte 6 register 02 c0mdata602 undefined 03fec147h can0 message data byte 7 register 02 c0mdata702 undefined 03fec148h can0 message data length register 02 c0mdlc02 0000xxxxb 03fec149h can0 message configurat ion register 02 c0mconf02 undefined 03fec14ah c0midl02 undefined 03fec14ch can0 message identifier register 02 c0midh02 undefined 03fec14eh can0 message control register 02 c0mctrl02 00x00000 000xx000b 03fec160h can0 message data byte 01 register 03 c0mdata0103 undefined 03fec160h can0 message data byte 0 register 03 c0mdata003 undefined 03fec161h can0 message data byte 1 register 03 c0mdata103 undefined 03fec162h can0 message data byte 23 register 03 c0mdata2303 undefined 03fec162h can0 message data byte 2 register 03 c0mdata203 undefined 03fec163h can0 message data byte 3 register 03 c0mdata303 undefined 03fec164h can0 message data byte 45 register 03 c0mdata4503 undefined 03fec164h can0 message data byte 4 register 03 c0mdata403 undefined 03fec165h can0 message data byte 5 register 03 c0mdata503 undefined 03fec166h can0 message data byte 67 register 03 c0mdata6703 undefined 03fec166h can0 message data byte 6 register 03 c0mdata603 undefined 03fec167h can0 message data byte 7 register 03 c0mdata703 undefined 03fec168h can0 message data length register 03 c0mdlc03 0000xxxxb 03fec169h can0 message configuration register 03 c0mconf03 undefined 03fec16ah c0midl03 undefined 03fec16ch can0 message identifier register 03 c0midh03 undefined 03fec16eh can0 message control register 03 c0mctrl03 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1113 table 21-16. register access types (4/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec180h can0 message data byte 01 register 04 c0mdata0104 undefined 03fec180h can0 message data byte 0 register 04 c0mdata004 undefined 03fec181h can0 message data byte 1 register 04 c0mdata104 undefined 03fec182h can0 message data byte 23 register 04 c0mdata2304 undefined 03fec182h can0 message data byte 2 register 04 c0mdata204 undefined 03fec183h can0 message data byte 3 register 04 c0mdata304 undefined 03fec184h can0 message data byte 45 register 04 c0mdata4504 undefined 03fec184h can0 message data byte 4 register 04 c0mdata404 undefined 03fec185h can0 message data byte 5 register 04 c0mdata504 undefined 03fec186h can0 message data byte 67 register 04 c0mdata6704 undefined 03fec186h can0 message data byte 6 register 04 c0mdata604 undefined 03fec187h can0 message data byte 7 register 04 c0mdata704 undefined 03fec188h can0 message data length register 04 c0mdlc04 0000xxxxb 03fec189h can0 message configurat ion register 04 c0mconf04 undefined 03fec18ah c0midl04 undefined 03fec18ch can0 message identifier register 04 c0midh04 undefined 03fec18eh can0 message control register 04 c0mctrl04 00x00000 000xx000b 03fec1a0h can0 message data byte 01 register 05 c0mdata0105 undefined 03fec1a0h can0 message data byte 0 register 05 c0mdata005 undefined 03fec1a1h can0 message data byte 1 register 05 c0mdata105 undefined 03fec1a2h can0 message data byte 23 register 05 c0mdata2305 undefined 03fec1a2h can0 message data byte 2 register 05 c0mdata205 undefined 03fec1a3h can0 message data byte 3 register 05 c0mdata305 undefined 03fec1a4h can0 message data byte 45 register 05 c0mdata4505 undefined 03fec1a4h can0 message data byte 4 register 05 c0mdata405 undefined 03fec1a5h can0 message data byte 5 register 05 c0mdata505 undefined 03fec1a6h can0 message data byte 67 register 05 c0mdata6705 undefined 03fec1a6h can0 message data byte 6 register 05 c0mdata605 undefined 03fec1a7h can0 message data byte 7 register 05 c0mdata705 undefined 03fec1a8h can0 message data length register 05 c0mdlc05 0000xxxxb 03fec1a9h can0 message configuration register 05 c0mconf05 undefined 03fec1aah c0midl05 undefined 03fec1ach can0 message identifier register 05 c0midh05 undefined 03fec1aeh can0 message control register 05 c0mctrl05 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1114 table 21-16. register access types (5/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec1c0h can0 message data byte 01 register 06 c0mdata0106 undefined 03fec1c0h can0 message data byte 0 register 06 c0mdata006 undefined 03fec1c1h can0 message data byte 1 register 06 c0mdata106 undefined 03fec1c2h can0 message data byte 23 register 06 c0mdata2306 undefined 03fec1c2h can0 message data byte 2 register 06 c0mdata206 undefined 03fec1c3h can0 message data byte 3 register 06 c0mdata306 undefined 03fec1c4h can0 message data byte 45 register 06 c0mdata4506 undefined 03fec1c4h can0 message data byte 4 register 06 c0mdata406 undefined 03fec1c5h can0 message data byte 5 register 06 c0mdata506 undefined 03fec1c6h can0 message data byte 67 register 06 c0mdata6706 undefined 03fec1c6h can0 message data byte 6 register 06 c0mdata606 undefined 03fec1c7h can0 message data byte 7 register 06 c0mdata706 undefined 03fec1c8h can0 message data length register 06 c0mdlc06 0000xxxxb 03fec1c9h can0 message configur ation register 06 c0mconf06 undefined 03fec1cah c0midl06 undefined 03fec1cch can0 message identifier register 06 c0midh06 undefined 03fec1ceh can0 message control register 06 c0mctrl06 00x00000 000xx000b 03fec1e0h can0 message data byte 01 register 07 c0mdata0107 undefined 03fec1e0h can0 message data byte 0 register 07 c0mdata007 undefined 03fec1e1h can0 message data byte 1 register 07 c0mdata107 undefined 03fec1e2h can0 message data byte 23 register 07 c0mdata2307 undefined 03fec1e2h can0 message data byte 2 register 07 c0mdata207 undefined 03fec1e3h can0 message data byte 3 register 07 c0mdata307 undefined 03fec1e4h can0 message data byte 45 register 07 c0mdata4507 undefined 03fec1e4h can0 message data byte 4 register 07 c0mdata407 undefined 03fec1e5h can0 message data byte 5 register 07 c0mdata507 undefined 03fec1e6h can0 message data byte 67 register 07 c0mdata6707 undefined 03fec1e6h can0 message data byte 6 register 07 c0mdata607 undefined 03fec1e7h can0 message data byte 7 register 07 c0mdata707 undefined 03fec1e8h can0 message data length register 07 c0mdlc07 0000xxxxb 03fec1e9h can0 message configuration register 07 c0mconf07 undefined 03fec1eah c0midl07 undefined 03fec1ech can0 message identifier register 07 c0midh07 undefined 03fec1eeh can0 message control register 07 c0mctrl07 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1115 table 21-16. register access types (6/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec200h can0 message data byte 01 register 08 c0mdata0108 undefined 03fec200h can0 message data byte 0 register 08 c0mdata008 undefined 03fec201h can0 message data byte 1 register 08 c0mdata108 undefined 03fec202h can0 message data byte 23 register 08 c0mdata2308 undefined 03fec202h can0 message data byte 2 register 08 c0mdata208 undefined 03fec203h can0 message data byte 3 register 08 c0mdata308 undefined 03fec204h can0 message data byte 45 register 08 c0mdata4508 undefined 03fec204h can0 message data byte 4 register 08 c0mdata408 undefined 03fec205h can0 message data byte 5 register 08 c0mdata508 undefined 03fec206h can0 message data byte 67 register 08 c0mdata6708 undefined 03fec206h can0 message data byte 6 register 08 c0mdata608 undefined 03fec207h can0 message data byte 7 register 08 c0mdata708 undefined 03fec208h can0 message data length register 08 c0mdlc08 0000xxxxb 03fec209h can0 message configurat ion register 08 c0mconf08 undefined 03fec20ah c0midl08 undefined 03fec20ch can0 message identifier register 08 c0midh08 undefined 03fec20eh can0 message control register 08 c0mctrl08 00x00000 000xx000b 03fec220h can0 message data byte 01 register 09 c0mdata0109 undefined 03fec220h can0 message data byte 0 register 09 c0mdata009 undefined 03fec221h can0 message data byte 1 register 09 c0mdata109 undefined 03fec222h can0 message data byte 23 register 09 c0mdata2309 undefined 03fec222h can0 message data byte 2 register 09 c0mdata209 undefined 03fec223h can0 message data byte 3 register 09 c0mdata309 undefined 03fec224h can0 message data byte 45 register 09 c0mdata4509 undefined 03fec224h can0 message data byte 4 register 09 c0mdata409 undefined 03fec225h can0 message data byte 5 register 09 c0mdata509 undefined 03fec226h can0 message data byte 67 register 09 c0mdata6709 undefined 03fec226h can0 message data byte 6 register 09 c0mdata609 undefined 03fec227h can0 message data byte 7 register 09 c0mdata709 undefined 03fec228h can0 message data length register 09 c0mdlc09 0000xxxxb 03fec229h can0 message configuration register 09 c0mconf09 undefined 03fec22ah c0midl09 undefined 03fec22ch can0 message identifier register 09 c0midh09 undefined 03fec22eh can0 message control register 09 c0mctrl09 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1116 table 21-16. register access types (7/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec240h can0 message data byte 01 register 10 c0mdata0110 undefined 03fec240h can0 message data byte 0 register 10 c0mdata010 undefined 03fec241h can0 message data byte 1 register 10 c0mdata110 undefined 03fec242h can0 message data byte 23 register 10 c0mdata2310 undefined 03fec242h can0 message data byte 2 register 10 c0mdata210 undefined 03fec243h can0 message data byte 3 register 10 c0mdata310 undefined 03fec244h can0 message data byte 45 register 10 c0mdata4510 undefined 03fec244h can0 message data byte 4 register 10 c0mdata410 undefined 03fec245h can0 message data byte 5 register 10 c0mdata510 undefined 03fec246h can0 message data byte 67 register 10 c0mdata6710 undefined 03fec246h can0 message data byte 6 register 10 c0mdata610 undefined 03fec247h can0 message data byte 7 register 10 c0mdata710 undefined 03fec248h can0 message data length register 10 c0mdlc10 0000xxxxb 03fec249h can0 message configurat ion register 10 c0mconf10 undefined 03fec24ah c0midl10 undefined 03fec24ch can0 message identifier register 10 c0midh10 undefined 03fec24eh can0 message control register 10 c0mctrl10 00x00000 000xx000b 03fec260h can0 message data byte 01 register 11 c0mdata0111 undefined 03fec260h can0 message data byte 0 register 11 c0mdata011 undefined 03fec261h can0 message data byte 1 register 11 c0mdata111 undefined 03fec262h can0 message data byte 23 register 11 c0mdata2311 undefined 03fec262h can0 message data byte 2 register 11 c0mdata211 undefined 03fec263h can0 message data byte 3 register 11 c0mdata311 undefined 03fec264h can0 message data byte 45 register 11 c0mdata4511 undefined 03fec264h can0 message data byte 4 register 11 c0mdata411 undefined 03fec265h can0 message data byte 5 register 11 c0mdata511 undefined 03fec266h can0 message data byte 67 register 11 c0mdata6711 undefined 03fec266h can0 message data byte 6 register 11 c0mdata611 undefined 03fec267h can0 message data byte 7 register 11 c0mdata711 undefined 03fec268h can0 message data length register 11 c0mdlc11 0000xxxxb 03fec269h can0 message configuration register 11 c0mconf11 undefined 03fec26ah c0midl11 undefined 03fec26ch can0 message identifier register 11 c0midh11 undefined 03fec26eh can0 message control register 11 c0mctrl11 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1117 table 21-16. register access types (8/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec280h can0 message data byte 01 register 12 c0mdata0112 undefined 03fec280h can0 message data byte 0 register 12 c0mdata012 undefined 03fec281h can0 message data byte 1 register 12 c0mdata112 undefined 03fec282h can0 message data byte 23 register 12 c0mdata2312 undefined 03fec282h can0 message data byte 2 register 12 c0mdata212 undefined 03fec283h can0 message data byte 3 register 12 c0mdata312 undefined 03fec284h can0 message data byte 45 register 12 c0mdata4512 undefined 03fec284h can0 message data byte 4 register 12 c0mdata412 undefined 03fec285h can0 message data byte 5 register 12 c0mdata512 undefined 03fec286h can0 message data byte 67 register 12 c0mdata6712 undefined 03fec286h can0 message data byte 6 register 12 c0mdata612 undefined 03fec287h can0 message data byte 7 register 12 c0mdata712 undefined 03fec288h can0 message data length register 12 c0mdlc12 0000xxxxb 03fec289h can0 message configurat ion register 12 c0mconf12 undefined 03fec28ah c0midl12 undefined 03fec28ch can0 message identifier register 12 c0midh12 undefined 03fec28eh can0 message control register 12 c0mctrl12 00x00000 000xx000b 03fec2a0h can0 message data byte 01 register 13 c0mdata0113 undefined 03fec2a0h can0 message data byte 0 register 13 c0mdata013 undefined 03fec2a1h can0 message data byte 1 register 13 c0mdata113 undefined 03fec2a2h can0 message data byte 23 register 13 c0mdata2313 undefined 03fec2a2h can0 message data byte 2 register 13 c0mdata213 undefined 03fec2a3h can0 message data byte 3 register 13 c0mdata313 undefined 03fec2a4h can0 message data byte 45 register 13 c0mdata4513 undefined 03fec2a4h can0 message data byte 4 register 13 c0mdata413 undefined 03fec2a5h can0 message data byte 5 register 13 c0mdata513 undefined 03fec2a6h can0 message data byte 67 register 13 c0mdata6713 undefined 03fec2a6h can0 message data byte 6 register 13 c0mdata613 undefined 03fec2a7h can0 message data byte 7 register 13 c0mdata713 undefined 03fec2a8h can0 message data length register 13 c0mdlc13 0000xxxxb 03fec2a9h can0 message configuration register 13 c0mconf13 undefined 03fec2aah c0midl13 undefined 03fec2ach can0 message identifier register 13 c0midh13 undefined 03fec2aeh can0 message control register 13 c0mctrl13 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1118 table 21-16. register access types (9/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec2c0h can0 message data byte 01 register 14 c0mdata0114 undefined 03fec2c0h can0 message data byte 0 register 14 c0mdata014 undefined 03fec2c1h can0 message data byte 1 register 14 c0mdata114 undefined 03fec2c2h can0 message data byte 23 register 14 c0mdata2314 undefined 03fec2c2h can0 message data byte 2 register 14 c0mdata214 undefined 03fec2c3h can0 message data byte 3 register 14 c0mdata314 undefined 03fec2c4h can0 message data byte 45 register 14 c0mdata4514 undefined 03fec2c4h can0 message data byte 4 register 14 c0mdata414 undefined 03fec2c5h can0 message data byte 5 register 14 c0mdata514 undefined 03fec2c6h can0 message data byte 67 register 14 c0mdata6714 undefined 03fec2c6h can0 message data byte 6 register 14 c0mdata614 undefined 03fec2c7h can0 message data byte 7 register 14 c0mdata714 undefined 03fec2c8h can0 message data length register 14 c0mdlc14 0000xxxxb 03fec2c9h can0 message configur ation register 14 c0mconf14 undefined 03fec2cah c0midl14 undefined 03fec2cch can0 message identifier register 14 c0midh14 undefined 03fec2ceh can0 message control register 14 c0mctrl14 00x00000 000xx000b 03fec2e0h can0 message data byte 01 register 15 c0mdata0115 undefined 03fec2e0h can0 message data byte 0 register 15 c0mdata015 undefined 03fec2e1h can0 message data byte 1 register 15 c0mdata115 undefined 03fec2e2h can0 message data byte 23 register 15 c0mdata2315 undefined 03fec2e2h can0 message data byte 2 register 15 c0mdata215 undefined 03fec2e3h can0 message data byte 3 register 15 c0mdata315 undefined 03fec2e4h can0 message data byte 45 register 15 c0mdata4515 undefined 03fec2e4h can0 message data byte 4 register 15 c0mdata415 undefined 03fec2e5h can0 message data byte 5 register 15 c0mdata515 undefined 03fec2e6h can0 message data byte 67 register 15 c0mdata6715 undefined 03fec2e6h can0 message data byte 6 register 15 c0mdata615 undefined 03fec2e7h can0 message data byte 7 register 15 c0mdata715 undefined 03fec2e8h can0 message data length register 15 c0mdlc15 0000xxxxb 03fec2e9h can0 message configuration register 15 c0mconf15 undefined 03fec2eah c0midl15 undefined 03fec2ech can0 message identifier register 15 c0midh15 undefined 03fec2eeh can0 message control register 15 c0mctrl15 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1119 table 21-16. register access types (10/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec300h can0 message data byte 01 register 16 c0mdata0116 undefined 03fec300h can0 message data byte 0 register 16 c0mdata016 undefined 03fec301h can0 message data byte 1 register 16 c0mdata116 undefined 03fec302h can0 message data byte 23 register 16 c0mdata2316 undefined 03fec302h can0 message data byte 2 register 16 c0mdata216 undefined 03fec303h can0 message data byte 3 register 16 c0mdata316 undefined 03fec304h can0 message data byte 45 register 16 c0mdata4516 undefined 03fec304h can0 message data byte 4 register 16 c0mdata416 undefined 03fec305h can0 message data byte 5 register 16 c0mdata516 undefined 03fec306h can0 message data byte 67 register 16 c0mdata6716 undefined 03fec306h can0 message data byte 6 register 16 c0mdata616 undefined 03fec307h can0 message data byte 7 register 16 c0mdata716 undefined 03fec308h can0 message data length register 16 c0mdlc16 0000xxxxb 03fec309h can0 message configurat ion register 16 c0mconf16 undefined 03fec30ah c0midl16 undefined 03fec30ch can0 message identifier register 16 c0midh16 undefined 03fec30eh can0 message control register 16 c0mctrl16 00x00000 000xx000b 03fec320h can0 message data byte 01 register 17 c0mdata0117 undefined 03fec320h can0 message data byte 0 register 17 c0mdata017 undefined 03fec321h can0 message data byte 1 register 17 c0mdata117 undefined 03fec322h can0 message data byte 23 register 17 c0mdata2317 undefined 03fec322h can0 message data byte 2 register 17 c0mdata217 undefined 03fec323h can0 message data byte 3 register 17 c0mdata317 undefined 03fec324h can0 message data byte 45 register 17 c0mdata4517 undefined 03fec324h can0 message data byte 4 register 17 c0mdata417 undefined 03fec325h can0 message data byte 5 register 17 c0mdata517 undefined 03fec326h can0 message data byte 67 register 17 c0mdata6717 undefined 03fec326h can0 message data byte 6 register 17 c0mdata617 undefined 03fec327h can0 message data byte 7 register 17 c0mdata717 undefined 03fec328h can0 message data length register 17 c0mdlc17 0000xxxxb 03fec329h can0 message configuration register 17 c0mconf17 undefined 03fec32ah c0midl17 undefined 03fec32ch can0 message identifier register 17 c0midh17 undefined 03fec32eh can0 message control register 17 c0mctrl17 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1120 table 21-16. register access types (11/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec340h can0 message data byte 01 register 18 c0mdata0118 undefined 03fec340h can0 message data byte 0 register 18 c0mdata018 undefined 03fec341h can0 message data byte 1 register 18 c0mdata118 undefined 03fec342h can0 message data byte 23 register 18 c0mdata2318 undefined 03fec342h can0 message data byte 2 register 18 c0mdata218 undefined 03fec343h can0 message data byte 3 register 18 c0mdata318 undefined 03fec344h can0 message data byte 45 register 18 c0mdata4518 undefined 03fec344h can0 message data byte 4 register 18 c0mdata418 undefined 03fec345h can0 message data byte 5 register 18 c0mdata518 undefined 03fec346h can0 message data byte 67 register 18 c0mdata6718 undefined 03fec346h can0 message data byte 6 register 18 c0mdata618 undefined 03fec347h can0 message data byte 7 register 18 c0mdata718 undefined 03fec348h can0 message data length register 18 c0mdlc18 0000xxxxb 03fec349h can0 message configurat ion register 18 c0mconf18 undefined 03fec34ah c0midl18 undefined 03fec34ch can0 message identifier register 18 c0midh18 undefined 03fec34eh can0 message control register 18 c0mctrl18 00x00000 000xx000b 03fec360h can0 message data byte 01 register 19 c0mdata0119 undefined 03fec360h can0 message data byte 0 register 19 c0mdata019 undefined 03fec361h can0 message data byte 1 register 19 c0mdata119 undefined 03fec362h can0 message data byte 23 register 19 c0mdata2319 undefined 03fec362h can0 message data byte 2 register 19 c0mdata219 undefined 03fec363h can0 message data byte 3 register 19 c0mdata319 undefined 03fec364h can0 message data byte 45 register 19 c0mdata4519 undefined 03fec364h can0 message data byte 4 register 19 c0mdata419 undefined 03fec365h can0 message data byte 5 register 19 c0mdata519 undefined 03fec366h can0 message data byte 67 register 19 c0mdata6719 undefined 03fec366h can0 message data byte 6 register 19 c0mdata619 undefined 03fec367h can0 message data byte 7 register 19 c0mdata719 undefined 03fec368h can0 message data length register 19 c0mdlc19 0000xxxxb 03fec369h can0 message configuration register 19 c0mconf19 undefined 03fec36ah c0midl19 undefined 03fec36ch can0 message identifier register 19 c0midh19 undefined 03fec36eh can0 message control register 19 c0mctrl19 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1121 table 21-16. register access types (12/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec380h can0 message data byte 01 register 20 c0mdata0120 undefined 03fec380h can0 message data byte 0 register 20 c0mdata020 undefined 03fec381h can0 message data byte 1 register 20 c0mdata120 undefined 03fec382h can0 message data byte 23 register 20 c0mdata2320 undefined 03fec382h can0 message data byte 2 register 20 c0mdata220 undefined 03fec383h can0 message data byte 3 register 20 c0mdata320 undefined 03fec384h can0 message data byte 45 register 20 c0mdata4520 undefined 03fec384h can0 message data byte 4 register 20 c0mdata420 undefined 03fec385h can0 message data byte 5 register 20 c0mdata520 undefined 03fec386h can0 message data byte 67 register 20 c0mdata6720 undefined 03fec386h can0 message data byte 6 register 20 c0mdata620 undefined 03fec387h can0 message data byte 7 register 20 c0mdata720 undefined 03fec388h can0 message data length register 20 c0mdlc20 0000xxxxb 03fec389h can0 message configurat ion register 20 c0mconf20 undefined 03fec38ah c0midl20 undefined 03fec38ch can0 message identifier register 20 c0midh20 undefined 03fec38eh can0 message control register 20 c0mctrl20 00x00000 000xx000b 03fec3a0h can0 message data byte 01 register 21 c0mdata0121 undefined 03fec3a0h can0 message data byte 0 register 21 c0mdata021 undefined 03fec3a1h can0 message data byte 1 register 21 c0mdata121 undefined 03fec3a2h can0 message data byte 23 register 21 c0mdata2321 undefined 03fec3a2h can0 message data byte 2 register 21 c0mdata221 undefined 03fec3a3h can0 message data byte 3 register 21 c0mdata321 undefined 03fec3a4h can0 message data byte 45 register 21 c0mdata4521 undefined 03fec3a4h can0 message data byte 4 register 21 c0mdata421 undefined 03fec3a5h can0 message data byte 5 register 21 c0mdata521 undefined 03fec3a6h can0 message data byte 67 register 21 c0mdata6721 undefined 03fec3a6h can0 message data byte 6 register 21 c0mdata621 undefined 03fec3a7h can0 message data byte 7 register 21 c0mdata721 undefined 03fec3a8h can0 message data length register 21 c0mdlc21 0000xxxxb 03fec3a9h can0 message configuration register 21 c0mconf21 undefined 03fec3aah c0midl21 undefined 03fec3ach can0 message identifier register 21 c0midh21 undefined 03fec3aeh can0 message control register 21 c0mctrl21 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1122 table 21-16. register access types (13/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec3c0h can0 message data byte 01 register 22 c0mdata0122 undefined 03fec3c0h can0 message data byte 0 register 22 c0mdata022 undefined 03fec3c1h can0 message data byte 1 register 22 c0mdata122 undefined 03fec3c2h can0 message data byte 23 register 22 c0mdata2322 undefined 03fec3c2h can0 message data byte 2 register 22 c0mdata222 undefined 03fec3c3h can0 message data byte 3 register 22 c0mdata322 undefined 03fec3c4h can0 message data byte 45 register 22 c0mdata4522 undefined 03fec3c4h can0 message data byte 4 register 22 c0mdata422 undefined 03fec3c5h can0 message data byte 5 register 22 c0mdata522 undefined 03fec3c6h can0 message data byte 67 register 22 c0mdata6722 undefined 03fec3c6h can0 message data byte 6 register 22 c0mdata622 undefined 03fec3c7h can0 message data byte 7 register 22 c0mdata722 undefined 03fec3c8h can0 message data length register 22 c0mdlc22 0000xxxxb 03fec3c9h can0 message configur ation register 22 c0mconf22 undefined 03fec3cah c0midl22 undefined 03fec3cch can0 message identifier register 22 c0midh22 undefined 03fec3ceh can0 message control register 22 c0mctrl22 00x00000 000xx000b 03fec3e0h can0 message data byte 01 register 23 c0mdata0123 undefined 03fec3e0h can0 message data byte 0 register 23 c0mdata023 undefined 03fec3e1h can0 message data byte 1 register 23 c0mdata123 undefined 03fec3e2h can0 message data byte 23 register 23 c0mdata2323 undefined 03fec3e2h can0 message data byte 2 register 23 c0mdata223 undefined 03fec3e3h can0 message data byte 3 register 23 c0mdata323 undefined 03fec3e4h can0 message data byte 45 register 23 c0mdata4523 undefined 03fec3e4h can0 message data byte 4 register 23 c0mdata423 undefined 03fec3e5h can0 message data byte 5 register 23 c0mdata523 undefined 03fec3e6h can0 message data byte 67 register 23 c0mdata6723 undefined 03fec3e6h can0 message data byte 6 register 23 c0mdata623 undefined 03fec3e7h can0 message data byte 7 register 23 c0mdata723 undefined 03fec3e8h can0 message data length register 23 c0mdlc23 0000xxxxb 03fec3e9h can0 message configuration register 23 c0mconf23 undefined 03fec3eah c0midl23 undefined 03fec3ech can0 message identifier register 23 c0midh23 undefined 03fec3eeh can0 message control register 23 c0mctrl23 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1123 table 21-16. register access types (14/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec400h can0 message data byte 01 register 24 c0mdata0124 undefined 03fec400h can0 message data byte 0 register 24 c0mdata024 undefined 03fec401h can0 message data byte 1 register 24 c0mdata124 undefined 03fec402h can0 message data byte 23 register 24 c0mdata2324 undefined 03fec402h can0 message data byte 2 register 24 c0mdata224 undefined 03fec403h can0 message data byte 3 register 24 c0mdata324 undefined 03fec404h can0 message data byte 45 register 24 c0mdata4524 undefined 03fec404h can0 message data byte 4 register 24 c0mdata424 undefined 03fec405h can0 message data byte 5 register 24 c0mdata524 undefined 03fec406h can0 message data byte 67 register 24 c0mdata6724 undefined 03fec406h can0 message data byte 6 register 24 c0mdata624 undefined 03fec407h can0 message data byte 7 register 24 c0mdata724 undefined 03fec408h can0 message data length register 24 c0mdlc24 0000xxxxb 03fec409h can0 message configurat ion register 24 c0mconf24 undefined 03fec40ah c0midl24 undefined 03fec40ch can0 message identifier register 24 c0midh24 undefined 03fec40eh can0 message control register 24 c0mctrl24 00x00000 000xx000b 03fec420h can0 message data byte 01 register 25 c0mdata0125 undefined 03fec420h can0 message data byte 0 register 25 c0mdata025 undefined 03fec421h can0 message data byte 1 register 25 c0mdata125 undefined 03fec422h can0 message data byte 23 register 25 c0mdata2325 undefined 03fec422h can0 message data byte 2 register 25 c0mdata225 undefined 03fec423h can0 message data byte 3 register 25 c0mdata325 undefined 03fec424h can0 message data byte 45 register 25 c0mdata4525 undefined 03fec424h can0 message data byte 4 register 25 c0mdata425 undefined 03fec425h can0 message data byte 5 register 25 c0mdata525 undefined 03fec426h can0 message data byte 67 register 25 c0mdata6725 undefined 03fec426h can0 message data byte 6 register 25 c0mdata625 undefined 03fec427h can0 message data byte 7 register 25 c0mdata725 undefined 03fec428h can0 message data length register 25 c0mdlc25 0000xxxxb 03fec429h can0 message configuration register 25 c0mconf25 undefined 03fec42ah c0midl25 undefined 03fec42ch can0 message identifier register 25 c0midh25 undefined 03fec42eh can0 message control register 25 c0mctrl25 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1124 table 21-16. register access types (15/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec440h can0 message data byte 01 register 26 c0mdata0126 undefined 03fec440h can0 message data byte 0 register 26 c0mdata026 undefined 03fec441h can0 message data byte 1 register 26 c0mdata126 undefined 03fec442h can0 message data byte 23 register 26 c0mdata2326 undefined 03fec442h can0 message data byte 2 register 26 c0mdata226 undefined 03fec443h can0 message data byte 3 register 26 c0mdata326 undefined 03fec444h can0 message data byte 45 register 26 c0mdata4526 undefined 03fec444h can0 message data byte 4 register 26 c0mdata426 undefined 03fec445h can0 message data byte 5 register 26 c0mdata526 undefined 03fec446h can0 message data byte 67 register 26 c0mdata6726 undefined 03fec446h can0 message data byte 6 register 26 c0mdata626 undefined 03fec447h can0 message data byte 7 register 26 c0mdata726 undefined 03fec448h can0 message data length register 26 c0mdlc26 0000xxxxb 03fec449h can0 message configurat ion register 26 c0mconf26 undefined 03fec44ah c0midl26 undefined 03fec44ch can0 message identifier register 26 c0midh26 undefined 03fec44eh can0 message control register 26 c0mctrl26 00x00000 000xx000b 03fec460h can0 message data byte 01 register 27 c0mdata0127 undefined 03fec460h can0 message data byte 0 register 27 c0mdata027 undefined 03fec461h can0 message data byte 1 register 27 c0mdata127 undefined 03fec462h can0 message data byte 23 register 27 c0mdata2327 undefined 03fec462h can0 message data byte 2 register 27 c0mdata227 undefined 03fec463h can0 message data byte 3 register 27 c0mdata327 undefined 03fec464h can0 message data byte 45 register 27 c0mdata4527 undefined 03fec464h can0 message data byte 4 register 27 c0mdata427 undefined 03fec465h can0 message data byte 5 register 27 c0mdata527 undefined 03fec466h can0 message data byte 67 register 27 c0mdata6727 undefined 03fec466h can0 message data byte 6 register 27 c0mdata627 undefined 03fec467h can0 message data byte 7 register 27 c0mdata727 undefined 03fec468h can0 message data length register 27 c0mdlc27 0000xxxxb 03fec469h can0 message configuration register 27 c0mconf27 undefined 03fec46ah c0midl27 undefined 03fec46ch can0 message identifier register 27 c0midh27 undefined 03fec46eh can0 message control register 27 c0mctrl27 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1125 table 21-16. register access types (16/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec480h can0 message data byte 01 register 28 c0mdata0128 undefined 03fec480h can0 message data byte 0 register 28 c0mdata028 undefined 03fec481h can0 message data byte 1 register 28 c0mdata128 undefined 03fec482h can0 message data byte 23 register 28 c0mdata2328 undefined 03fec482h can0 message data byte 2 register 28 c0mdata228 undefined 03fec483h can0 message data byte 3 register 28 c0mdata328 undefined 03fec484h can0 message data byte 45 register 28 c0mdata4528 undefined 03fec484h can0 message data byte 4 register 28 c0mdata428 undefined 03fec485h can0 message data byte 5 register 28 c0mdata528 undefined 03fec486h can0 message data byte 67 register 28 c0mdata6728 undefined 03fec486h can0 message data byte 6 register 28 c0mdata628 undefined 03fec487h can0 message data byte 7 register 28 c0mdata728 undefined 03fec488h can0 message data length register 28 c0mdlc28 0000xxxxb 03fec489h can0 message configurat ion register 28 c0mconf28 undefined 03fec48ah c0midl28 undefined 03fec48ch can0 message identifier register 28 c0midh28 undefined 03fec48eh can0 message control register 28 c0mctrl28 00x00000 000xx000b 03fec4a0h can0 message data byte 01 register 29 c0mdata0129 undefined 03fec4a0h can0 message data byte 0 register 29 c0mdata029 undefined 03fec4a1h can0 message data byte 1 register 29 c0mdata129 undefined 03fec4a2h can0 message data byte 23 register 29 c0mdata2329 undefined 03fec4a2h can0 message data byte 2 register 29 c0mdata229 undefined 03fec4a3h can0 message data byte 3 register 29 c0mdata329 undefined 03fec4a4h can0 message data byte 45 register 29 c0mdata4529 undefined 03fec4a4h can0 message data byte 4 register 29 c0mdata429 undefined 03fec4a5h can0 message data byte 5 register 29 c0mdata529 undefined 03fec4a6h can0 message data byte 67 register 29 c0mdata6729 undefined 03fec4a6h can0 message data byte 6 register 29 c0mdata629 undefined 03fec4a7h can0 message data byte 7 register 29 c0mdata729 undefined 03fec4a8h can0 message data length register 29 c0mdlc29 0000xxxxb 03fec4a9h can0 message configuration register 29 c0mconf29 undefined 03fec4aah c0midl29 undefined 03fec4ach can0 message identifier register 29 c0midh29 undefined 03fec4aeh can0 message control register 29 c0mctrl29 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1126 table 21-16. register access types (17/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec4c0h can0 message data byte 01 register 30 c0mdata0130 undefined 03fec4c0h can0 message data byte 0 register 30 c0mdata030 undefined 03fec4c1h can0 message data byte 1 register 30 c0mdata130 undefined 03fec4c2h can0 message data byte 23 register 30 c0mdata2330 undefined 03fec4c2h can0 message data byte 2 register 30 c0mdata230 undefined 03fec4c3h can0 message data byte 3 register 30 c0mdata330 undefined 03fec4c4h can0 message data byte 45 register 30 c0mdata4530 undefined 03fec4c4h can0 message data byte 4 register 30 c0mdata430 undefined 03fec4c5h can0 message data byte 5 register 30 c0mdata530 undefined 03fec4c6h can0 message data byte 67 register 30 c0mdata6730 undefined 03fec4c6h can0 message data byte 6 register 30 c0mdata630 undefined 03fec4c7h can0 message data byte 7 register 30 c0mdata730 undefined 03fec4c8h can0 message data length register 30 c0mdlc30 0000xxxxb 03fec4c9h can0 message configur ation register 30 c0mconf30 undefined 03fec4cah c0midl30 undefined 03fec4cch can0 message identifier register 30 c0midh30 undefined 03fec4ceh can0 message control register 30 c0mctrl30 00x00000 000xx000b 03fec4e0h can0 message data byte 01 register 31 c0mdata0131 undefined 03fec4e0h can0 message data byte 0 register 31 c0mdata031 undefined 03fec4e1h can0 message data byte 1 register 31 c0mdata131 undefined 03fec4e2h can0 message data byte 23 register 31 c0mdata2331 undefined 03fec4e2h can0 message data byte 2 register 31 c0mdata231 undefined 03fec4e3h can0 message data byte 3 register 31 c0mdata331 undefined 03fec4e4h can0 message data byte 45 register 31 c0mdata4531 undefined 03fec4e4h can0 message data byte 4 register 31 c0mdata431 undefined 03fec4e5h can0 message data byte 5 register 31 c0mdata531 undefined 03fec4e6h can0 message data byte 67 register 31 c0mdata6731 undefined 03fec4e6h can0 message data byte 6 register 31 c0mdata631 undefined 03fec4e7h can0 message data byte 7 register 31 c0mdata731 undefined 03fec4e8h can0 message data length register 31 c0mdlc31 0000xxxxb 03fec4e9h can0 message configuration register 31 c0mconf31 undefined 03fec4eah c0midl31 undefined 03fec4ech can0 message identifier register 31 c0midh31 undefined 03fec4eeh can0 message control register 31 c0mctrl31 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1127 table 21-16. register access types (18/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec600h can1 global control register c1gmctrl 0000h 03fec602h can1 global clock se lection register c1gmcs 0fh 03fec606h can1 global block tran smission register c1gmabt 0000h 03fec608h can1 global block transmission delay register c1gmabtd 00h 03fec640h c1mask1l undefined 03fec642h can1 module mask 1 register c1mask1h undefined 03fec644h c1mask2l undefined 03fec646h can1 module mask 2 register c1mask2h undefined 03fec648h c1mask3l undefined 03fec64ah can1 module mask 3 register c1mask3h undefined 03fec64ch c1mask4l undefined 03fec64eh can1 module mask 4 register c1mask4h undefined 03fec650h can1 module control register c1ctrl 0000h 03fec652h can1 module last error code register c1lec r/w 00h 03fec653h can1 module information register c1info 00h 03fec654h can1 module error counter register c1erc r 0000h 03fec656h can1 module interrupt enable register c1ie 0000h 03fec658h can1 module interrupt status register c1ints 0000h 03fec65ah can1 module bit-rate prescaler register c1brp ffh 03fec65ch can1 module bit-rate register c1btr r/w 370fh 03fec65eh can1 module last in-pointer register c1lipt r undefined 03fec660h can1 module receive histor y list register c1rgpt r/w xx02h 03fec662h can1 module last out-pointer register c1lopt r undefined 03fec664h can1 module transmit history list register c1tgpt xx02h 03fec666h can1 module time stamp register c1ts r/w 0000h
chapter 21 can controller user?s manual u19201ej3v0ud 1128 table 21-16. register access types (19/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec700h can1 message data byte 01 register 00 c1mdata0100 undefined 03fec700h can1 message data byte 0 register 00 c1mdata000 undefined 03fec701h can1 message data byte 1 register 00 c1mdata100 undefined 03fec702h can1 message data byte 23 register 00 c1mdata2300 undefined 03fec702h can1 message data byte 2 register 00 c1mdata200 undefined 03fec703h can1 message data byte 3 register 00 c1mdata300 undefined 03fec704h can1 message data byte 45 register 00 c1mdata4500 undefined 03fec704h can1 message data byte 4 register 00 c1mdata400 undefined 03fec705h can1 message data byte 5 register 00 c1mdata500 undefined 03fec706h can1 message data byte 67 register 00 c1mdata6700 undefined 03fec706h can1 message data byte 6 register 00 c1mdata600 undefined 03fec707h can1 message data byte 7 register 00 c1mdata700 undefined 03fec708h can1 message data length register 00 c1mdlc00 0000xxxxb 03fec709h can1 message configurat ion register 00 c1mconf00 undefined 03fec70ah c1midl00 undefined 03fec70ch can1 message identifier register 00 c1midh00 undefined 03fec70eh can1 message control register 00 c1mctrl00 00x00000 000xx000b 03fec720h can1 message data byte 01 register 01 c1mdata0101 undefined 03fec720h can1 message data byte 0 register 01 c1mdata001 undefined 03fec721h can1 message data byte 1 register 01 c1mdata101 undefined 03fec722h can1 message data byte 23 register 01 c1mdata2301 undefined 03fec722h can1 message data byte 2 register 01 c1mdata201 undefined 03fec723h can1 message data byte 3 register 01 c1mdata301 undefined 03fec724h can1 message data byte 45 register 01 c1mdata4501 undefined 03fec724h can1 message data byte 4 register 01 c1mdata401 undefined 03fec725h can1 message data byte 5 register 01 c1mdata501 undefined 03fec726h can1 message data byte 67 register 01 c1mdata6701 undefined 03fec726h can1 message data byte 6 register 01 c1mdata601 undefined 03fec727h can1 message data byte 7 register 01 c1mdata701 undefined 03fec728h can1 message data length register 01 c1mdlc01 0000xxxxb 03fec729h can1 message configurat ion register 01 c1mconf01 undefined 03fec72ah c1midl01 undefined 03fec72ch can1 message identifier register 01 c1midh01 undefined 03fec72eh can1 message control register 01 c1mctrl01 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1129 table 21-16. register access types (20/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec740h can1 message data byte 01 register 02 c1mdata0102 undefined 03fec740h can1 message data byte 0 register 02 c1mdata002 undefined 03fec741h can1 message data byte 1 register 02 c1mdata102 undefined 03fec742h can1 message data byte 23 register 02 c1mdata2302 undefined 03fec742h can1 message data byte 2 register 02 c1mdata202 undefined 03fec743h can1 message data byte 3 register 02 c1mdata302 undefined 03fec744h can1 message data byte 45 register 02 c1mdata4502 undefined 03fec744h can1 message data byte 4 register 02 c1mdata402 undefined 03fec745h can1 message data byte 5 register 02 c1mdata502 undefined 03fec746h can1 message data byte 67 register 02 c1mdata6702 undefined 03fec746h can1 message data byte 6 register 02 c1mdata602 undefined 03fec747h can1 message data byte 7 register 02 c1mdata702 undefined 03fec748h can1 message data length register 02 c1mdlc02 0000xxxxb 03fec749h can1 message configurat ion register 02 c1mconf02 undefined 03fec74ah c1midl02 undefined 03fec74ch can1 message identifier register 02 c1midh02 undefined 03fec74eh can1 message control register 02 c1mctrl02 00x00000 000xx000b 03fec760h can1 message data byte 01 register 03 c1mdata0103 undefined 03fec760h can1 message data byte 0 register 03 c1mdata003 undefined 03fec761h can1 message data byte 1 register 03 c1mdata103 undefined 03fec762h can1 message data byte 23 register 03 c1mdata2303 undefined 03fec762h can1 message data byte 2 register 03 c1mdata203 undefined 03fec763h can1 message data byte 3 register 03 c1mdata303 undefined 03fec764h can1 message data byte 45 register 03 c1mdata4503 undefined 03fec764h can1 message data byte 4 register 03 c1mdata403 undefined 03fec765h can1 message data byte 5 register 03 c1mdata503 undefined 03fec766h can1 message data byte 67 register 03 c1mdata6703 undefined 03fec766h can1 message data byte 6 register 03 c1mdata603 undefined 03fec767h can1 message data byte 7 register 03 c1mdata703 undefined 03fec768h can1 message data length register 03 c1mdlc03 0000xxxxb 03fec769h can1 message configurat ion register 03 c1mconf03 undefined 03fec76ah c1midl03 undefined 03fec76ch can1 message identifier register 03 c1midh03 undefined 03fec76eh can1 message control register 03 c1mctrl03 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1130 table 21-16. register access types (21/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec780h can1 message data byte 01 register 04 c1mdata0104 undefined 03fec780h can1 message data byte 0 register 04 c1mdata004 undefined 03fec781h can1 message data byte 1 register 04 c1mdata104 undefined 03fec782h can1 message data byte 23 register 04 c1mdata2304 undefined 03fec782h can1 message data byte 2 register 04 c1mdata204 undefined 03fec783h can1 message data byte 3 register 04 c1mdata304 undefined 03fec784h can1 message data byte 45 register 04 c1mdata4504 undefined 03fec784h can1 message data byte 4 register 04 c1mdata404 undefined 03fec785h can1 message data byte 5 register 04 c1mdata504 undefined 03fec786h can1 message data byte 67 register 04 c1mdata6704 undefined 03fec786h can1 message data byte 6 register 04 c1mdata604 undefined 03fec787h can1 message data byte 7 register 04 c1mdata704 undefined 03fec788h can1 message data length register 04 c1mdlc04 0000xxxxb 03fec789h can1 message configurat ion register 04 c1mconf04 undefined 03fec78ah c1midl04 undefined 03fec78ch can1 message identifier register 04 c1midh04 undefined 03fec78eh can1 message control register 04 c1mctrl04 00x00000 000xx000b 03fec7a0h can1 message data byte 01 register 05 c1mdata0105 undefined 03fec7a0h can1 message data byte 0 register 05 c1mdata005 undefined 03fec7a1h can1 message data byte 1 register 05 c1mdata105 undefined 03fec7a2h can1 message data byte 23 register 05 c1mdata2305 undefined 03fec7a2h can1 message data byte 2 register 05 c1mdata205 undefined 03fec7a3h can1 message data byte 3 register 05 c1mdata305 undefined 03fec7a4h can1 message data byte 45 register 05 c1mdata4505 undefined 03fec7a4h can1 message data byte 4 register 05 c1mdata405 undefined 03fec7a5h can1 message data byte 5 register 05 c1mdata505 undefined 03fec7a6h can1 message data byte 67 register 05 c1mdata6705 undefined 03fec7a6h can1 message data byte 6 register 05 c1mdata605 undefined 03fec7a7h can1 message data byte 7 register 05 c1mdata705 undefined 03fec7a8h can1 message data length register 05 c1mdlc05 0000xxxxb 03fec7a9h can1 message configur ation register 05 c1mconf05 undefined 03fec7aah c1midl05 undefined 03fec7ach can1 message identifier register 05 c1midh05 undefined 03fec7aeh can1 message control register 05 c1mctrl05 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1131 table 21-16. register access types (22/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec7c0h can1 message data byte 01 register 06 c1mdata0106 undefined 03fec7c0h can1 message data byte 0 register 06 c1mdata006 undefined 03fec7c1h can1 message data byte 1 register 06 c1mdata106 undefined 03fec7c2h can1 message data byte 23 register 06 c1mdata2306 undefined 03fec7c2h can1 message data byte 2 register 06 c1mdata206 undefined 03fec7c3h can1 message data byte 3 register 06 c1mdata306 undefined 03fec7c4h can1 message data byte 45 register 06 c1mdata4506 undefined 03fec7c4h can1 message data byte 4 register 06 c1mdata406 undefined 03fec7c5h can1 message data byte 5 register 06 c1mdata506 undefined 03fec7c6h can1 message data byte 67 register 06 c1mdata6706 undefined 03fec7c6h can1 message data byte 6 register 06 c1mdata606 undefined 03fec7c7h can1 message data byte 7 register 06 c1mdata706 undefined 03fec7c8h can1 message data length register 06 c1mdlc06 0000xxxxb 03fec7c9h can1 message configur ation register 06 c1mconf06 undefined 03fec7cah c1midl06 undefined 03fec7cch can1 message identifier register 06 c1midh06 undefined 03fec7ceh can1 message control register 06 c1mctrl06 00x00000 000xx000b 03fec7e0h can1 message data byte 01 register 07 c1mdata0107 undefined 03fec7e0h can1 message data byte 0 register 07 c1mdata007 undefined 03fec7e1h can1 message data byte 1 register 07 c1mdata107 undefined 03fec7e2h can1 message data byte 23 register 07 c1mdata2307 undefined 03fec7e2h can1 message data byte 2 register 07 c1mdata207 undefined 03fec7e3h can1 message data byte 3 register 07 c1mdata307 undefined 03fec7e4h can1 message data byte 45 register 07 c1mdata4507 undefined 03fec7e4h can1 message data byte 4 register 07 c1mdata407 undefined 03fec7e5h can1 message data byte 5 register 07 c1mdata507 undefined 03fec7e6h can1 message data byte 67 register 07 c1mdata6707 undefined 03fec7e6h can1 message data byte 6 register 07 c1mdata607 undefined 03fec7e7h can1 message data byte 7 register 07 c1mdata707 undefined 03fec7e8h can1 message data length register 07 c1mdlc07 0000xxxxb 03fec7e9h can1 message configur ation register 07 c1mconf07 undefined 03fec7eah c1midl07 undefined 03fec7ech can1 message identifier register 07 c1midh07 undefined 03fec7eeh can1 message control register 07 c1mctrl07 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1132 table 21-16. register access types (23/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec800h can1 message data byte 01 register 08 c1mdata0108 undefined 03fec800h can1 message data byte 0 register 08 c1mdata008 undefined 03fec801h can1 message data byte 1 register 08 c1mdata108 undefined 03fec802h can1 message data byte 23 register 08 c1mdata2308 undefined 03fec802h can1 message data byte 2 register 08 c1mdata208 undefined 03fec803h can1 message data byte 3 register 08 c1mdata308 undefined 03fec804h can1 message data byte 45 register 08 c1mdata4508 undefined 03fec804h can1 message data byte 4 register 08 c1mdata408 undefined 03fec805h can1 message data byte 5 register 08 c1mdata508 undefined 03fec806h can1 message data byte 67 register 08 c1mdata6708 undefined 03fec806h can1 message data byte 6 register 08 c1mdata608 undefined 03fec807h can1 message data byte 7 register 08 c1mdata708 undefined 03fec808h can1 message data length register 08 c1mdlc08 0000xxxxb 03fec809h can1 message configurat ion register 08 c1mconf08 undefined 03fec80ah c1midl08 undefined 03fec80ch can1 message identifier register 08 c1midh08 undefined 03fec80eh can1 message control register 08 c1mctrl08 00x00000 000xx000b 03fec820h can1 message data byte 01 register 09 c1mdata0109 undefined 03fec820h can1 message data byte 0 register 09 c1mdata009 undefined 03fec821h can1 message data byte 1 register 09 c1mdata109 undefined 03fec822h can1 message data byte 23 register 09 c1mdata2309 undefined 03fec822h can1 message data byte 2 register 09 c1mdata209 undefined 03fec823h can1 message data byte 3 register 09 c1mdata309 undefined 03fec824h can1 message data byte 45 register 09 c1mdata4509 undefined 03fec824h can1 message data byte 4 register 09 c1mdata409 undefined 03fec825h can1 message data byte 5 register 09 c1mdata509 undefined 03fec826h can1 message data byte 67 register 09 c1mdata6709 undefined 03fec826h can1 message data byte 6 register 09 c1mdata609 undefined 03fec827h can1 message data byte 7 register 09 c1mdata709 undefined 03fec828h can1 message data length register 09 c1mdlc09 0000xxxxb 03fec829h can1 message configurat ion register 09 c1mconf09 undefined 03fec82ah c1midl09 undefined 03fec82ch can1 message identifier register 09 c1midh09 undefined 03fec82eh can1 message control register 09 c1mctrl09 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1133 table 21-16. register access types (24/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec840h can1 message data byte 01 register 10 c1mdata0110 undefined 03fec840h can1 message data byte 0 register 10 c1mdata010 undefined 03fec841h can1 message data byte 1 register 10 c1mdata110 undefined 03fec842h can1 message data byte 23 register 10 c1mdata2310 undefined 03fec842h can1 message data byte 2 register 10 c1mdata210 undefined 03fec843h can1 message data byte 3 register 10 c1mdata310 undefined 03fec844h can1 message data byte 45 register 10 c1mdata4510 undefined 03fec844h can1 message data byte 4 register 10 c1mdata410 undefined 03fec845h can1 message data byte 5 register 10 c1mdata510 undefined 03fec846h can1 message data byte 67 register 10 c1mdata6710 undefined 03fec846h can1 message data byte 6 register 10 c1mdata610 undefined 03fec847h can1 message data byte 7 register 10 c1mdata710 undefined 03fec848h can1 message data length register 10 c1mdlc10 0000xxxxb 03fec849h can1 message configurat ion register 10 c1mconf10 undefined 03fec84ah c1midl10 undefined 03fec84ch can1 message identifier register 10 c1midh10 undefined 03fec84eh can1 message control register 10 c1mctrl10 00x00000 000xx000b 03fec860h can1 message data byte 01 register 11 c1mdata0111 undefined 03fec860h can1 message data byte 0 register 11 c1mdata011 undefined 03fec861h can1 message data byte 1 register 11 c1mdata111 undefined 03fec862h can1 message data byte 23 register 11 c1mdata2311 undefined 03fec862h can1 message data byte 2 register 11 c1mdata211 undefined 03fec863h can1 message data byte 3 register 11 c1mdata311 undefined 03fec864h can1 message data byte 45 register 11 c1mdata4511 undefined 03fec864h can1 message data byte 4 register 11 c1mdata411 undefined 03fec865h can1 message data byte 5 register 11 c1mdata511 undefined 03fec866h can1 message data byte 67 register 11 c1mdata6711 undefined 03fec866h can1 message data byte 6 register 11 c1mdata611 undefined 03fec867h can1 message data byte 7 register 11 c1mdata711 undefined 03fec868h can1 message data length register 11 c1mdlc11 0000xxxxb 03fec869h can1 message configurat ion register 11 c1mconf11 undefined 03fec86ah c1midl11 undefined 03fec86ch can1 message identifier register 11 c1midh11 undefined 03fec86eh can1 message control register 11 c1mctrl11 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1134 table 21-16. register access types (25/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec880h can1 message data byte 01 register 12 c1mdata0112 undefined 03fec880h can1 message data byte 0 register 12 c1mdata012 undefined 03fec881h can1 message data byte 1 register 12 c1mdata112 undefined 03fec882h can1 message data byte 23 register 12 c1mdata2312 undefined 03fec882h can1 message data byte 2 register 12 c1mdata212 undefined 03fec883h can1 message data byte 3 register 12 c1mdata312 undefined 03fec884h can1 message data byte 45 register 12 c1mdata4512 undefined 03fec884h can1 message data byte 4 register 12 c1mdata412 undefined 03fec885h can1 message data byte 5 register 12 c1mdata512 undefined 03fec886h can1 message data byte 67 register 12 c1mdata6712 undefined 03fec886h can1 message data byte 6 register 12 c1mdata612 undefined 03fec887h can1 message data byte 7 register 12 c1mdata712 undefined 03fec888h can1 message data length register 12 c1mdlc12 0000xxxxb 03fec889h can1 message configurat ion register 12 c1mconf12 undefined 03fec88ah c1midl12 undefined 03fec88ch can1 message identifier register 12 c1midh12 undefined 03fec88eh can1 message control register 12 c1mctrl12 00x00000 000xx000b 03fec8a0h can1 message data byte 01 register 13 c1mdata0113 undefined 03fec8a0h can1 message data byte 0 register 13 c1mdata013 undefined 03fec8a1h can1 message data byte 1 register 13 c1mdata113 undefined 03fec8a2h can1 message data byte 23 register 13 c1mdata2313 undefined 03fec8a2h can1 message data byte 2 register 13 c1mdata213 undefined 03fec8a3h can1 message data byte 3 register 13 c1mdata313 undefined 03fec8a4h can1 message data byte 45 register 13 c1mdata4513 undefined 03fec8a4h can1 message data byte 4 register 13 c1mdata413 undefined 03fec8a5h can1 message data byte 5 register 13 c1mdata513 undefined 03fec8a6h can1 message data byte 67 register 13 c1mdata6713 undefined 03fec8a6h can1 message data byte 6 register 13 c1mdata613 undefined 03fec8a7h can1 message data byte 7 register 13 c1mdata713 undefined 03fec8a8h can1 message data length register 13 c1mdlc13 0000xxxxb 03fec8a9h can1 message configur ation register 13 c1mconf13 undefined 03fec8aah c1midl13 undefined 03fec8ach can1 message identifier register 13 c1midh13 undefined 03fec8aeh can1 message control register 13 c1mctrl13 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1135 table 21-16. register access types (26/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec8c0h can1 message data byte 01 register 14 c1mdata0114 undefined 03fec8c0h can1 message data byte 0 register 14 c1mdata014 undefined 03fec8c1h can1 message data byte 1 register 14 c1mdata114 undefined 03fec8c2h can1 message data byte 23 register 14 c1mdata2314 undefined 03fec8c2h can1 message data byte 2 register 14 c1mdata214 undefined 03fec8c3h can1 message data byte 3 register 14 c1mdata314 undefined 03fec8c4h can1 message data byte 45 register 14 c1mdata4514 undefined 03fec8c4h can1 message data byte 4 register 14 c1mdata414 undefined 03fec8c5h can1 message data byte 5 register 14 c1mdata514 undefined 03fec8c6h can1 message data byte 67 register 14 c1mdata6714 undefined 03fec8c6h can1 message data byte 6 register 14 c1mdata614 undefined 03fec8c7h can1 message data byte 7 register 14 c1mdata714 undefined 03fec8c8h can1 message data length register 14 c1mdlc14 0000xxxxb 03fec8c9h can1 message configur ation register 14 c1mconf14 undefined 03fec8cah c1midl14 undefined 03fec8cch can1 message identifier register 14 c1midh14 undefined 03fec8ceh can1 message control register 14 c1mctrl14 00x00000 000xx000b 03fec8e0h can1 message data byte 01 register 15 c1mdata0115 undefined 03fec8e0h can1 message data byte 0 register 15 c1mdata015 undefined 03fec8e1h can1 message data byte 1 register 15 c1mdata115 undefined 03fec8e2h can1 message data byte 23 register 15 c1mdata2315 undefined 03fec8e2h can1 message data byte 2 register 15 c1mdata215 undefined 03fec8e3h can1 message data byte 3 register 15 c1mdata315 undefined 03fec8e4h can1 message data byte 45 register 15 c1mdata4515 undefined 03fec8e4h can1 message data byte 4 register 15 c1mdata415 undefined 03fec8e5h can1 message data byte 5 register 15 c1mdata515 undefined 03fec8e6h can1 message data byte 67 register 15 c1mdata6715 undefined 03fec8e6h can1 message data byte 6 register 15 c1mdata615 undefined 03fec8e7h can1 message data byte 7 register 15 c1mdata715 undefined 03fec8e8h can1 message data length register 15 c1mdlc15 0000xxxxb 03fec8e9h can1 message configur ation register 15 c1mconf15 undefined 03fec8eah c1midl15 undefined 03fec8ech can1 message identifier register 15 c1midh15 undefined 03fec8eeh can1 message control register 15 c1mctrl15 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1136 table 21-16. register access types (27/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec900h can1 message data byte 01 register 16 c1mdata0116 undefined 03fec900h can1 message data byte 0 register 16 c1mdata016 undefined 03fec901h can1 message data byte 1 register 16 c1mdata116 undefined 03fec902h can1 message data byte 23 register 16 c1mdata2316 undefined 03fec902h can1 message data byte 2 register 16 c1mdata216 undefined 03fec903h can1 message data byte 3 register 16 c1mdata316 undefined 03fec904h can1 message data byte 45 register 16 c1mdata4516 undefined 03fec904h can1 message data byte 4 register 16 c1mdata416 undefined 03fec905h can1 message data byte 5 register 16 c1mdata516 undefined 03fec906h can1 message data byte 67 register 16 c1mdata6716 undefined 03fec906h can1 message data byte 6 register 16 c1mdata616 undefined 03fec907h can1 message data byte 7 register 16 c1mdata716 undefined 03fec908h can1 message data length register 16 c1mdlc16 0000xxxxb 03fec909h can1 message configurat ion register 16 c1mconf16 undefined 03fec90ah c1midl16 undefined 03fec90ch can1 message identifier register 16 c1midh16 undefined 03fec90eh can1 message control register 16 c1mctrl16 00x00000 000xx000b 03fec920h can1 message data byte 01 register 17 c1mdata0117 undefined 03fec920h can1 message data byte 0 register 17 c1mdata017 undefined 03fec921h can1 message data byte 1 register 17 c1mdata117 undefined 03fec922h can1 message data byte 23 register 17 c1mdata2317 undefined 03fec922h can1 message data byte 2 register 17 c1mdata217 undefined 03fec923h can1 message data byte 3 register 17 c1mdata317 undefined 03fec924h can1 message data byte 45 register 17 c1mdata4517 undefined 03fec924h can1 message data byte 4 register 17 c1mdata417 undefined 03fec925h can1 message data byte 5 register 17 c1mdata517 undefined 03fec926h can1 message data byte 67 register 17 c1mdata6717 undefined 03fec926h can1 message data byte 6 register 17 c1mdata617 undefined 03fec927h can1 message data byte 7 register 17 c1mdata717 undefined 03fec928h can1 message data length register 17 c1mdlc17 0000xxxxb 03fec929h can1 message configurat ion register 17 c1mconf17 undefined 03fec92ah c1midl17 undefined 03fec92ch can1 message identifier register 17 c1midh17 undefined 03fec92eh can1 message control register 17 c1mctrl17 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1137 table 21-16. register access types (28/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec940h can1 message data byte 01 register 18 c1mdata0118 undefined 03fec940h can1 message data byte 0 register 18 c1mdata018 undefined 03fec941h can1 message data byte 1 register 18 c1mdata118 undefined 03fec942h can1 message data byte 23 register 18 c1mdata2318 undefined 03fec942h can1 message data byte 2 register 18 c1mdata218 undefined 03fec943h can1 message data byte 3 register 18 c1mdata318 undefined 03fec944h can1 message data byte 45 register 18 c1mdata4518 undefined 03fec944h can1 message data byte 4 register 18 c1mdata418 undefined 03fec945h can1 message data byte 5 register 18 c1mdata518 undefined 03fec946h can1 message data byte 67 register 18 c1mdata6718 undefined 03fec946h can1 message data byte 6 register 18 c1mdata618 undefined 03fec947h can1 message data byte 7 register 18 c1mdata718 undefined 03fec948h can1 message data length register 18 c1mdlc18 0000xxxxb 03fec949h can1 message configurat ion register 18 c1mconf18 undefined 03fec94ah c1midl18 undefined 03fec94ch can1 message identifier register 18 c1midh18 undefined 03fec94eh can1 message control register 18 c1mctrl18 00x00000 000xx000b 03fec960h can1 message data byte 01 register 19 c1mdata0119 undefined 03fec960h can1 message data byte 0 register 19 c1mdata019 undefined 03fec961h can1 message data byte 1 register 19 c1mdata119 undefined 03fec962h can1 message data byte 23 register 19 c1mdata2319 undefined 03fec962h can1 message data byte 2 register 19 c1mdata219 undefined 03fec963h can1 message data byte 3 register 19 c1mdata319 undefined 03fec964h can1 message data byte 45 register 19 c1mdata4519 undefined 03fec964h can1 message data byte 4 register 19 c1mdata419 undefined 03fec965h can1 message data byte 5 register 19 c1mdata519 undefined 03fec966h can1 message data byte 67 register 19 c1mdata6719 undefined 03fec966h can1 message data byte 6 register 19 c1mdata619 undefined 03fec967h can1 message data byte 7 register 19 c1mdata719 undefined 03fec968h can1 message data length register 19 c1mdlc19 0000xxxxb 03fec969h can1 message configurat ion register 19 c1mconf19 undefined 03fec96ah c1midl19 undefined 03fec96ch can1 message identifier register 19 c1midh19 undefined 03fec96eh can1 message control register 19 c1mctrl19 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1138 table 21-16. register access types (29/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec980h can1 message data byte 01 register 20 c1mdata0120 undefined 03fec980h can1 message data byte 0 register 20 c1mdata020 undefined 03fec981h can1 message data byte 1 register 20 c1mdata120 undefined 03fec982h can1 message data byte 23 register 20 c1mdata2320 undefined 03fec982h can1 message data byte 2 register 20 c1mdata220 undefined 03fec983h can1 message data byte 3 register 20 c1mdata320 undefined 03fec984h can1 message data byte 45 register 20 c1mdata4520 undefined 03fec984h can1 message data byte 4 register 20 c1mdata420 undefined 03fec985h can1 message data byte 5 register 20 c1mdata520 undefined 03fec986h can1 message data byte 67 register 20 c1mdata6720 undefined 03fec986h can1 message data byte 6 register 20 c1mdata620 undefined 03fec987h can1 message data byte 7 register 20 c1mdata720 undefined 03fec988h can1 message data length register 20 c1mdlc20 0000xxxxb 03fec989h can1 message configurat ion register 20 c1mconf20 undefined 03fec98ah c1midl20 undefined 03fec98ch can1 message identifier register 20 c1midh20 undefined 03fec98eh can1 message control register 20 c1mctrl20 00x00000 000xx000b 03fec9a0h can1 message data byte 01 register 21 c1mdata0121 undefined 03fec9a0h can1 message data byte 0 register 21 c1mdata021 undefined 03fec9a1h can1 message data byte 1 register 21 c1mdata121 undefined 03fec9a2h can1 message data byte 23 register 21 c1mdata2321 undefined 03fec9a2h can1 message data byte 2 register 21 c1mdata221 undefined 03fec9a3h can1 message data byte 3 register 21 c1mdata321 undefined 03fec9a4h can1 message data byte 45 register 21 c1mdata4521 undefined 03fec9a4h can1 message data byte 4 register 21 c1mdata421 undefined 03fec9a5h can1 message data byte 5 register 21 c1mdata521 undefined 03fec9a6h can1 message data byte 67 register 21 c1mdata6721 undefined 03fec9a6h can1 message data byte 6 register 21 c1mdata621 undefined 03fec9a7h can1 message data byte 7 register 21 c1mdata721 undefined 03fec9a8h can1 message data length register 21 c1mdlc21 0000xxxxb 03fec9a9h can1 message configur ation register 21 c1mconf21 undefined 03fec9aah c1midl21 undefined 03fec9ach can1 message identifier register 21 c1midh21 undefined 03fec9aeh can1 message control register 21 c1mctrl21 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1139 table 21-16. register access types (30/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fec9c0h can1 message data byte 01 register 22 c1mdata0122 undefined 03fec9c0h can1 message data byte 0 register 22 c1mdata022 undefined 03fec9c1h can1 message data byte 1 register 22 c1mdata122 undefined 03fec9c2h can1 message data byte 23 register 22 c1mdata2322 undefined 03fec9c2h can1 message data byte 2 register 22 c1mdata222 undefined 03fec9c3h can1 message data byte 3 register 22 c1mdata322 undefined 03fec9c4h can1 message data byte 45 register 22 c1mdata4522 undefined 03fec9c4h can1 message data byte 4 register 22 c1mdata422 undefined 03fec9c5h can1 message data byte 5 register 22 c1mdata522 undefined 03fec9c6h can1 message data byte 67 register 22 c1mdata6722 undefined 03fec9c6h can1 message data byte 6 register 22 c1mdata622 undefined 03fec9c7h can1 message data byte 7 register 22 c1mdata722 undefined 03fec9c8h can1 message data length register 22 c1mdlc22 0000xxxxb 03fec9c9h can1 message configur ation register 22 c1mconf22 undefined 03fec9cah c1midl22 undefined 03fec9cch can1 message identifier register 22 c1midh22 undefined 03fec9ceh can1 message control register 22 c1mctrl22 00x00000 000xx000b 03fec9e0h can1 message data byte 01 register 23 c1mdata0123 undefined 03fec9e0h can1 message data byte 0 register 23 c1mdata023 undefined 03fec9e1h can1 message data byte 1 register 23 c1mdata123 undefined 03fec9e2h can1 message data byte 23 register 23 c1mdata2323 undefined 03fec9e2h can1 message data byte 2 register 23 c1mdata223 undefined 03fec9e3h can1 message data byte 3 register 23 c1mdata323 undefined 03fec9e4h can1 message data byte 45 register 23 c1mdata4523 undefined 03fec9e4h can1 message data byte 4 register 23 c1mdata423 undefined 03fec9e5h can1 message data byte 5 register 23 c1mdata523 undefined 03fec9e6h can1 message data byte 67 register 23 c1mdata6723 undefined 03fec9e6h can1 message data byte 6 register 23 c1mdata623 undefined 03fec9e7h can1 message data byte 7 register 23 c1mdata723 undefined 03fec9e8h can1 message data length register 23 c1mdlc23 0000xxxxb 03fec9e9h can1 message configur ation register 23 c1mconf23 undefined 03fec9eah c1midl23 undefined 03fec9ech can1 message identifier register 23 c1midh23 undefined 03fec9eeh can1 message control register 23 c1mctrl23 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1140 table 21-16. register access types (31/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03feca00h can1 message data byte 01 register 24 c1mdata0124 undefined 03feca00h can1 message data byte 0 register 24 c1mdata024 undefined 03feca01h can1 message data byte 1 register 24 c1mdata124 undefined 03feca02h can1 message data byte 23 register 24 c1mdata2324 undefined 03feca02h can1 message data byte 2 register 24 c1mdata224 undefined 03feca03h can1 message data byte 3 register 24 c1mdata324 undefined 03feca04h can1 message data byte 45 register 24 c1mdata4524 undefined 03feca04h can1 message data byte 4 register 24 c1mdata424 undefined 03feca05h can1 message data byte 5 register 24 c1mdata524 undefined 03feca06h can1 message data byte 67 register 24 c1mdata6724 undefined 03feca06h can1 message data byte 6 register 24 c1mdata624 undefined 03feca07h can1 message data byte 7 register 24 c1mdata724 undefined 03feca08h can1 message data length register 24 c1mdlc24 0000xxxxb 03feca09h can1 message configur ation register 24 c1mconf24 undefined 03feca0ah c1midl24 undefined 03feca0ch can1 message identifier register 24 c1midh24 undefined 03feca0eh can1 message control register 24 c1mctrl24 00x00000 000xx000b 03feca20h can1 message data byte 01 register 25 c1mdata0125 undefined 03feca20h can1 message data byte 0 register 25 c1mdata025 undefined 03feca21h can1 message data byte 1 register 25 c1mdata125 undefined 03feca22h can1 message data byte 23 register 25 c1mdata2325 undefined 03feca22h can1 message data byte 2 register 25 c1mdata225 undefined 03feca23h can1 message data byte 3 register 25 c1mdata325 undefined 03feca24h can1 message data byte 45 register 25 c1mdata4525 undefined 03feca24h can1 message data byte 4 register 25 c1mdata425 undefined 03feca25h can1 message data byte 5 register 25 c1mdata525 undefined 03feca26h can1 message data byte 67 register 25 c1mdata6725 undefined 03feca26h can1 message data byte 6 register 25 c1mdata625 undefined 03feca27h can1 message data byte 7 register 25 c1mdata725 undefined 03feca28h can1 message data length register 25 c1mdlc25 0000xxxxb 03feca29h can1 message configur ation register 25 c1mconf25 undefined 03feca2ah c1midl25 undefined 03feca2ch can1 message identifier register 25 c1midh25 undefined 03feca2eh can1 message control register 25 c1mctrl25 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1141 table 21-16. register access types (32/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03feca40h can1 message data byte 01 register 26 c1mdata0126 undefined 03feca40h can1 message data byte 0 register 26 c1mdata026 undefined 03feca41h can1 message data byte 1 register 26 c1mdata126 undefined 03feca42h can1 message data byte 23 register 26 c1mdata2326 undefined 03feca42h can1 message data byte 2 register 26 c1mdata226 undefined 03feca43h can1 message data byte 3 register 26 c1mdata326 undefined 03feca44h can1 message data byte 45 register 26 c1mdata4526 undefined 03feca44h can1 message data byte 4 register 26 c1mdata426 undefined 03feca45h can1 message data byte 5 register 26 c1mdata526 undefined 03feca46h can1 message data byte 67 register 26 c1mdata6726 undefined 03feca46h can1 message data byte 6 register 26 c1mdata626 undefined 03feca47h can1 message data byte 7 register 26 c1mdata726 undefined 03feca48h can1 message data length register 26 c1mdlc26 0000xxxxb 03feca49h can1 message configur ation register 26 c1mconf26 undefined 03feca4ah c1midl26 undefined 03feca4ch can1 message identifier register 26 c1midh26 undefined 03feca4eh can1 message control register 26 c1mctrl26 00x00000 000xx000b 03feca60h can1 message data byte 01 register 27 c1mdata0127 undefined 03feca60h can1 message data byte 0 register 27 c1mdata027 undefined 03feca61h can1 message data byte 1 register 27 c1mdata127 undefined 03feca62h can1 message data byte 23 register 27 c1mdata2327 undefined 03feca62h can1 message data byte 2 register 27 c1mdata227 undefined 03feca63h can1 message data byte 3 register 27 c1mdata327 undefined 03feca64h can1 message data byte 45 register 27 c1mdata4527 undefined 03feca64h can1 message data byte 4 register 27 c1mdata427 undefined 03feca65h can1 message data byte 5 register 27 c1mdata527 undefined 03feca66h can1 message data byte 67 register 27 c1mdata6727 undefined 03feca66h can1 message data byte 6 register 27 c1mdata627 undefined 03feca67h can1 message data byte 7 register 27 c1mdata727 undefined 03feca68h can1 message data length register 27 c1mdlc27 0000xxxxb 03feca69h can1 message configur ation register 27 c1mconf27 undefined 03feca6ah c1midl27 undefined 03feca6ch can1 message identifier register 27 c1midh27 undefined 03feca6eh can1 message control register 27 c1mctrl27 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1142 table 21-16. register access types (33/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03feca80h can1 message data byte 01 register 28 c1mdata0128 undefined 03feca80h can1 message data byte 0 register 28 c1mdata028 undefined 03feca81h can1 message data byte 1 register 28 c1mdata128 undefined 03feca82h can1 message data byte 23 register 28 c1mdata2328 undefined 03feca82h can1 message data byte 2 register 28 c1mdata228 undefined 03feca83h can1 message data byte 3 register 28 c1mdata328 undefined 03feca84h can1 message data byte 45 register 28 c1mdata4528 undefined 03feca84h can1 message data byte 4 register 28 c1mdata428 undefined 03feca85h can1 message data byte 5 register 28 c1mdata528 undefined 03feca86h can1 message data byte 67 register 28 c1mdata6728 undefined 03feca86h can1 message data byte 6 register 28 c1mdata628 undefined 03feca87h can1 message data byte 7 register 28 c1mdata728 undefined 03feca88h can1 message data length register 28 c1mdlc28 0000xxxxb 03feca89h can1 message configur ation register 28 c1mconf28 undefined 03feca8ah c1midl28 undefined 03feca8ch can1 message identifier register 28 c1midh28 undefined 03feca8eh can1 message control register 28 c1mctrl28 00x00000 000xx000b 03fecaa0h can1 message data byte 01 register 29 c1mdata0129 undefined 03fecaa0h can1 message data byte 0 register 29 c1mdata029 undefined 03fecaa1h can1 message data byte 1 register 29 c1mdata129 undefined 03fecaa2h can1 message data byte 23 register 29 c1mdata2329 undefined 03fecaa2h can1 message data byte 2 register 29 c1mdata229 undefined 03fecaa3h can1 message data byte 3 register 29 c1mdata329 undefined 03fecaa4h can1 message data byte 45 register 29 c1mdata4529 undefined 03fecaa4h can1 message data byte 4 register 29 c1mdata429 undefined 03fecaa5h can1 message data byte 5 register 29 c1mdata529 undefined 03fecaa6h can1 message data byte 67 register 29 c1mdata6729 undefined 03fecaa6h can1 message data byte 6 register 29 c1mdata629 undefined 03fecaa7h can1 message data byte 7 register 29 c1mdata729 undefined 03fecaa8h can1 message data length register 29 c1mdlc29 0000xxxxb 03fecaa9h can1 message configurat ion register 29 c1mconf29 undefined 03fecaaah c1midl29 undefined 03fecaach can1 message identifier register 29 c1midh29 undefined 03fecaaeh can1 message control register 29 c1mctrl29 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1143 table 21-16. register access types (34/34) bit manipulation units address register name symbol r/w 1 bit 8 bits 16 bits after reset 03fecac0h can1 message data byte 01 register 30 c1mdata0130 undefined 03fecac0h can1 message data byte 0 register 30 c1mdata030 undefined 03fecac1h can1 message data byte 1 register 30 c1mdata130 undefined 03fecac2h can1 message data byte 23 register 30 c1mdata2330 undefined 03fecac2h can1 message data byte 2 register 30 c1mdata230 undefined 03fecac3h can1 message data byte 3 register 30 c1mdata330 undefined 03fecac4h can1 message data byte 45 register 30 c1mdata4530 undefined 03fecac4h can1 message data byte 4 register 30 c1mdata430 undefined 03fecac5h can1 message data byte 5 register 30 c1mdata530 undefined 03fecac6h can1 message data byte 67 register 30 c1mdata6730 undefined 03fecac6h can1 message data byte 6 register 30 c1mdata630 undefined 03fecac7h can1 message data byte 7 register 30 c1mdata730 undefined 03fecac8h can1 message data length register 30 c1mdlc30 0000xxxxb 03fecac9h can1 message configur ation register 30 c1mconf30 undefined 03fecacah c1midl30 undefined 03fecacch can1 message identifier register 30 c1midh30 undefined 03fecaceh can1 message control register 30 c1mctrl30 00x00000 000xx000b 03fecae0h can1 message data byte 01 register 31 c1mdata0131 undefined 03fecae0h can1 message data byte 0 register 31 c1mdata031 undefined 03fecae1h can1 message data byte 1 register 31 c1mdata131 undefined 03fecae2h can1 message data byte 23 register 31 c1mdata2331 undefined 03fecae2h can1 message data byte 2 register 31 c1mdata231 undefined 03fecae3h can1 message data byte 3 register 31 c1mdata331 undefined 03fecae4h can1 message data byte 45 register 31 c1mdata4531 undefined 03fecae4h can1 message data byte 4 register 31 c1mdata431 undefined 03fecae5h can1 message data byte 5 register 31 c1mdata531 undefined 03fecae6h can1 message data byte 67 register 31 c1mdata6731 undefined 03fecae6h can1 message data byte 6 register 31 c1mdata631 undefined 03fecae7h can1 message data byte 7 register 31 c1mdata731 undefined 03fecae8h can1 message data length register 31 c1mdlc31 0000xxxxb 03fecae9h can1 message configurat ion register 31 c1mconf31 undefined 03fecaeah c1midl31 undefined 03fecaech can1 message identifier register 31 c1midh31 undefined 03fecaeeh can1 message control register 31 c1mctrl31 r/w 00x00000 000xx000b
chapter 21 can controller user?s manual u19201ej3v0ud 1144 21.5.3 register bit configuration table 21-17. can global register bit configuration address symbol bit 7/15 bit 6/14 bit 5/13 bit 4/12 bit 3/11 bit 2/10 bit 1/9 bit 0/8 03fexx00h 0 0 0 0 0 0 0 clear gom 03fexx01h cngmctrl (w) 0 0 0 0 0 0 set efsd set gom 03fexx00h 0 0 0 0 0 0 efsd gom 03fexx01h cngmctrl (r) mbon 0 0 0 0 0 0 0 03fexx02h cngmcs 0 0 0 0 ccp3 ccp2 ccp1 ccp0 03fexx06h 0 0 0 0 0 0 0 clear abttrg 03fexx07h cngmabt (w) 0 0 0 0 0 0 set abtclr set abttrg 03fexx06h 0 0 0 0 0 0 abtclr abttrg 03fexx07h cngmabt (r) 0 0 0 0 0 0 0 0 03fexx08h cngmabtd 0 0 0 0 abtd3 abtd2 abtd1 abtd0 remark n = 0, 1 when n = 0, xx = c0 when n = 1, xx = c6
chapter 21 can controller user?s manual u19201ej3v0ud 1145 table 21-18. can module register bit configuration (1/2) address symbol bit 7/15 bit 6/14 bit 5/13 bit 4/12 bit 3/11 bit 2/10 bit 1/9 bit 0/8 03fexx40h cmid7 to cmid0 03fexx41h cnmask1l cmid15 to cmid8 03fexx42h cmid23 to cmid16 03fexx43h cnmask1h 0 0 0 cmid28 to cmid24 03fexx44h cmid7 to cmid0 03fexx45h cnmask2l cmid15 to cmid8 03fexx46h cmid23 to cmid16 03fexx47h cnmask2h 0 0 0 cmid28 to cmid24 03fexx48h cmid7 to cmid0 03fexx49h cnmask3l cmid15 to cmid8 03fexx4ah cmid23 to cmid16 03fexx4bh cnmask3h 0 0 0 cmid28 to cmid24 03fexx4ch cmid7 to cmid0 03fexx4dh cnmask4l cmid15 to cmid8 03fexx4eh cmid23 to cmid16 03fexx4fh cnmask4h 0 0 0 cmid28 to cmid24 03fexx50h 0 clear al clear valid clear psmode1 clear psmode0 clear opmode2 clear opmode1 clear opmode0 03fexx51h cnctrl (w) set ccerc set al 0 set psmode1 set psmode0 set opmode2 set opmode1 set opmode0 03fexx50h ccerc al valid ps mode1 ps mode0 op mode2 op mode1 op mode0 03fexx51h cnctrl (r) 0 0 0 0 0 0 rstat tstat 03fexx52h cnlec (w) 0 0 0 0 0 0 0 0 03fexx52h cnlec (r) 0 0 0 0 0 lec2 lec1 lec0 03fexx53h cninfo 0 0 0 boff tecs1 tecs0 recs1 recs0 03fexx54h tec7 to tec0 03fexx55h cnerc rec7 to rec0 03fexx56h 0 0 clear cie5 clear cie4 clear cie3 clear cie2 clear cie1 clear cie0 03fexx57h cnie (w) 0 0 set cie5 set cie4 set cie3 set cie2 set cie1 set cie0 03fexx56h 0 0 cie5 cie4 cie3 cie2 cie1 cie0 03fexx57h cnie (r) 0 0 0 0 0 0 0 0 03fexx58h 0 0 clear cints5 clear cints4 clear cints3 clear cints2 clear cints1 clear cints0 03fexx59h cnints (w) 0 0 0 0 0 0 0 0 03fexx58h 0 0 cints5 cints4 cints3 cints2 cints1 cints0 03fexx59h cnints (r) 0 0 0 0 0 0 0 0 remark n = 0, 1 when n = 0, xx = c0 when n = 1, xx = c6
chapter 21 can controller user?s manual u19201ej3v0ud 1146 table 21-18. can module register bit configuration (2/2) address symbol bit 7/15 bit 6/14 bit 5/13 bit 4/12 bit 3/11 bit 2/10 bit 1/9 bit 0/8 03fexx5ah cnbrp tqprs7 to tqprs0 03fexx5ch 0 0 0 0 tseg13 to tseg10 03fexx5dh cnbtr 0 0 sjw1, sjw0 0 tseg22 to tseg20 03fexx5eh cnlipt lipt7 to lipt0 03fexx60h 0 0 0 0 0 0 0 clear rovf 03fexx61h cnrgpt (w) 0 0 0 0 0 0 0 0 03fexx60h 0 0 0 0 0 0 rhpm rovf 03fexx61h cnrgpt (r) rgpt7 to rgpt0 03fexx62h cnlopt lopt7 to lopt0 03fexx64h 0 0 0 0 0 0 0 clear tovf 03fexx65h cntgpt (w) 0 0 0 0 0 0 0 0 03fexx64h 0 0 0 0 0 0 thpm tovf 03fexx65h cntgpt (r) tgpt7 to tgpt0 03fexx66h 0 0 0 0 0 clear tslock clear tssel clear tsen 03fexx67h cnts (w) 0 0 0 0 0 set tslock set tssel set tsen 03fexx66h 0 0 0 0 0 tslock tssel tsen 03fexx67h cnts (r) 0 0 0 0 0 0 0 0 03fexx68h to 03fexxffh ? access prohibited (reserved for future use) remark n = 0, 1 when n = 0, xx = c0 when n = 1, xx = c6
chapter 21 can controller user?s manual u19201ej3v0ud 1147 table 21-19. message buffer register bit configuration address symbol bit 7/15 bit 6/14 bit 5/13 bit 4/12 bit 3/11 bit 2/10 bit 1/9 bit 0/8 03fecxx0h message data (byte 0) 03fecxx1h cnmdata01m message data (byte 1) 03fecxx0h cnmdata0m message data (byte 0) 03fecxx1h cnmdata1m message data (byte 1) 03fecxx2h message data (byte 2) 03fecxx3h cnmdata23m message data (byte 3) 03fecxx2h cnmdata2m message data (byte 2) 03fecxx3h cnmdata3m message data (byte 3) 03fecxx4h message data (byte 4) 03fecxx5h cnmdata45m message data (byte 5) 03fecxx4h cnmdata4m message data (byte 4) 03fecxx5h cnmdata5m message data (byte 5) 03fecxx6h message data (byte 6) 03fecxx7h cnmdata67m message data (byte 7) 03fecxx6h cnmdata6m message data (byte 6) 03fecxx7h cnmdata7m message data (byte 7) 03fecxx8h cnmdlcm 0 mdlc3 mdlc2 mdlc1 mdlc0 03fecxx9h cnmconfm ows rtr mt2 mt1 mt0 0 0 ma0 03fecxxah id7 id6 id5 id4 id3 id2 id1 id0 03fecxxbh cnmidlm id15 id14 id13 id12 id11 id10 id9 id8 03fecxxch id23 id22 id21 id20 id19 id18 id17 id16 03fecxxdh cnmidhm ide 0 0 id28 id27 id26 id25 id24 03fecxxeh 0 0 0 clear mow clear ie clear dn clear trq clear rdy 03fecxxfh cnmctrlm (w) 0 0 0 0 set ie 0 set trq set rdy 03fecxxeh 0 0 0 mow ie dn trq rdy 03fecxxfh cnmctrlm (r) 0 0 muc 0 0 0 0 0 03fecxx0 to 03fecxxfh ? access prohibited (reserved for future use) remark n = 0, 1 m = 00 to 31 when n = 0, xx = 10, 12, 14, 16, 18, 1a, 1c, 1e, 20, 22, 24, 26, 28, 2a, 2c, 2e, 30, 32, 34, 36, 38, 3a, 3c, 3e, 40, 42, 44, 46, 48, 4a, 4c, 4e when n = 1, xx = 70, 72, 74, 76, 78, 7a, 7c, 7e, 80, 82, 84, 86, 88, 8a, 8c, 8e, 90, 92, 94, 96, 98, 9a, 9c, 9e, a0, a2, a4, a6, a8, aa, ac, ae
chapter 21 can controller user?s manual u19201ej3v0ud 1148 21.6 registers caution accessing the can controller registers is prohibi ted in the following statuses. for details, refer to 3.4.9 (2) accessi ng specific on-chip peripheral i/o registers. ? when the cpu operates with the subclock a nd the main clock oscillation is stopped ? when the cpu operates with th e internal oscillation clock remark n = 0, 1 m = 00 to 31
chapter 21 can controller user?s manual u19201ej3v0ud 1149 (1) cann global control register (cngmctrl) the cngmctrl register is used to cont rol the operation of the can module. (1/2) after reset: 0000h r/w address: c0gmctrl 03fec000h, c1gmctrl 03fec600h (a) read 15 14 13 12 11 10 9 8 cngmctrl mbon 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 efsd gom (b) write 15 14 13 12 11 10 9 8 cngmctrl 0 0 0 0 0 0 set efsd set gom 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 clear gom (a) read mbon bit enabling access to message buffer regi ster, transmit/receive history registers 0 write access and read access to the message buffer register and the transm it/receive history list registers is disabled. 1 write access and read access to the message buffer register and the transm it/receive history list registers is enabled. cautions 1. while the mbon bit is cleared (to 0), software access to the message buffers (cnmdata0m, cnmdata1m, cnmdat a01m, cnmdata2m, cnmdata3m, cnmdata23m, cnmdata4m, cnmdat a5m, cnmdata45m, cnmdata6m, cnmdata7m, cnmdata67m, cnmdlcm, cnmconfm, cnmidlm, cnmidhm, and cnmctrlm), or registers re lated to transmit history or receive history (cnlopt, cntgpt, cnlipt, and cnrgpt) is disabled. 2. this bit is read-only. even if 1 is written to the mbon bit while it is 0, the value of the mbon bit does not change, and access to th e message buffer registers, or registers related to transmit history or receive history remains disabled. remark when the can sleep mode/can stop mode is entered , or when the gom bit is cleared to 0, the mbon bit is cleared to 0. when the can sl eep mode/can stop mode is released, or when the gom bit is set to 1, the mbon bit is set to 1.
chapter 21 can controller user?s manual u19201ej3v0ud 1150 (2/2) efsd bit enabling forced shut down 0 forced shut down by gom bit = 0 disabled. 1 forced shut down by gom bit = 0 enabled. caution to request forced shut down, clear the gom bit to 0 immediately after the efsd bit has been set to 1. if access to a nother register (including read ing the cngmctrl register) is executed by software (interrupts including nm i) or dma without clearing the gom bit immediately after the efsd bit h as been set to 1, the efsd bit is forcibly cleared to 0, and the forced shut down request is invalid. gom global operation mode bit 0 can module is disabled from operating. 1 can module is enabled to operate. caution the gom bit is cleared to 0 only in the initialization mode or immediately after the efsd bit is set to 1. (b) write set efsd efsd bit setting 0 no change in efsd bit. 1 efsd bit set to 1. set gom clear gom gom bit setting 0 1 gom bit cleared to 0. 1 0 gom bit set to 1. other than above no change in gom bit. caution be sure to set the gom bit and efsd bit separately.
chapter 21 can controller user?s manual u19201ej3v0ud 1151 (2) cann global clock selection register (cngmcs) the cngmcs register is used to select the can module system clock. after reset: 0fh r/w address: c0gmcs 03fec002h, c1gmcs 03fec602h 7 6 5 4 3 2 1 0 cngmcs 0 0 0 0 ccp3 ccp2 ccp1 ccp0 ccp3 ccp2 ccp1 ccp0 can module system clock (f canmod ) 0 0 0 0 f can /1 0 0 0 1 f can /2 0 0 1 0 f can /3 0 0 1 1 f can /4 0 1 0 0 f can /5 0 1 0 1 f can /6 0 1 1 0 f can /7 0 1 1 1 f can /8 1 0 0 0 f can /9 1 0 0 1 f can /10 1 0 1 0 f can /11 1 0 1 1 f can /12 1 1 0 0 f can /13 1 1 0 1 f can /14 1 1 1 0 f can /15 1 1 1 1 f can /16 (default value) remark f can : can clock frequency in clock mode 1, f can = f xx in clock mode 2, f can = f xmpll (29.28 to 32 mhz) in clock mode 3, f can = f xmpll (29.28 to 32 mhz) in clock mode 4, f can = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clocks
chapter 21 can controller user?s manual u19201ej3v0ud 1152 (3) cann global automatic block transm ission control register (cngmabt) the cngmabt register is used to control the automatic block transmission (abt) operation. (1/2) after reset: 0000h r/w address: c0gmabt 03fec006h, c1gmabt 03fec606h (a) read 15 14 13 12 11 10 9 8 cngmabt 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 abtclr abttrg (b) write 15 14 13 12 11 10 9 8 cngmabt 0 0 0 0 0 0 set abtclr set abttrg 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 clear abttrg caution before changing the norma l operation mode with abt to the initialization mode, be sure to set the cngmabt register to the default value (0000h). after setting, confirm that the cngmabt register is initialized to 0000h. (a) read abtclr automatic block transmi ssion engine clear status bit 0 clearing the automatic transmission engine is completed. 1 the automatic transmissi on engine is being cleared. remarks 1. set the abtclr bit to 1 while t he abttrg bit is cleared to 0. the operation is not guaranteed if the abtclr bit is set to 1 while the abttrg bit is set to 1. 2. when the automatic block transmission engine is cleared by setting the abtclr bit to 1, the abtclr bit is automatically cleared to 0 as soon as the requested clearing processing is complete. abttrg automatic block transmission status bit 0 automatic block transmission is stopped. 1 automatic block transmissi on is under execution. cautions 1. do not set the abttrg bit to 1 in the initialization mode. if the abttrg bit is set to 1 in the initialization mode, the operation is not guaranteed after the can module has entered the normal operation mode with abt. 2. do not set the abttrg bit to 1 while the cnctrl.tstat bit is set to 1. directly confirm that the tstat bit = 0 before setting the abttrg bit to 1.
chapter 21 can controller user?s manual u19201ej3v0ud 1153 (2/2) (b) write set abtclr automatic block trans mission engine clear request bit 0 the automatic block transmission engine is in idle status or under operation. 1 request to clear the automatic block transmissi on engine. after the automatic block transmission engine has been cleared, automatic block transmission is started from message buffer 0 by setting the abttrg bit to 1. set abttrg clear abttrg automati c block transmi ssion start bit 0 1 request to stop automatic block transmission. 1 0 request to start automatic block transmission. other than above no change in abttrg bit. caution even if the abttrg bit is set (1), transm ission is not immediately executed, depending on the situation such as when a message is received from another node or when a message other than the abt message (message buffers 8 to 31) is transmitted. even if the abttrg bit is cleared (0), tr ansmission is not terminated midway. if transmission is under execution, it is continued until comp leted (regardless of whether transmission is successful or fails).
chapter 21 can controller user?s manual u19201ej3v0ud 1154 (4) cann global automatic block transm ission delay register (cngmabtd) the cngmabtd register is used to set the interval at which the data of the message buffer assigned to abt is to be transmitted in the normal operation mode with abt. after reset: 00h r/w address: c0gmabtd 03fec008h, c1gmabtd 03fec608h 7 6 5 4 3 2 1 0 cngmabtd 0 0 0 0 abtd3 abtd2 abtd1 abtd0 abtd3 abtd2 abtd1 abtd0 data frame interval during aut omatic block transmission (unit: data bit time (dbt)) 0 0 0 0 0 dbt (default value) 0 0 0 1 2 5 dbt 0 0 1 0 2 6 dbt 0 0 1 1 2 7 dbt 0 1 0 0 2 8 dbt 0 1 0 1 2 9 dbt 0 1 1 0 2 10 dbt 0 1 1 1 2 11 dbt 1 0 0 0 2 12 dbt other than above setting prohibited cautions 1. do not change the contents of the cngmabtd register while the abttrg bit is set to 1. 2. the timing at which th e abt message is actually transmitted onto the can bus differs depending on the status of transmission from the other station or how a request to transmit a message other than an abt mess age (message buffers 8 to 31) is made. 3. be sure to set bits 4 to 7 to ?0?.
chapter 21 can controller user?s manual u19201ej3v0ud 1155 (5) cann module mask control register (cnmas kal, cnmaskah) (a = 1, 2, 3, or 4) the cnmaskal and cnmaskah registers are used to ex tend the number of receivable messages in the same message buffer by masking part of the identifier (id) of a message and invalidating the id comparison of the masked part. (1/2) ? cann module mask 1 register (cnmask1l, cnmask1h) after reset: undefined r/w address: c0mask1l 03fec040h, c1mask1l 03fec640h, c0mask1h 03fec042h, c1mask1h 03fec642h 15 14 13 12 11 10 9 8 cnmask1l cmid15 cmid14 cmid13 cmid12 cmid11 cmid10 cmid9 cmid8 7 6 5 4 3 2 1 0 cmid7 cmid6 cmid5 cmid4 cmid3 cmid2 cmid1 cmid0 15 14 13 12 11 10 9 8 cnmask1h 0 0 0 cmid28 cmid27 cmid26 cmid25 cmid24 7 6 5 4 3 2 1 0 cmid23 cmid22 cmid21 cmid20 cmid19 cmid18 cmid17 cmid16 ? cann module mask 2 register (cnmask2l, cnmask2h) after reset: undefined r/w address: c0mask2l 03fec044h, c1mask2l 03fec644h, c0mask2h 03fec046h, c1mask2h 03fec646h 15 14 13 12 11 10 9 8 cnmask2l cmid15 cmid14 cmid13 cmid12 cmid11 cmid10 cmid9 cmid8 7 6 5 4 3 2 1 0 cmid7 cmid6 cmid5 cmid4 cmid3 cmid2 cmid1 cmid0 15 14 13 12 11 10 9 8 cnmask2h 0 0 0 cmid28 cmid27 cmid26 cmid25 cmid24 7 6 5 4 3 2 1 0 cmid23 cmid22 cmid21 cmid20 cmid19 cmid18 cmid17 cmid16
chapter 21 can controller user?s manual u19201ej3v0ud 1156 (2/2) ? cann module mask 3 register (cnmask3l, cnmask3h) after reset: undefined r/w address: c0mask3l 03fec048h, c1mask3l 03fec648h, c0mask3h 03fec04ah, c1mask3h 03fec64ah 15 14 13 12 11 10 9 8 cnmask3l cmid15 cmid14 cmid13 cmid12 cmid11 cmid10 cmid9 cmid8 7 6 5 4 3 2 1 0 cmid7 cmid6 cmid5 cmid4 cmid3 cmid2 cmid1 cmid0 15 14 13 12 11 10 9 8 cnmask3h 0 0 0 cmid28 cmid27 cmid26 cmid25 cmid24 7 6 5 4 3 2 1 0 cmid23 cmid22 cmid21 cmid20 cmid19 cmid18 cmid17 cmid16 ? cann module mask 4 register (cnmask4l, cnmask4h) after reset: undefined r/w address: c0mask4l 03fec04ch, c1mask4l 03fec64ch, c0mask4h 03fec04eh, c1mask4h 03fec64eh 15 14 13 12 11 10 9 8 cnmask4l cmid15 cmid14 cmid13 cmid12 cmid11 cmid10 cmid9 cmid8 7 6 5 4 3 2 1 0 cmid7 cmid6 cmid5 cmid4 cmid3 cmid2 cmid1 cmid0 15 14 13 12 11 10 9 8 cnmask4h 0 0 0 cmid28 cmid27 cmid26 cmid25 cmid24 7 6 5 4 3 2 1 0 cmid23 cmid22 cmid21 cmid20 cmid19 cmid18 cmid17 cmid16 cmid28 to cmid0 mask pattern setting of id bit 0 the id bits of the message buffer set by the cmid28 to cmid0 bits are compared with the id bits of the received message frame. 1 the id bits of the message buffer set by the cmid28 to cmid0 bits are not compared with the id bits of the received message frame (they are masked). caution be sure to set bits 13 to 15 of the cnmaskah register to 0. remark masking is always defined by an id length of 29 bits. if a mask is assigned to a message with a standard id, the cmid17 to cmid0 bits are ignored. therefore, only the cmid28 to cmid18 bits of the received id are masked. the same mask can be used for both the standard and extended ids.
chapter 21 can controller user?s manual u19201ej3v0ud 1157 (6) cann module control register (cnctrl) the cnctrl register is used to control the operation mode of the can module. (1/4) after reset: 0000h r/w address: c0ctrl 03fec050h, c1ctrl 03ffec650h (a) read 15 14 13 12 11 10 9 8 cnctrl 0 0 0 0 0 0 rstat tstat 7 6 5 4 3 2 1 0 ccerc al valid psmode 1 psmode 0 opmode 2 opmode 1 opmode 0 (b) write 15 14 13 12 11 10 9 8 cnctrl set ccerc set al 0 set psmode 1 set psmode 0 set opmode 2 set opmode 1 set opmode 0 7 6 5 4 3 2 1 0 0 clear al clear valid clear psmode 1 clear psmode 0 clear opmode 2 clear opmode 1 clear opmode 0 (a) read rstat reception status bit 0 reception is stopped. 1 reception is in progress. remark ? the rstat bit is set to 1 under the following conditions (timing) ? the sof bit of a receive frame is detected ? on occurrence of arbitration loss during a transmit frame ? the rstat bit is cleared to 0 under the following conditions (timing) ? when a recessive level is detected at the second bit of the interframe space ? on transition to the initialization mode at the first bit of the interframe space tstat transmission status bit 0 transmission is stopped. 1 transmission is in progress. remark ? the tstat bit is set to 1 under the following conditions (timing) ? the sof bit of a transmit frame is detected ? the tstat bit is cleared to 0 under the following conditions (timing) ? during transition to bus-off status ? on occurrence of arbitration loss in transmit frame ? on detection of recessive level at t he second bit of the interframe space ? on transition to the initialization mode at the first bit of the interframe space
chapter 21 can controller user?s manual u19201ej3v0ud 1158 (2/4) ccerc error counter clear bit 0 the cnerc and cninfo registers are not cleared in the initialization mode. 1 the cnerc and cninfo registers are cleared in the initialization mode. remarks 1. the ccerc bit is used to clear the cnerc and cninfo registers for re-initialization or forced recovery from the bus-off status. this bi t can be set to 1 only in the initialization mode. 2. when the cnerc and cninfo registers have been cleared, the ccerc bit is also cleared to 0 automatically. 3. the ccerc bit can be set to 1 at the same ti me as a request to change the initialization mode to an operation mode is made. 4. if the ccerc bit is set to 1 immediately after t he init mode is entered in the self test mode, the receive data may be corrupted. al bit to set operation in case of arbitration loss 0 re-transmission is not executed in case of an arbitration loss in the single-shot mode. 1 re-transmission is executed in case of an arbitration loss in the single-shot mode. remark the al bit is valid only in the single-shot mode. valid valid receive message frame detection bit 0 a valid message frame has not been received since the valid bit was last cleared to 0. 1 a valid message frame has been received since the valid bit was last cleared to 0. remarks 1. detection of a valid receive message fram e is not dependent upon the existence or non- existence of the storage in the receive me ssage buffer (data frame) or transmit message buffer (remote frame). 2. clear the valid bit (0) before changing the initialization mode to an operation mode. 3. if only two can nodes are connected to the can bus with one transmitting a message frame in the normal mode and the other in the receive-only mode, since no ack is generated in the receive-only mode, the valid bit is not set to 1 before the transmitting node enters the error passive status. 4. to clear the valid bit, set the clear valid bi t to 1 first and confirm that the valid bit is cleared. if it is not cleared, perform clearing processing again.
chapter 21 can controller user?s manual u19201ej3v0ud 1159 (3/4) psmode1 psmode0 power save mode 0 0 no power save mode is selected. 0 1 can sleep mode 1 0 setting prohibited 1 1 can stop mode cautions 1. transition to and from the can stop mode must be made via can sleep mode. a request for direct transition to a nd from the can stop mode is ignored. 2. after releasing the power save mode, the cngmctrl.mbon flag must be checked before accessing the message buffer again. 3. a request for transition to the can sleep mode is held pe nding until it is canceled by software or until the can bus enters the bus idle state. the software can check transition to the can sleep mode by r eading the psmode0 and psmode1 bits. opmode2 opmode1 opmo de0 operation mode 0 0 0 no operation mode is selected (can module is in the initialization mode). 0 0 1 normal operation mode 0 1 0 normal operation mode with automat ic block transmission function (normal operation mode with abt) 0 1 1 receive-only mode 1 0 0 single-shot mode 1 0 1 self-test mode other than above setting prohibited caution it may take time to ch ange the mode to the initializ ation mode or power save mode. therefore, be sure to check if the mode has been successfully cha nged, by reading the register value before executing the processing. remark the opmode0 to opmode2 bits are read- only in the can sleep mode or can stop mode. (b) write set ccerc setting of ccerc bit 1 ccerc bit is set to 1. other than above ccerc bit is not changed. set al clear al setting of al bit 0 1 al bit is cleared to 0. 1 0 al bit is set to 1. other than above al bit is not changed. clear valid setting of valid bit 0 valid bit is not changed. 1 valid bit is cleared to 0.
chapter 21 can controller user?s manual u19201ej3v0ud 1160 (4/4) set psmode0 clear psmode0 setting of psmode0 bit 0 1 psmode0 bit is cleared to 0. 1 0 psmode bit is set to 1. other than above psmode0 bit is not changed. set psmode1 clear psmode1 setting of psmode1 bit 0 1 psmode1 bit is cleared to 0. 1 0 psmode1 bit is set to 1. other than above psmode1 bit is not changed. set opmode0 clear opmode0 setting of opmode0 bit 0 1 opmode0 bit is cleared to 0. 1 0 opmode0 bit is set to 1. other than above opmode0 bit is not changed. set opmode1 clear opmode1 setting of opmode1 bit 0 1 opmode1 bit is cleared to 0. 1 0 opmode1 bit is set to 1. other than above opmode1 bit is not changed. set opmode2 clear opmode2 setting of opmode2 bit 0 1 opmode2 bit is cleared to 0. 1 0 opmode2 bit is set to 1. other than above opmode2 bit is not changed.
chapter 21 can controller user?s manual u19201ej3v0ud 1161 (7) cann module last error in formation register (cnlec) the cnlec register provides the erro r information of the can protocol. after reset: 00h r/w address: c0lec 03fec052h, c1lec 03fec652h 7 6 5 4 3 2 1 0 cnlec 0 0 0 0 0 lec2 lec1 lec0 lec2 lec1 lec0 last can protocol error information 0 0 0 no error 0 0 1 stuff error 0 1 0 form error 0 1 1 ack error 1 0 0 bit error. (the can module tried to transm it a recessive-level bit as part of a transmit message (except the arbitration fi eld), but the value on the can bus is a dominant-level bit.) 1 0 1 bit error. (the can module tried to tran smit a dominant-level bit as part of a transmit message, ack bit, error frame, or overload frame, but the value on the can bus is a recessive-level bit.) 1 1 0 crc error 1 1 1 undefined caution be sure to set bits 3 to 7 to ?0?. remarks 1. the contents of the cnlec r egister are not cleared when the can module changes from an operation mode to the initialization mode. 2. if an attempt is made to write a value other than 00h to the cnlec register by software, the access is ignored.
chapter 21 can controller user?s manual u19201ej3v0ud 1162 (8) cann module information register (cninfo) the cninfo register indicates the status of the can module. after reset: 00h r address: c0info 03fec053h, c1info 03fec653h 7 6 5 4 3 2 1 0 cninfo 0 0 0 boff tecs1 tecs0 recs1 recs0 boff bus-off status bit 0 not bus-off status (transmit error counter 255). (the value of the transmi t counter is less than 256.) 1 bus-off status (transmit error counter > 255). (the value of the transmit error counter is 256 or more.) tecs1 tecs0 transmission e rror counter status bit 0 0 the value of the transmission error counter is less than that of the warning level ( < 96). 0 1 the value of the transmission error counter is in the range of the warning level (96 to 127). 1 0 undefined 1 1 the value of the transmission error counter is in the range of the error passive or bus-off status ( 128). recs1 recs0 reception error counter status bit 0 0 the value of the reception error counter is less than that of the warning level ( < 96). 0 1 the value of the reception error counter is in the range of the warning level (96 to 127). 1 0 undefined 1 1 the value of the reception error c ounter is in the error passive range ( 128). caution be sure to set bits 5 to 7 to ?0?.
chapter 21 can controller user?s manual u19201ej3v0ud 1163 (9) cann module error counter register (cnerc) the cnerc register indicates the count value of the transmission/reception error counter. after reset: 0000h r address: c0erc 03fec054h, c1erc 03fec654h 15 14 13 12 11 10 9 8 cnerc reps rec6 rec5 rec4 rec3 rec2 rec1 rec0 7 6 5 4 3 2 1 0 tec7 tec6 tec5 tec4 tec3 tec2 tec1 tec0 reps reception error passive status bit 0 the value of the reception error c ounter is not error passive (< 128) 1 the value of the reception error count er is in the error passive range ( 128) rec6 to rec0 reception error counter bit 0 to 127 number of reception errors. these bits reflect the status of the reception error counter. the number of errors is defined by the can protocol. remark the rec6 to rec0 bits of the reception error counter are invalid in the reception error passive status (cninfo.recs1, cn info.recs0 bit = 11b). tec7 to tec0 transmission error counter bit 0 to 255 number of transmission errors. these bits reflect the status of the transmission error counter. the number of errors is defined by the can protocol. remark the tec7 to tec0 bits of the transmission er ror counter are invalid in the bus-off status (cninfo.boff bit = 1).
chapter 21 can controller user?s manual u19201ej3v0ud 1164 (10) cann module interrupt enable register (cnie) the cnie register is used to enable or disable the interrupts of the can module. (1/2) after reset: 0000h r/w address: c0ie 03fec056h, c1ie 03fec656h (a) read 15 14 13 12 11 10 9 8 cnie 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 cie5 cie4 cie3 cie2 cie1 cie0 (b) write 15 14 13 12 11 10 9 8 cnie 0 0 set cie5 set cie4 set cie3 set cie2 set cie1 set cie0 7 6 5 4 3 2 1 0 0 0 clear cie5 clear cie4 clear cie3 clear cie2 clear cie1 clear cie0 (a) read cie5 to cie0 can module interrupt enable bit 0 output of the interrupt corresponding to inte rrupt status register cintsx is disabled. 1 output of the interrupt corresponding to interrupt status register cintsx is enabled.
chapter 21 can controller user?s manual u19201ej3v0ud 1165 (2/2) (b) write set cie5 clear cie5 setting of cie5 bit 0 1 cie5 bit is cleared to 0. 1 0 cie5 bit is set to 1. other than above cie5 bit is not changed. set cie4 clear cie4 setting of cie4 bit 0 1 cie4 bit is cleared to 0. 1 0 cie4 bit is set to 1. other than above cie4 bit is not changed. set cie3 clear cie3 setting of cie3 bit 0 1 cie3 bit is cleared to 0. 1 0 cie3 bit is set to 1. other than above cie3 bit is not changed. set cie2 clear cie2 setting of cie2 bit 0 1 cie2 bit is cleared to 0. 1 0 cie2 bit is set to 1. other than above cie2 bit is not changed. set cie1 clear cie1 setting of cie1 bit 0 1 cie1 bit is cleared to 0. 1 0 cie1 bit is set to 1. other than above cie1 bit is not changed. set cie0 clear cie0 setting of cie0 bit 0 1 cie0 bit is cleared to 0. 1 0 cie0 bit is set to 1. other than above cie0 bit is not changed.
chapter 21 can controller user?s manual u19201ej3v0ud 1166 (11) cann module interrupt st atus register (cnints) the cnints register indicates the in terrupt status of the can module. after reset: 0000h r/w address: c0ints 03fec058h, c1ints 03fec658h (a) read 15 14 13 12 11 10 9 8 cnints 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 cints5 cints4 cints3 cints2 cints1 cints0 (b) write 15 14 13 12 11 10 9 8 cnints 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 clear cints5 clear cints4 clear cints3 clear cints2 clear cints1 clear cints0 (a) read cints5 to cints0 can interrupt status bit 0 no related interrupt source event is generated. 1 a related interrupt source event is generated. interrupt status bit related interrupt source event cints5 wakeup interrupt from can sleep mode note cints4 arbitration loss interrupt cints3 can protocol error interrupt cints2 can error status interrupt cints1 interrupt on completion of reception of valid message frame to message buffer m cints0 interrupt on normal completion of tr ansmission of message frame from message buffer m note the cints5 bit is set (1) only when the can m odule is woken up from the can sleep mode by a can bus operation. the cints5 bit is not set (1) when the can sleep mode has been released by software. (b) write clear cints5 to cints0 setting of cints5 to cints0 bits 0 cints5 to cints0 bits are not changed. 1 cints5 to cints0 bits are cleared to 0. caution the status bit of this register is not auto matically cleared. clear it (0) by software if each status must be checked in the interrupt servicing.
chapter 21 can controller user?s manual u19201ej3v0ud 1167 (12) cann module bit rate prescaler register (cnbrp) the cnbrp register is used to select the can protocol layer base clock (f tq ). the communication baud rate is set to the cnbtr register. after reset: ffh r/w address: c0brp 03fec05ah, c1brp 03fec65ah 7 6 5 4 3 2 1 0 cnbrp tqprs7 tqprs6 tqprs5 tqprs4 tqprs3 tqprs2 tqprs1 tqprs0 tqprs7 to tqprs0 can protocol layer base system clock (f tq ) 0 f canmod /1 1 f canmod /2 n f canmod /(n + 1) : : 255 f canmod /256 (default value) figure 21-23. can module clock ccp 3 ccp2 prescaler cann module bit-rate prescaler register (cnbrp) cann global clock selection register (cngmcs) baud rate generator cann bit-rate register (cnbtr) ccp1 ccp0 tqprs0 f can f canmod f tq 0 0 0 0 tqprs1 tqprs2 tqprs3 tqprs4 tqprs5 tqprs6 tqprs7 remark f can : can clock frequency in clock mode 1, f can = f xx in clock mode 2, f can = f xmpll (29.28 to 32 mhz) in clock mode 3, f can = f xmpll (29.28 to 32 mhz) in clock mode 4, f can = f xmpll /2 (20.88 to 24 mhz) f xx : main clock frequency f xmpll : pll output clock frequency for peripheral clocks f canmod : can module system clock frequency f tq : can protocol layer base system clock frequency caution the cnbrp register can be write- accessed only in the initialization mode.
chapter 21 can controller user?s manual u19201ej3v0ud 1168 (13) cann module bit rate register (cnbtr) the cnbtr register is used to control the data bit time of the communication baud rate. figure 21-24. data bit time data bit time (dbt) time segment 1 (tseg1) phase segment 2 phase segment 1 sample point (spt) prop segment sync segment time segment 2 (tseg2)
chapter 21 can controller user?s manual u19201ej3v0ud 1169 after reset: 370fh r/w address: c0btr 03fec05ch, c1btr 03fec65ch 15 14 13 12 11 10 9 8 cnbtr 0 0 sjw1 sjw0 0 tseg22 tseg21 tseg20 7 6 5 4 3 2 1 0 0 0 0 0 tseg13 t seg12 tseg11 tseg10 sjw1 sjw0 length of synchronization jump width 0 0 1tq 0 1 2tq 1 0 3tq 1 1 4tq (default value) tseg22 tseg21 tseg20 length of time segment 2 0 0 0 1tq 0 0 1 2tq 0 1 0 3tq 0 1 1 4tq 1 0 0 5tq 1 0 1 6tq 1 1 0 7tq 1 1 1 8tq (default value) tseg13 tseg12 tseg 11 tseg10 length of time segment 1 0 0 0 0 setting prohibited 0 0 0 1 2tq note 0 0 1 0 3tq note 0 0 1 1 4tq 0 1 0 0 5tq 0 1 0 1 6tq 0 1 1 0 7tq 0 1 1 1 8tq 1 0 0 0 9tq 1 0 0 1 10tq 1 0 1 0 11tq 1 0 1 1 12tq 1 1 0 0 13tq 1 1 0 1 14tq 1 1 1 0 15tq 1 1 1 1 16tq (default value) note this setting must not be made when the cnbrp register = 00h. remark tq = 1/f tq (f tq : can protocol layer base system clock)
chapter 21 can controller user?s manual u19201ej3v0ud 1170 (14) cann module last in-pointer register (cnlipt) the cnlipt register indicates the number of the message buffer in whic h a data frame or a remote frame was last stored. after reset: undefined r address: c0li pt 03fec05eh, c1lipt 03fec65eh 7 6 5 4 3 2 1 0 cnlipt lipt7 lipt6 lipt5 li pt4 lipt3 lipt2 lipt1 lipt0 lipt7 to lipt0 last in-pointer register (cnlipt) 0 to 31 when the cnlipt register is read, the contents of the element indexed by the last in-pointer (lipt) of the receive history list are read. these contents indicate the number of the message buffer in which a data frame or a remote frame was last stored. remark the read value of the cnlipt r egister is undefined if a data fr ame or a remote frame has never been stored in the message buffer. if the cnrg pt.rhpm bit is set to 1 after the can module has changed from the initialization mode to an oper ation mode, therefore, the read value of the cnlipt register is undefined.
chapter 21 can controller user?s manual u19201ej3v0ud 1171 (15) cann module receive history list register (cnrgpt) the cnrgpt register is used to read the receive history list. (1/2) after reset: xx02h r/w address: c0rgpt 03fec060h, c1rgpt 03fec660h (a) read 15 14 13 12 11 10 9 8 cnrgpt rgpt7 rgpt6 rgpt5 rg pt4 rgpt3 rgpt2 rgpt1 rgpt0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 rhpm rovf (b) write 15 14 13 12 11 10 9 8 cnrgpt 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 clear rovf (a) read rgpt7 to rgpt0 receive history list read pointer 0 to 31 when the cnrgpt register is read, the contents of the element indexed by the receive history list get pointer (rgpt) of the receive history list are re ad. these contents indicate the number of the message buffer in which a data frame or a remote frame has been stored. rhpm note 1 receive history list pointer match 0 the receive history list has at least one message buffer number that has not been read. 1 the receive history list has no message buffer numbers that have not been read. rovf note 2 receive history list overflow bit 0 all the message buffer numbers that have not bee n read are preserved. all the numbers of the message buffers in which a new data frame or remo te frame has been received and stored are recorded to the receive history list (the receive history list has a vacant element). 1 at least 23 entries have been stored since the host processor serviced the rhl last time (i.e. read cnrgpt). the first 22 entries are sequentially stored whereas the last entry might have been overwritten by newly received messages a number of times because all buffer numbers are stored at position lipt-1 when the rovf bit is set to 1. as a consequence receptions cannot be completely recovered in the order that they were received. notes 1. the read value of the rgpt 0 to rgpt7 bits is invalid when the rhpm bit = 1. 2. if all the receive history is read by the cnrgpt register while the rovf bit is set (1), the rhpm bit is not cleared (0) but kept set (1 ) even if newly received data is stored.
chapter 21 can controller user?s manual u19201ej3v0ud 1172 (2/2) (b) write clear rovf setting of rovf bit 0 rovf bit is not changed. 1 rovf bit is cleared to 0. (16) cann module last out-p ointer register (cnlopt) the cnlopt register indicates the number of the message buffer to which a data frame or a remote frame was transmitted last. after reset: undefined r address: c0lopt 03fec062h, c1lopt 03fec662h 7 6 5 4 3 2 1 0 cnlopt lopt7 lopt6 lopt5 lo pt4 lopt3 lopt 2 lopt1 lopt0 lopt7 to lopt0 last out-pointer of transmit history list (lopt) 0 to 31 when the cnlopt register is read, the contents of the element indexed by the last out-pointer (lopt) of the receive history list are read. these contents indicate the number of the message buffer to which a data frame or a remote frame was transmitted last. remark the value read from the cnlopt register is undefined if a data fr ame or remote frame has never been transmitted from a message buffer. if the cntgpt.thpm bit is set to 1 after the can module has changed from the initialization mode to an operation mode, ther efore, the read value of the cnlopt register is undefined.
chapter 21 can controller user?s manual u19201ej3v0ud 1173 (17) cann module transmit history list register (cntgpt) the cntgpt register is used to read the transmit history list. (1/2) after reset: xx02h r/w address: c0tgpt 03fec064h, c1tgpt 03fec664h (a) read 15 14 13 12 11 10 9 8 cntgpt tgpt7 tgpt6 tgpt5 tg pt4 tgpt3 tgpt2 tgpt1 tgpt0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 thpm tovf (b) write 15 14 13 12 11 10 9 8 cntgpt 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 clear tovf (a) read tgpt7 to tgpt0 transmit history list read pointer 0 to 31 when the cntgpt register is read, the content s of the element indexed by the read pointer (tgpt) of the transmit history list are read. these contents indicate the number of the message buffer to which a data frame or a remote frame was transmitted last. thpm note 1 transmit history pointer match 0 the transmit history list has at least one message buffer number that has not been read. 1 the transmit history list has no message buffer numbers that have not been read. tovf note 2 transmit history list overflow bit 0 all the message buffer numbers that have not bee n read are preserved. all the numbers of the message buffers to which a new data frame or remote frame has been transmitted are recorded to the transmit history list (the transm it history list has a vacant element). 1 at least 7 entries have been stored since the host processor serviced the thl last time (i.e. read cntgpt). the first 6 entries are sequentially stored whereas the last entry might have been overwritten by newly transmitted messages a number of times because all buffer numbers are stored at position lopt-1 when tovf bit is se t to 1. as a consequence receptions cannot be completely recovered in the order that they were received. notes 1. the read value of the tgpt 0 to tgpt7 bits is invalid when the thpm bit = 1. 2. if all the transmit history is read by the cntgpt r egister while the tovf bit is set (1), the thpm bit is not cleared (0) but kept set (1), even if transmission of new data has been completed. remark transmission from message buffers 0 to 7 is not recorded to the transmit history list in the normal operation mode with abt.
chapter 21 can controller user?s manual u19201ej3v0ud 1174 (2/2) (b) write clear tovf setting of tovf bit 0 tovf bit is not changed. 1 tovf bit is cleared to 0. (18) cann module time stamp register (cnts) the cnts register is used to c ontrol the time stamp function. (1/2) after reset: 0000h r/w address: c0ts 03fec066h, c1ts 03fec666h (a) read 15 14 13 12 11 10 9 8 cnts 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 0 0 tslock tssel tsen (b) write 15 14 13 12 11 10 9 8 cnts 0 0 0 0 0 set tslock set tssel set tsen 7 6 5 4 3 2 1 0 0 0 0 0 0 clear tslock clear tssel clear tsen remark the lock function of the time stamp functions mu st not be used when the can module is in the normal operation mode with abt.
chapter 21 can controller user?s manual u19201ej3v0ud 1175 (2/2) (a) read tslock time stamp lock function enable bit 0 time stamp lock function stopped. the tsout signal toggles each time the selected time stamp capture event occurs. 1 time stamp lock function enabled. the tsout signal toggled each time the selected time stamp capture event occurred. however, the tsout output signal is locked when a data frame has been correctly received to message buffer 0 note . note the tsen bit is automatically cleared to 0. tssel time stamp capture event selection bit 0 the time stamp capture event is sof. 1 the time stamp capture event is the last bit of eof. tsen tsout operation setting bit 0 tsout toggle operation is disabled. 1 tsout toggle operation is enabled. remark the tsout signal is output from the can cont roller to a timer. for details, refer to chapter 7 16-bit timer/event counter p (tmp) . (b) write set tslock clear tslock setting of tslock bit 0 1 tslock bit is cleared to 0. 1 0 tslock bit is set to 1. other than above tslock bit is not changed. set tssel clear tssel setting of tssel bit 0 1 tssel bit is cleared to 0. 1 0 tssel bit is set to 1. other than above tssel bit is not changed. set tsen clear tsen setting of tsen bit 0 1 tsen bit is cleared to 0. 1 0 tsen bit is set to 1. other than above tsen bit is not changed .
chapter 21 can controller user?s manual u19201ej3v0ud 1176 (19) cann message data byte register (cnmdataxm, cnmdataym) (x = 0 to 7, y = 01, 23, 45, 67) the c0mdataxm register is used to store the data of a transmit/receive message, and can be accessed in 8-bit unit. the cnmdataxm register can be accessed in 16-bit units by the cnmdataym register. (1/2) after reset: undefined r/w address: see table 21-16 . 15 14 13 12 11 10 9 8 cnmdata01m mdata01 15 mdata01 14 mdata01 13 mdata01 12 mdata01 11 mdata01 10 mdata01 9 mdata01 8 7 6 5 4 3 2 1 0 mdata01 7 mdata01 6 mdata01 5 mdata01 4 mdata01 3 mdata01 2 mdata01 1 mdata01 0 7 6 5 4 3 2 1 0 cnmdata0m mdata0 7 mdata0 6 mdata0 5 mdata0 4 mdata0 3 mdata0 2 mdata0 1 mdata0 0 7 6 5 4 3 2 1 0 cnmdata1m mdata1 7 mdata1 6 mdata1 5 mdata1 4 mdata1 3 mdata1 2 mdata1 1 mdata1 0 15 14 13 12 11 10 9 8 cnmdata23m mdata23 15 mdata23 14 mdata23 13 mdata23 12 mdata23 11 mdata23 10 mdata23 9 mdata23 8 7 6 5 4 3 2 1 0 mdata23 7 mdata23 6 mdata23 5 mdata23 4 mdata23 3 mdata23 2 mdata23 1 mdata23 0 7 6 5 4 3 2 1 0 cnmdata2m mdata2 7 mdata2 6 mdata2 5 mdata2 4 mdata2 3 mdata2 2 mdata2 1 mdata2 0 7 6 5 4 3 2 1 0 cnmdata3m mdata3 7 mdata3 6 mdata3 5 mdata3 4 mdata3 3 mdata3 2 mdata3 1 mdata3 0
chapter 21 can controller user?s manual u19201ej3v0ud 1177 (2/2) 15 14 13 12 11 10 9 8 cnmdata45m mdata45 15 mdata45 14 mdata45 13 mdata45 12 mdata45 11 mdata45 10 mdata45 9 mdata45 8 7 6 5 4 3 2 1 0 mdata45 7 mdata45 6 mdata45 5 mdata45 4 mdata45 3 mdata45 2 mdata45 1 mdata45 0 7 6 5 4 3 2 1 0 cnmdata4m mdata4 7 mdata4 6 mdata4 5 mdata4 4 mdata4 3 mdata4 2 mdata4 1 mdata4 0 7 6 5 4 3 2 1 0 cnmdata5m mdata5 7 mdata5 6 mdata5 5 mdata5 4 mdata5 3 mdata5 2 mdata5 1 mdata5 0 15 14 13 12 11 10 9 8 cnmdata67m mdata67 15 mdata67 14 mdata67 13 mdata67 12 mdata67 11 mdata67 10 mdata67 9 mdata67 8 7 6 5 4 3 2 1 0 mdata67 7 mdata67 6 mdata67 5 mdata67 4 mdata67 3 mdata67 2 mdata67 1 mdata67 0 7 6 5 4 3 2 1 0 cnmdata6m mdata6 7 mdata6 6 mdata6 5 mdata6 4 mdata6 3 mdata6 2 mdata6 1 mdata6 0 7 6 5 4 3 2 1 0 cnmdata7m mdata7 7 mdata7 6 mdata7 5 mdata7 4 mdata7 3 mdata7 2 mdata7 1 mdata7 0
chapter 21 can controller user?s manual u19201ej3v0ud 1178 (20) cann message data length register m (cnmdlcm) the cnmdlcm register is used to set the number of bytes of the data field of a message buffer. after reset: 0000xxxxb r/w address: see table 21-16 . 7 6 5 4 3 2 1 0 cnmdlcm 0 0 0 0 mdlc3 mdlc2 mdlc1 mdlc0 mdlc3 mdlc2 mdlc1 mdlc0 data length of transmit/receive message 0 0 0 0 0 bytes 0 0 0 1 1 byte 0 0 1 0 2 bytes 0 0 1 1 3 bytes 0 1 0 0 4 bytes 0 1 0 1 5 bytes 0 1 1 0 6 bytes 0 1 1 1 7 bytes 1 0 0 0 8 bytes 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 setting prohibited (if these bits are set during transmi ssion, 8-byte data is transmitted regardless of the set dlc value when a data frame is transmitted. however, the dlc actually transmitted to the can bus is the dlc value set to this register.) note note the data and dlc value actually transmitted to can bus are as follows. type of transmit frame length of transmit data dlc transmitted data frame number of bytes specified by dlc (however, 8 bytes if dlc 8) remote frame 0 bytes mdlc3 to mdlc0 bits cautions 1. receive data is stored in as ma ny cnmdataxm register as the number of bytes (however, the upper limit is 8) correspondi ng to dlc of receive frame. the cnmdataxm register in which no data is stored is undefined. 2. be sure to set bits 4 to 7 to ?0?.
chapter 21 can controller user?s manual u19201ej3v0ud 1179 (21) cann message configuration register m (cnmconfm) the cnmconfm register is used to specify t he type of the message buffer and to set a mask. (1/2) after reset: undefined r/w address: see table 21-16 . 7 6 5 4 3 2 1 0 cnmconfm ows rtr mt2 mt1 mt0 0 0 ma0 ows overwrite control bit 0 the message buffer note that has already received a data frame is not overwritten by a newly received data frame. the newly received data frame is discarded. 1 the message buffer that has already received a data frame is overwritten by a newly received data frame. note the ?message buffer that has already received a data frame? is a receive message buffer whose the cnmctrlm.dn bit has been set to 1. remark a remote frame is received and stored, regardl ess of the setting of the ows and dn bits. a remote frame that satisfies the other c onditions (id matches, the rtr bit = 0, the cnmctrlm.trq bit = 0) is always received and stored in the corresponding message buffer (interrupt generated, dn flag set, the cnmd lcm.mdlc0 to cnmdlcm.mdlc3 bits updated, and recorded to the receive history list). rtr remote frame request bit note 0 transmit a data frame. 1 transmit a remote frame. note the rtr bit specifies the type of message frame that is transmitted from a message buffer defined as a transmit message buffer. even if a valid re mote frame has been received, the rtr bit of the transmit message buffer that has received the frame remains cleared to 0. even if a remote frame whose id matches has been received from the ca n bus with the rtr bit of the transmit message buffer set to 1 to transmit a remote frame, that remote frame is not received or stored (interrupt generated, dn flag set, the mdlc0 to mdlc3 bits upd ated, and recorded to the receive history list). mt2 mt1 mt0 message buffer type setting bit 0 0 0 transmit message buffer 0 0 1 receive message buffer (no mask setting) 0 1 0 receive message buffer (mask 1 set) 0 1 1 receive message buffer (mask 2 set) 1 0 0 receive message buffer (mask 3 set) 1 0 1 receive message buffer (mask 4 set) other than above setting prohibited
chapter 21 can controller user?s manual u19201ej3v0ud 1180 (2/2) ma0 message buffer assignment bit 0 message buffer not used. 1 message buffer used. caution be sure to set bits 2 and 1 to ?0?. (22) cann message id register m (cnmidlm, cnmidhm) the cnmidlm and cnmidhm registers ar e used to set an identifier (id). after reset: undefined r/w address: see table 21-16 . 15 14 13 12 11 10 9 8 cnmidlm id15 id14 id13 id12 id11 id10 id9 id8 7 6 5 4 3 2 1 0 id7 id6 id5 id4 id3 id2 id1 id0 15 14 13 12 11 10 9 8 cnmidhm ide 0 0 id28 id27 id26 id25 id24 7 6 5 4 3 2 1 0 id23 id22 id21 id20 id19 id18 id17 id16 ide format mode specification bit 0 standard format mode (id28 to id18: 11 bits) note 1 extended format mode (id28 to id0: 29 bits) note the id17 to id0 bits are not used. id28 to id0 message id id28 to id18 standard id value of 11 bits (when ide = 0) id28 to id0 extended id value of 29 bits (when ide = 1) cautions 1. be sure to write 0 to bits 14 and 13 of the cnmidhm register. 2. be sure to arrange the id values to be registered in accordance with the bit positions of this register. for the standard id, shif t the bit positions of id28 to id18 of the id value.
chapter 21 can controller user?s manual u19201ej3v0ud 1181 (23) cann message control register m (cnmctrlm) the cnmctrlm register is used to cont rol the operation of the message buffer. (1/3) after reset: 00x000000 000xx000b r/w address: see table 21-16 . (a) read 15 14 13 12 11 10 9 8 cnmctrlm 0 0 muc 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 mow ie dn trq rdy (b) write 15 14 13 12 11 10 9 8 cnmctrlm 0 0 0 0 set ie 0 set trq set rdy 7 6 5 4 3 2 1 0 0 0 0 clear mow clear ie clear dn clear trq clear rdy (a) read muc note bit indicating that message buffer data is being updated 0 the can module is not updating the me ssage buffer (reception and storage). 1 the can module is updating the message buffer (reception and storage). note the muc bit is undefined until the firs t reception and storage is performed. mow message buffer overwrite status bit 0 the message buffer is not overwritt en by a newly received data frame. 1 the message buffer is overwritten by a newly received data frame. remark the mow bit is not set to 1 even if a remote frame is received and stored in the transmit message buffer with the dn bit = 1. ie message buffer interrupt request enable bit 0 receive message buffer: valid message re ception completion interrupt disabled. transmit message buffer: normal message tr ansmission completion interrupt disabled. 1 receive message buffer: valid message reception completion interrupt enabled. transmit message buffer: normal message transmission completion interrupt enabled. dn message buffer data update bit 0 a data frame or remote frame is not stored in the message buffer. 1 a data frame or remote frame is stored in the message buffer.
chapter 21 can controller user?s manual u19201ej3v0ud 1182 (2/3) trq message buffer transmission request bit 0 no message frame transmitting request that is pe nding or being transmitted is in the message buffer. 1 the message buffer is holding transmission of a me ssage frame pending or is transmitting a message frame. caution do not set the trq bit and rdy bit to 1 at the same time. be sure to set the rdy bit to 1 before setting the trq bit to 1. rdy message buffer ready bit 0 the message buffer can be written by software. the can module cannot write to the message buffer. 1 writing the message buffer by software is ignored (e xcept a write access to the rdy, trq, dn, and mow bits). the can module can write to the message buffer. cautions 1. do not clear the rdy bit (0) durin g message transmission. follow transmission abort procedures in order to clear the rdy bit for redefinition. 2. if the rdy bit is not cleared (0) even when the processing to clear it is executed, execute the clearing processing again. 3. confirm, by reading the rdy bit again, that the rdy bi t has been cleared (0) before writing data to the message buffer. however, it is unnecessary to confirm that th e trq or rdy bit has been set (1) or that the dn or mow bit has been cleared (0). (b) write clear mow setting of mow bit 0 mow bit is not changed. 1 mow bit is cleared to 0. set ie clear ie setting of ie bit 0 1 ie bit is cleared to 0. 1 0 ie bit is set to 1. other than above ie bit is not changed. caution be sure to set the ie and rdy bits separately. clear dn setting of dn bit 1 dn bit is cleared to 0. 0 dn bit is not changed. cautions 1. do not set the dn bit to 1 by software. be sure to write 0 to bit 10. 2. if the dn bit is cleared to 0 before the arbitration field that is being received ends, the message buffer in which the data frame is being stored becomes a target destination for storing another received data frame.
chapter 21 can controller user?s manual u19201ej3v0ud 1183 (3/3) set trq clear trq setting of trq bit 0 1 trq bit is cleared to 0. 1 0 trq bit is set to 1. other than above trq bit is not changed. caution even if the trq bit is set (1), transmission may not be immediately executed depending on the situation such as when a message is received from another node or when a message is transmitted from the message buffer. transmission under execution is not terminated midway even if the tr q bit is cleared. transmission is continued until it is completed (regardl ess of whether it is executed successfully or fails). set rdy clear rdy setting of rdy bit 0 1 rdy bit is cleared to 0. 1 0 rdy bit is set to 1. other than above rdy bit is not changed. caution be sure to set the trq and rdy bits separately.
chapter 21 can controller user?s manual u19201ej3v0ud 1184 21.7 bit set/clear function the can control registers include registers whose bits can be set or cleared via the cpu and via the can interface. an operation error occurs if the following registers are written directly. do not write any values directly via bit manipulation, read/modify/write, or direct writing of target values. ? cann global control register (cngmctrl) ? cann global automatic block transmission control register (cngmabt) ? cann module control register (cnctrl) ? cann module interrupt enable register (cnie) ? cann module interrupt status register (cnints) ? cann module receive history list register (cnrgpt) ? cann module transmit history list register (cntgpt) ? cann module time stamp register (cnts) ? cann message control register (cnmctrlm) remark n = 0, 1 m = 00 to 31 all the 16 bits in the above registers can be read via t he usual method. use the procedure described in figure 21- 25 below to set or clear the lower 8 bits in these registers. setting or clearing of lower 8 bits in the above registers is performed in combination with the higher 8 bits (refer to the bit status after set/clear operation is specified in figure 21-26). figure 21-25 shows how the values of set bits or clear bits relate to set/clear/no change operations in the corresponding register. figure 21-25. example of bi t setting/clearing operations 0000000011010001 0000101111011000 set00001011 0000000000000011 clear 11011000 set no change clear bit status register?s current value write value register?s value after write operation clear clear no change no change set
chapter 21 can controller user?s manual u19201ej3v0ud 1185 figure 21-26. bit status after bit setting/clearing operations 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 set 7 set 6 set 5 set 4 set 3 set 2 set 1 set 0 clear 7 c lear 6 clear 5 clear 4 clear 3 clear 2 clear 1 clear 0 set n clear n status of bit n after bit set/clear operation 0 0 no change 0 1 0 1 0 1 1 1 no change remark n = 0 to 7
chapter 21 can controller user?s manual u19201ej3v0ud 1186 21.8 can controller initialization 21.8.1 initialization of can module before can module operation is enabled, the can modu le system clock needs to be determined by setting the cngmcs.ccp0 to cngmcs.ccp3 bits by software. do not change the setting of the can module system clock after can module operation is enabled. the can module is enabled by setting the cngmctrl.gom bit. for the procedure of initia lizing the can module, see 21.16 operation of can controller. remark n = 0, 1 21.8.2 initialization of message buffer after the can module is enabled, the message buffers cont ain undefined values. a minimum initialization for all the message buffers, even for those not used in the applicat ion, is necessary before switching the can module from the initialization mode to on e of the operation modes. ? clear the cnmctrlm.rdy, cnmctrlm.trq, and cnmctrlm.dn bits to 0. ? clear the cnmconfm.ma0 bit to 0. remark n = 0, 1 m = 00 to 31 21.8.3 redefinition of message buffer redefining a message buffer means changing the id and control information of the message buffer while a message is being received or transmitted, without a ffecting other transmissi on/reception operations. (1) to redefine message buffe r in initialization mode place the can module in the initialization mode once and then change the id and cont rol information of the message buffer in the initialization mode. after c hanging the id and control information, set the can module to an operation mode. (2) to redefine message buffer during reception perform redefinition as shown in figure 21-39. (3) to redefine message buffer during transmission to rewrite the contents of a transmit message buffer to which a transmission request has been set, perform transmission abort processing (see 21.10.4 (1) transmission abort process other than in normal operation mode with automatic block transmission (abt), 21.10.4 (2) tran smission abort process except for abt transmission in normal operation mode with automatic block transmission (abt)) . confirm that transmission has been aborted or comple ted, and then redefine the message buffer. after redefining the transmit message buffer, set a transmissi on request using the procedure described below. when setting a transmission request to a message buffer that has been redef ined without aborting the transmission in progress, however, the 1-bit wait time is not necessary.
chapter 21 can controller user?s manual u19201ej3v0ud 1187 figure 21-27. setting transmission request (trq) to transmit message buffer after redefinition execute transmission? wait for 1 bit of can data. set trq bit set trq bit = 1 clear trq bit = 0 yes no redefinition completed end cautions 1. when a message is received, reception fi ltering is performed in accordance with the id and mask set to each receive messag e buffer. if the procedure in figure 21-39 is not observed, the contents of the message buffer after it has been redefined may cont radict the result of reception (result of reception filtering). if th is happens, check that the id and ide received first and stored in the message buffer followin g redefinition are those stored after the message buffer has been redefined. if no id and ide are stored after redefinition, redefine the message buffer again. 2. when a message is transm itted, the transmission priority is checked in accordance with the id, ide, and rtr bits set to each transmit message buffer to which a transmission request was set. the transmit mes sage buffer having the highest priority is selected for transmission. if the procedure in figure 21-27 is not observed, a message with an id not having the highest priority may be transmitted afte r redefinition. 21.8.4 transition from initializat ion mode to operation mode the can module can be switched to the following operation modes. ? normal operation mode ? normal operation mode with abt ? receive-only mode ? single-shot mode ? self-test mode
chapter 21 can controller user?s manual u19201ej3v0ud 1188 figure 21-28. transiti on to operation modes can module channel invalid [receive-only mode] opmode[2:0]=03h opmode[2:0] = 00h and can bus is busy. opmode[2:0] = 03h [single-shot mode] opmode[2:0]=04h opmode[2:0] = 04h opmode[2:0] = 05h init mode opmode[2:0] = 00h efsd = 1 and gom = 0 all can modules are in init mode and gom = 0 gom = 1 reset reset released [normal operation mode with abt] opmode[2:0]=02h opmode[2:0] = 00h and can bus is busy. opmode[2:0] = 00h and interframe space opmode[2:0] = 02h opmode[2:0] = 01h opmode[2:0] = 00h and can bus is busy. [normal operation mode] opmode[2:0]=01h opmode[2:0] = 00h and can bus is busy. opmode[2:0] = 00h and interframe space opmode[2:0] = 00h and interframe space opmode[2:0] = 00h and interframe space opmode[2:0] = 00h and interframe space opmode[2:0] = 00h and can bus is busy. [self-test mode] opmode[2:0]=05h the transition from the in itialization mode to an operation mode is controlled by the cnctrl.opmode2 to cnctrl.opmode0 bits. changing from one operation mode into another requires sh ifting to the initialization mode in between. do not change one operation mode to another directly; otherwise the operation will not be guaranteed. requests for transition from an operation mode to the in itialization mode are held pending when the can bus is not in the interframe space (i.e., frame reception or tr ansmission is in progress), and the can module enters the initialization mode at the first bit in the interframe space (the values of the opmode2 to opmode0 bits are changed to 000b). after issuing a request to change the mode to the initialization mode, read the opmode2 to opmode0 bits until their values become 000b to confirm that the module has entered the initialization mode (see figure 21-37 ). remark n = 0, 1 21.8.5 resetting error counter cnerc of can module if it is necessary to reset the cnerc and cninfo register s when re-initialization or forced recovery from the bus- off status is made, set the cnctrl.ccerc bit to 1 in the initialization mode. when this bit is set to 1, the cnerc and cninfo registers are cleared to their default values. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1189 21.9 message reception 21.9.1 message reception all buffers satisfying the following conditions are searched in all the message buffer areas in all the operation modes in order to store newly receive messages. ? used as a message buffer (cnmconfm.ma0 bit is set to 1.) ? set as a receive message buffer (cnmconfm.mt2 to cnmconfm.mt0 bits ar e set to 001b, 010b, 011b, 100b, or 101b.) ? ready for reception (cnmctrlm.rdy bit is set to 1.) remark n = 0, 1 m = 00 to 31 when two or more message buffers of the can module receive a message, the message is stored according to the priority explained below. the message is always stored in the message buffer with the highest priority, not in a message buffer with a low priority. for example, when an unmasked receive message buffer and a receive message buffer linked to mask 1 have the same id, the received message is not stored in the message buffer linked to mask 1 that has not received a message, even if a message has already been received in the unmasked receive message buffer. in other words, when a condition has been set to store a message in two or more message buffers with different priorities, the message buffer with the highest prio rity always stores the message; the message is not stored in message buffers with a lower priority. this also applies when the message buffer with the highest priority is unable to receive and store a message (i.e., when the dn bit = 1 i ndicating that a message has already been received, but rewriting is disabled because the ows bit = 0). in this case, the message is not actually received and stored in the candidate message buffer with the highest priority, but neither is it stored in a message buffer with a lower priority. priority storing condition if same id is set dn bit = 0 1 (high) unmasked message buffer dn bit = 1 and ows bit = 1 dn bit = 0 2 message buffer linked to mask 1 dn bit = 1 and ows bit = 1 dn bit = 0 3 message buffer linked to mask 2 dn bit = 1 and ows bit = 1 dn bit = 0 4 message buffer linked to mask 3 dn bit = 1 and ows bit = 1 dn bit = 0 5 (low) message buffer linked to mask 4 dn bit = 1 and ows bit = 1
chapter 21 can controller user?s manual u19201ej3v0ud 1190 21.9.2 reading reception data if it is necessary to consistently read data from t he can message buffer by software, follow the recommended procedures shown in figures 21-49 and 21-50. while receiving a message, the can module sets the cn mctrlm.dn bit two times, at the beginning of the processing to store data in the message buffer and at the end of this storing processi ng. during this storing processing, the cnmctrlm.muc bit of t he message buffer is set (1) (refer to figure 21-29 ). before the data is completely stored, the receive history list is written. du ring this data storing period (muc bit = 1), the cpu is prohibited from rewriting the cnmctrlm.rdy bit of the message buffe r in which the data is to be stored. completion of this data storing processing may be delayed by a cpu?s access to any message buffer. remark n = 0, 1 m = 0 to 31 figure 21-29. dn and muc bit setting period (in standard id format) sof (1) id ide rtr r0 dlc data0-data7 crc ack eof can standard id format (11) (1) (1) (1) (4) (0-64) (16) (2) recessive dominant dn bit muc bit message stored data, dlc, id message buffer (7) the dn bit is set (1) and the muc bit is cleared (0) at the same time. cnints.cints1 bit the dn and muc bits are set (1) at the same time. ifs intcnrec signal operation of can controller
chapter 21 can controller user?s manual u19201ej3v0ud 1191 21.9.3 receive history list function the receive history list (rhl) function records in the re ceive history list the number of the receive message buffer in which each data frame or remote frame was received and stored. the rhl consists of storage elements equivalent to up to 23 messages, the last in-message pointer (lipt) with the corresponding cnlipt register and the receive history list get pointer (rgpt) with t he corresponding cnrgpt register. the rhl is undefined immediately after the transition of the can module from the initialization mode to one of the operation modes. the cnlipt register holds the contents of the rhl element i ndicated by the value of the lipt pointer minus 1. by reading the cnlipt register, therefore, the number of t he message buffer that received and stored a data frame or remote frame first can be checked. the lipt pointer is utilized as a write pointer that indicates to what part of the rhl a message buffer number is recorded. any time a dat a frame or remote frame is received and stored, the corresponding message buffer number is recorded to the rhl element indicated by the lipt pointer. each time recording to the rhl has been completed, the lipt pointer is automatically incremented. in this way, the number of the message buffer that has received and stored a frame will be recorded chronologically. the rgpt pointer is utilized as a read pointer that reads a recorded message buffer number from the rhl. this pointer indicates the first rhl element that the cpu has not read yet. by readi ng the cnrgpt register by software, the number of a message buffer that has re ceived and stored a data frame or remote frame can be read. each time a message buffer number is read from the cnrgpt regist er, the rgpt pointer is automatically incremented. if the value of the rgpt pointer matc hes the value of the lipt pointer, t he cnrgpt.rhpm bit (receive history list pointer match) is set to 1. this indicates that no me ssage buffer number that has not been read remains in the rhl. if a new message buffer number is recorded, the lipt poi nter is incremented and because its value no longer matches the value of the rgpt pointer, the rhpm bit is cleared. in other words, the numbers of the unread message buffers exist in the rhl. if the lipt pointer is incremented and matches the value of the rgpt poi nter minus 1, the cnrgpt.rovf bit (receive history list overflow) is set to 1. this indicates th at the rhl is full of numbers of message buffers that have not been read. when further message reception and stori ng occur, the last recorded message buffer number is overwritten by the number of the messa ge buffer that received and stored the new message. after the rovf bit has been set to 1, the recorded message buffer numbers in the rhl do not completely reflect chronological order. however the messages themselves are not lost and can be located by a cpu search in the message buffer memory with the help of the dn bit. caution even if the receive history list overflows (cnrgp t.rovf bit = 1), the rece ive history can be read until no more history is left unread and the cnrgpt.rhpm bit is set (1). however, the rovf bit is kept set (1) (= overflow occurs) until cleared (0) by software. in this status, the rhpm bit is not cleared (0), unless th e rovf bit is cleared (0), even if a ne w receive history is stored and written to the list. if rovf bit = 1 a nd rhpm bit = 1 and the receive histor y list overflows, therefore, the rhpm bit indicates that no more hi story is left unread even if new history is received and stored. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1192 as long as the rhl contains 23 or less entries the sequence of occurrence is ma intained. if more receptions occur without the rhl being read by the host processor, a comp lete sequence of receptions can not be recovered. figure 21-30. receive history list last in- massage pointer (lipt) receive history list get pointer (rgpt) - message buffer 6, 9, 2, and 7 are read by host processor. - newly received messages are stored in message buffer 3, 4, and 8. event: receive history list get pointer (rgpt) last in- massage pointer (lipt) - 20 other massages are received. message buffer 6 carries last received message. - upon reception in message buffer 6, rhl is full. - rovf bit is set to 1. event: last in- massage pointer (lipt) last in- massage pointer (lipt) receive history list get pointer (rgpt) receive history list get pointer (rgpt) receive history list (rhl) message buffer 6 message buffer 9 message buffer 2 message buffer 7 0 1 2 3 4 5 6 7 22 23 : : : receive history list (rhl) message buffer 3 message buffer 4 message buffer 8 0 1 2 3 4 5 6 7 22 23 : : : receive history list (rhl) message buffer 10 message buffer 11 message buffer 6 message buffer 3 message buffer 4 message buffer 8 message buffer 5 message buffer 9 message buffer 1 0 1 2 3 4 5 6 7 22 23 : : : - reception in message buffer 13, 14, and 15 occurs. - overflow situation occurs. event: receive history list (rhl) message buffer 10 message buffer 11 message buffer 15 message buffer 3 message buffer 4 message buffer 8 message buffer 5 message buffer 9 message buffer 1 0 1 2 3 4 5 6 7 22 23 : : : rovf bit = 1 lipt is blocked rovf bit = 1 lipt is blocked rovf bit = 1 denotes that lipt equals rgpt ? 1 while message buffer number stored to element indicated by lipt ? 1.
chapter 21 can controller user?s manual u19201ej3v0ud 1193 21.9.4 mask function for some message buffers that are used for reception, wh ether one of four global reception masks is applied can be selected. load resulting from comparing message identifiers is re duced by masking some bits, and, as a result, some different identifiers can be received in a buffer. by using the mask function, the identifier of a messa ge received from the can bus can be compared with the identifier set to a message buffer in advance. regardless of whether the masked id is set to 0 or 1, the received message can be stored in the defined message buffer. while the mask function is in effect, an identifier bit that is defined to be 1 by a mask in the received message is not compared with the corresponding ident ifier bit in the message buffer. however, this comparison is performed for any bi t whose value is defined as 0 by the mask. for example, let us assume that all messages that have a standard-format id, in which bits id27 to id25 are 0 and bits id24 and id22 are 1, are to be stored in message bu ffer 14. the procedure for this example is shown below. <1> identifier to be stored in message buffer id28 id27 id26 id25 id24 id23 id22 id21 id20 id19 id18 x 0 0 0 1 x 1 x x x x remark x = don?t care <2> identifier to be configured in message buffer 14 (example) (using c0midl14 and c0midh14 registers) id28 id27 id26 id25 id24 id23 id22 id21 id20 id19 id18 x 0 0 0 1 x 1 x x x x id17 id16 id15 id14 id13 id12 id11 id10 id9 id8 id7 x x x x x x x x x x x id6 id5 id4 id3 id2 id1 id0 x x x x x x x id with the id27 to id25 bits cleared to 0 and the id24 and id22 bits set to 1 is registered (initialized) to message buffer 14. remark x = don?t care remarks 1. message buffer 14 is set as a standard format iden tifier that is linked to mask 1 (cnmconf14.mt2 to cnmconf14.mt0 bits are set to 010b). 2. n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1194 <3> mask setting for can module 1 (mask 1) (example) (using can1 address mask 1 registers l and h (c1mask1l and c1mask1h)) cmid28 cmid27 cmid26 cmid25 cmid24 cmid23 cmid22 cmid21 cmid20 cmid19 cmid18 1 0 0 0 0 1 0 1 1 1 1 cmid17 cmid16 cmid15 cmid14 cmid13 cmid12 cmid11 cmid10 cmid9 cmid8 cmid7 1 1 1 1 1 1 1 1 1 1 1 cmid6 cmid5 cmid4 cmid3 cmid2 cmid1 cmid0 1 1 1 1 1 1 1 1: not compared (masked) 0: compared the cmid27 to cmid24 and cmid22 bits are clear ed to 0, and the cmid28, cmid23, and cmid21 to cmid0 bits are set to 1.
chapter 21 can controller user?s manual u19201ej3v0ud 1195 21.9.5 multi buffer receive block function the multi buffer receive block (mbrb) function is used to store a block of data in two or more message buffers sequentially with no cpu interaction, by setting the same id to two or more message buffers with the same message buffer type. these message buffers can be allocated in any area in the message buffer memory, and they are not necessarily to be allocated adjacent to each other. suppose, for example, the same message buffer type is set to 10 message buffers, message buffers 10 to 19, and the same id is set to each message bu ffer. if the first message whose id ma tches an id of the message buffers is received, it is stored in message buffer 10. at this point, the dn bit of message buffer 10 is set, prohibiting overwriting the message buffer. when the next message with a matching id is received, it is received and stored in message buffer 11. each time a message with a matching id is received, it is sequentially (in the ascending order) stored in message buffers 12, 13, and so on. even when a data block consisting of multiple messages is received, the messages can be stored and received without overwriting the prev iously received matching-id data. whether a data block has been received and stored can be checked by setting the cnmctrlm.ie bit of each message buffer. for example, if a dat a block consists of k messages, k message buffers are initialized for reception of the data block. the ie bit in mess age buffers 0 to (k-2) is cleared to 0 (interrupts disabled), and the ie bit in message buffer k-1 is set to 1 (interrupts enabled). in this case, a reception completion interrupt occurs when a message has been received and stored in message buffer k-1, indicating that mbrb has become full. alternatively, by clearing the ie bit of message buffers 0 to (k-3) and setti ng the ie bit of message buffer k-2, a warning that mbrb is about to overflow can be issued. the basic conditions of storing rece ive data in each message buffer for the mbrb are the same as the conditions of storing data in a single message buffer. cautions 1. mbrb can be configured for each of the same message buffer types. therefore, even if a message buffer of another mbrb whose id ma tches but whose message buffer type is different has a vacancy, the rece ived message is not stored in that message buffer, but instead discarded. 2. mbrb does not have a ring buffe r structure. therefore, after a message is stored in the message buffer having the highest number in the mbrb configuration, a newly received message will no longer be stored in the message buffer in the order from the lowest message buffer number. 3. mbrb operates based on the reception an d storage conditions; there are no settings dedicated to mbrb, such as func tion enable bits. by setti ng the same message buffer type and id to two or more message buffe rs, mbrb is automati cally configured. 4. with mbrb, ?matching id? means ?matching id after mask?. even if the id set to each message buffer is not the same, if the id that is masked by the mask register matches, it is considered a matching id and the buffer that has this id is treat ed as the stor age destination of a message. 5. priority among each mbrb conforms to the priority shown in 21.9. 1 message reception. remark n = 0, 1 m = 00 to 31
chapter 21 can controller user?s manual u19201ej3v0ud 1196 21.9.6 remote frame reception in all the operation modes, when a remote frame is receiv ed, the message buffer that is to store the remote frame is searched from all the message buffers satisfying the following conditions. ? used as a message buffer (cnmconfm.ma0 bit set to 1.) ? set as a transmit message buffer (cnmconfm.mt2 to cnmconfm.mt0 bits set to 000b) ? ready for reception (cnmctrlm.rdy bit set to 1.) ? set to transmit message (cnmconfm.rtr bit is cleared to 0.) ? transmission request is not set. (cnmctrlm.trq bit is set to 0.) upon acceptance of a remote frame, the following actions are executed if the id of the received remote frame matches the id of a message buffer that satisfies the above conditions. ? the cnmdlcm.dlc3 to cnmdlcm.dlc0 bits store the received dlc value. ? the cnmdata0m to cnmdata7m registers in the data ar ea are not updated (data before reception is saved). ? the cnmctrlm.dn bit is set to 1. ? the cnints.cints1 bit is set to 1 (if the cnmctrlm.ie bit of the message buffer that receives and stores the frame is set to 1). ? the receive completion interrupt (intcnrec) is output (if the ie bit of the message buffer that receives and stores the frame is set to 1 and if the cnie.cie1 bit is set to 1). ? the message buffer number is recorded in the receive history list. caution when a message buffer is searched for receivi ng and storing a remote frame, overwrite control by the cnmconfm.ows bit of the message buffer and the dn bit are not affected. the setting of the ows bit is ignored and the dn bit is set to 1 in every case. if more than one transmit me ssage buffer has the same id and the id of the received remote frame matches that id, the remote frame is stor ed in the transmit messag e buffer with the lowest message buffer number. remark n = 0, 1 m = 00 to 31
chapter 21 can controller user?s manual u19201ej3v0ud 1197 21.10 message transmission 21.10.1 message transmission in all the operation modes, if the cnmc trlm.trq bit is set to 1 in a messa ge buffer that sati sfies the following conditions, the message buffer that is to transmit a message is searched. ? used as a message buffer (cnmconfm.ma0 bit set to 1.) ? set as a transmit message buffer (cnmconfm.mt2 to cnmconfm.mt0 bits set to 000b.) ? ready for transmission (cnmctrlm.rdy bit is set to 1.) remark n = 0, 1 m = 00 to 31 the can system is a multi-master communication system. in a system like this, the priority of message transmission is determined based on message identifiers (ids). to facilitate transmission processing by software when there are several messages awaiting transmission, t he can module uses hardware to check the id of the message with the highest priority and automatically identifies that message. this eliminates the need for software- based priority control. transmission priority is controlled by the identifier (id). figure 21-31. message processing example message no. the can module transmits messages in the following sequence. message waiting to be transmitted id = 120h id = 229h id = 223h id = 023h id = 123h 0 1 2 3 4 5 6 7 8 9 1. message 6 2. message 1 3. message 8 4. message 5 5. message 2
chapter 21 can controller user?s manual u19201ej3v0ud 1198 after the transmit message search, the transmit message with the highest priority of the transmit message buffers that have a pending transmission request (message buffers with the trq bit set to 1 in advance) is transmitted. if a new transmission request is set, the transmit message buffer with the new transmission request is compared with the transmit message buffer with a pending transmission request. if the new transmission request has a higher priority, it is transmitted, unless transmission of a message wit h a low priority has already started. to solve this reversal of priorities, software can request that transmi ssion of a message of low prio rity be stopped. the highest priority is determined according to the following rules. priority conditions description 1 (high) value of first 11 bits of id [id28 to id18]: the message frame with the lowest value represented by the first 11 bits of the id is transmitted first. if the value of an 11- bit standard id is equal to or smaller than the first 11 bits of a 29-bit extended id, the 11-bit standard id has a higher priority than a message frame with a 29-bit extended id. 2 frame type a data frame with an 11-bit standard id (cnmconfm.rtr bit is cleared to 0) has a higher priority than a remote frame with a standard id and a message frame with an extended id. 3 id type a message frame with a standard id (cnmi dhm.ide bit is cleared to 0) has a higher priority than a message frame with an extended id. 4 value of lower 18 bits of id [id17 to id0]: if one or more transmission-pending ex tended id message frame has equal values in the first 11 bits of the id and the same frame type (equal rtr bit values), the message frame with the lowest value in the lower 18 bits of its extended id is transmitted first. 5 (low) message buffer number if two or more message buffers request tr ansmission of message frames with the same id, the message from the message buffer with the lowest message buffer number is transmitted first. remarks 1. if the automatic block transmission request bit cngmabt.abttrg bit is set to 1 in the normal operation mode with abt, the trq bit is set to 1 only for one message buffer in the abt message buffer group. if the abt mode was triggered by the abttrg bit (1), one trq bit is set to 1 in the abt area (buffers 0 to 7). in addition to this trq bit, the application can request transmissions (set trq bit to 1) for other tx-message buffers that do not belong to the abt area. in that case an internal arbitration process (tx-search) evaluates all of the tx-message buffers with the trq bit set to 1 and chooses the message buffer that contains t he highest prioritized identifier for the next transmission. if there are 2 or more identifiers that hav e the highest priority (i.e. identical identifiers), the message located at the lowest message buffer number is transmitted first. upon successful transmission of a message fr ame, the following operations are performed. - the trq bit of the corresponding transmit me ssage buffer is automatically cleared to 0. - the transmission completion status bit cints0 of t he cnints register is set to 1 (if the interrupt enable bit (ie) of the corresponding transmit message buffer is set to 1). - an interrupt request signal intcntrx is output (i f the cnie.cie0 bit is set to 1 and if the interrupt enable bit (ie) of the corresponding transmit message buffer is set to 1). 2. before changing the contents of the transmit me ssage buffer, the rdy flag of this buffer must be cleared. since the rdy flag may be temporarily lock ed while the internal processing is changed, it is necessary to check the status of the rdy fl ag by software after changing the buffer contents. 3. n = 0, 1 m = 00 to 31
chapter 21 can controller user?s manual u19201ej3v0ud 1199 21.10.2 transmit history list function the transmit history list (thl) function records in the tr ansmit history list the number of the transmit message buffer in which each data frame or remote frame was received an d stored. the thl consists of storage elements equivalent to up to seven messages, the last out-message pointer (l opt) with the corresponding cnlopt register, and the transmit history list get pointer (tgpt) with the corresponding cntgpt register. the thl is undefined immediately after t he transition of the can module from t he initialization mode to one of the operation modes. the cnlopt register holds t he contents of the thl element indicated by the value of the lopt pointer minus 1. by reading the cnlopt register, theref ore, the number of the message buffer t hat transmitted a data frame or remote frame first can be checked. the lopt poi nter is utilized as a write pointer that indicates to what part of the thl a message buffer number is reco rded. any time a data frame or remote frame is transmitted, the corresponding message buffer number is recorded to the thl element indica ted by the lopt pointer. each time recording to the thl has been completed, the lopt pointer is automatically incremented. in this way, the number of the message buffer that has received and stored a frame will be recorded chronologically. the tgpt pointer is utilized as a read pointer that reads a recorded message buffer number from the thl. this pointer indicates the first thl element that the cpu has not yet read. by reading the cn tgpt register by software, the number of a message buffer that has completed transmissi on can be read. each time a message buffer number is read from the cntgpt register, the tg pt pointer is automatically incremented. if the value of the tgpt pointer matches the value of the lopt pointer, the cntgpt.thpm bit (transmit history list pointer match) is set to 1. this indicates that no mess age buffer numbers that have not been read remain in the thl. if a new message buffer number is recorded, the lopt poi nter is incremented and because its value no longer matches the value of the tgpt pointer, the thpm bit is cleared. in other words, the numbers of the unread message buffers exist in the thl. if the lopt pointer is incremented and matches the value of the tgpt pointer minus 1, the tovf bit (transmit history list overflow) of the cntgpt regi ster is set to 1. this indicates t hat the thl is full of message buffer numbers that have not been read. if a new message is received and stored, the message buffer number recorded last is overwritten by the number of the message buffer that received and stored the new message. after the tovf bit has been set (1), therefore, the recorded message buffer num bers in the thl do not completely reflect chronological order. however the transmitted messages can be found by a cpu search applied to all transmit message buffers unless the cpu has not overwritten a transmit object in one of these buffers beforehand. in total up to six transmission completions can occur without overflowing the thl. caution even if the transmit hist ory list overflows (cntgpt.tovf bit = 1), the transmit history can be read until no more history is left unread and the cntgpt.thpm bit is set (1 ). however, the tovf bit is kept set (1) (= overflow occu rs) until cleared (0) by software. in this status, the thpm bit is not cleared (0), unless the tovf bi t is cleared (0), even if a new transmit history is stored and written to the list. if the tovf bit = 1 and the thpm bit = 1 and the receive history list overflows, therefore, the thpm bit indicates that no more hi story is left unread ev en if new history is received and stored. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1200 figure 21-32. transmit history list last out- message pointer (lopt) - cpu confirms tx completion of message buffer 6, 9, and 2. - tx completion of message buffer 3, and 4. event: tr a n s m i t history list get pointer (tgpt) - message buffer 8, 5, 6, and 10 completes transmission. - thl is full. - tovf bit is set to 1. event: transmit history list (thl) message buffer 6 message buffer 9 message buffer 2 message buffer 7 0 1 2 3 4 5 6 7 - message buffer 11, 13, and 14 completes transmission. - overflow situation occurs. event: tovf bit = 1 lopt is blocked tovf bit = 1 lopt is blocked tovf bit = 1 denotes that lopt equals tgpt ? 1 while message buffer number stored to element indicated by lopt ? 1. last out- message pointer (lopt) transmit history list get pointer (tgpt) transmit history list (thl) message buffer 7 message buffer 3 message buffer 4 0 1 2 3 4 5 6 7 transmit history list (thl) message buffer 6 message buffer 10 message buffer 7 message buffer 3 message buffer 4 message buffer 8 message buffer 5 0 1 2 3 4 5 6 7 last out- message pointer (lopt) tr a n s m i t history list get pointer (tgpt) transmit history list (thl) message buffer 6 message buffer 14 message buffer 7 message buffer 3 message buffer 4 message buffer 8 message buffer 5 0 1 2 3 4 5 6 7 last out- message pointer (lopt) transmit history list get pointer (tgpt)
chapter 21 can controller user?s manual u19201ej3v0ud 1201 21.10.3 automatic blo ck transmission (abt) the automatic block transmission (abt) function is used to transmit two or more data frames successively with no cpu interaction. the maximum number of transmit messa ge buffers assigned to the abt function is eight (message buffer numbers 0 to 7). by setting the cnctrl.opmode2 to cnctrl.opmode0 bits to 010b, ?normal operation mode with automatic block transmission function? (hereafter referred to as abt mode) can be selected. to issue an abt transmission request, define the message bu ffers by software first. set the cnmconfm.ma0 bit (1) in all the message buffers used for abt, and define all the buffers as transmit message buffers by setting the cnmconfm.mt2 to cnmconfm.m t0 bits to 000b. be sure to set the id for the message buffers for atb for each message buffer, even when that id is being used for all the message buffers. to use two or more ids, set the id of each message buffer by using the cnmidlm and cnmidhm registers. set the cnmdlcm and cnmdata0m to cnmdata7m registers before issuing a tr ansmission request for the abt function. after initialization of message buffers fo r abt is finished, the cnmctrlm.rdy bit needs to be set (1). in the abt mode, the cnmctrlm.trq bit does not have to be manipulated by software. after the data for the abt message buffers has been pre pared, set the cngmabt.abttr g bit to 1. automatic block transmission is then started. w hen abt is started, the trq bit in the first message buffer (message buffer 0) is automatically set to 1. after transmi ssion of the data of message buffer 0 is fi nished, the trq bit of the next message buffer, message buffer 1, is set aut omatically. in this way, transmission is executed successively. a delay time can be inserted by program in the interval in which the transmission request (trq bit) is automatically set while successive transmission is being executed. th e delay time to be inserted is defined by the cngmabtd register. the unit of the delay time is dbt (data bit time). dbt depends on the setting of the cnbrp and cnbtr registers. during abt, the priority of the transmission id is not searched in the abt transmit message buffer. the data of message buffers 0 to 7 is sequentially transmitted. when transmission of the data frame from message buffer 7 has been completed, the abttrg bit is automatically cleared to 0 and the abt operation is finished. if the rdy bit of an abt message buffer is cleared during abt, no data frame is transmitt ed from that buffer, abt is stopped, and the abttrg bit is clear ed. after that, transmission can be resumed from the message buffer where abt stopped, by setting the rdy and abttrg bits to 1 by so ftware. to not resume transmission from the message buffer where abt stopped, the internal abt engine can be rese t by setting the cngmabt.abtclr bit to 1 while abt mode is stopped and the abttrg bit is cleared to 0. in this case, transmission is started from message buffer 0 if the abtclr bit is cleared to 0 and then the abttrg bit is set to 1. an interrupt can be used to check if data frames have b een transmitted from all the message buffers for abt. to do so, the cnmctrlm.ie bit of each message buffer except the last message buffer needs to be cleared (0). if a transmit message buffer other than those used by the abt function (message buffers 8 to 31) is assigned to a transmit message buffer, the priority of the message to be tr ansmitted is determined by the priority of the transmission message buffer of the abt message buffer whose transmi ssion is currently held pending and the transmission message buffer of the message buffers other than those used by the abt function. transmission of a data frame from an abt message buffer is not recorded in the transmit history list (thl).
chapter 21 can controller user?s manual u19201ej3v0ud 1202 cautions 1. to resume the normal operation mode with abt from the message buffer 0, set the abtclr bit to 1 while the abttrg bit is cleared to 0. if th e abtclr bit is set to 1 while the abttrg bit is set to 1, the sub sequent operation is not guaranteed. 2. whether the automatic blo ck transmission engine is cleared by setting the abtclr bit to 1 can be confirmed if the abtclr bit is auto matically cleared to 0 immediately after the processing of the clearing request is completed. 3. do not set the abttrg bit in the initialization mode. if the abttrg bit is set in the initialization mode, the proper operation is not guaranteed afte r the mode is changed from the initialization mode to the abt mode. 4. do not set the trq bit of the abt message buffers to 1 by software in the normal operation mode with abt. otherwise, the operation is not guaranteed. 5. the cngmabtd register is used to set the delay time that is inserted in the period from completion of the preceding abt message to setting of the trq bi t for the next abt message when the transmissi on requests are set in the order of message numbers for each message for abt that is successively transmitted in the abt mode. the timing at which the messages are actually transmitte d onto the can bus vari es depending on the status of transmission from othe r stations and the status of the setting of the transmission request for messages other than the abt messages (message buffers 8 to 31). 6. if a transmission request is made for a message other than an abt message and if no delay time is inserted in the interval in which transmission requests for abt are automatically set (cngmabtd register = 00h ), messages other than abt messages may be transmitted regardless of their priori ty in regards to the abt message. 7. do not clear the rdy bit to 0 when the abttrg bit = 1. 8. if a message is received from another node in the normal operation mode with abt, the message may be transmitted after the time of one frame has elapsed even when cngmabtd register = 00h. remark n = 0, 1 m = 00 to 31
chapter 21 can controller user?s manual u19201ej3v0ud 1203 21.10.4 transmission abort process remark n = 0, 1 m = 00 to 31 (1) transmission abort process other than in normal operation mode wit h automatic block transmission (abt) the user can clear the cnmctrlm.trq bit to 0 to abort a transmission request. the trq bit will be cleared immediately if the abort was successf ul. whether the transmission was successfully aborted or not can be checked using the cnctrl.tst at bit and the cntgpt regi ster, which indicate the transmission status on the can bus (for details, refer to the processing in figure 21-46 ). (2) transmission abort process except for abt tran smission in normal operati on mode with automatic block transmission (abt) the user can clear the cngmabt.abttrg bit to 0 to abort a transmission request. after checking the abttrg bit of the cngmabt register = 0, clear th e cnmctrlm.trq bit to 0. the trq bit will be cleared immediately if the abort was successf ul. whether the transmission was su ccessfully aborted or not can be checked by using the cnctrl.tstat bit and the cntgpt register, which i ndicate the transmission status on the can bus (for details, refer to the process in figure 21-47 ). (3) transmission abort in no rmal operation mode with automa tic block transmission (abt) to abort abt that is already start ed, clear the cngmabt.abttrg bit to 0. in this case, the abttrg bit remains 1 if an abt message is currently being tran smitted and until the transmission is completed (successfully or not), and is cleared to 0 as soon as transmission is finished. this aborts abt. if the last transmission (before abt) was successful, the normal operation mode with abt is left with the internal abt pointer pointing to the next message buffer to be transmitted. in the case of an erroneous transmissi on, the position of the internal abt pointer depends on t he status of the trq bit in the last transmitted message buffer. if the trq bit is set to 1 when clearing the abttrg bit is requested, the internal abt pointer points to the la st transmitted message buffer (for details, refer to the process in figure 21-48 (a) ). if the trq bit is cleared to 0 when clearing the abttrg bit is requested, the internal abt pointer is increased in increments of 1 and indicates the next message buffer in the abt area (for details, refer to the process in figure 21-48 (b) ). caution be sure to abort abt by clearing the abttrg bit to 0. the operation is not guaranteed if aborting transmission is requested by clearing rdy. when the normal operation mode with abt is resumed af ter abt has been aborted and the abttrg bit is set to 1, the next abt message buffer to be transmitt ed can be determined from the following table. status of trq of abt message buffer abort after succe ssful transmission abort a fter erroneous transmission set (1) next message buffer in the abt area note same message buffer in the abt area cleared (0) next message buffer in the abt area note next message buffer in the abt area note note the above resumption operation can be performed only if a message buffer ready for abt exists in the abt area. for example, an abort request that is issu ed while abt of message buffer 7 is in progress is regarded as completion of abt, rather than abor t, if transmission of message buffer 7 has been successfully completed, even if the abttrg bit is cleared to 0. if the cnmctrlm.rdy bit in the next message buffer in the abt area is cleared to 0, the internal abt pointer is retained, but the resumption operation is not performed even if the abttrg bi t is set to 1, and abt ends immediately. remark n = 0, 1 m = 00 to 31
chapter 21 can controller user?s manual u19201ej3v0ud 1204 21.10.5 remote frame transmission remote frames can be transmitted only from transmit mess age buffers. set whether a data frame or remote frame is transmitted via the cnmconfm.rtr bit. setting (1) the rtr bit sets remote frame transmission. remark n = 0, 1 m = 00 to 31
chapter 21 can controller user?s manual u19201ej3v0ud 1205 21.11 power saving modes 21.11.1 can sleep mode the can sleep mode can be used to set the can cont roller to standby mode in order to reduce power consumption. the can module can en ter the can sleep mode from all operati on modes. release of the can sleep mode returns the can module to exactly the same oper ation mode from which the can sleep mode was entered. in the can sleep mode, the can module does not tr ansmit messages, even when transmission requests are issued or pending. (1) entering can sleep mode the cpu issues a can sleep mode transition reques t by writing 01b to the cnctrl.psmode1 and cnctrl.psmode0 bits. this transition request is only acknowledged only under the following conditions. remark n = 0, 1 (i) the can module is already in one of the following operation modes ? normal operation mode ? normal operation mode with abt ? receive-only mode ? single-shot mode ? self-test mode ? can stop mode in all the above operation modes (ii) the can bus state is bus idle (the 4th bit in the interframe space is recessive) note note if the can bus is fixed to dominant, the request for transition to the can sleep mode is held pending. also the transition from can stop m ode to can sleep mode is independent of the can bus state. (iii) no transmission request is pending if any one of the conditions mentioned above is not met, the can module will operate as follows. ? if the can sleep mode is requested from the initializati on mode, the can sleep mode transition request is ignored and the can module remains in the initialization mode. ? if the can bus state is not bus idle (i.e., the can bus state is either transmitting or receiving) when the can sleep mode is requested in one of the operatio n modes, immediate transition to the can sleep mode is not possible. in this case, the can sleep mode transition request has to be held pending until the can bus state becomes bus idle (t he 4th bit in the interframe space is recessive). in the time from the can sleep mode request to successful transition, the psmode1 and psmode0 bits remain 00b. when the module has entered the can sleep mode, the psmode1 and psmode0 bits are set to 01b. ? if a request for transition to the initialization mode and a request for transition to the can sleep mode are made at the same time while the can module is in one of the operation modes, the request for the initialization mode is enabled. t he can module enters the initialization mode at a predetermined timing. at this time, the can sleep mode request is not held pending and is ignored. ? even when the initialization mode and sleep mode are not requested simultaneously (i.e the first request was not granted when a second request was made), the request for initialization has priority over the can sleep mode request. the can sleep mode request is cancelled when the initialization mode is requested. when a pending request for the initializa tion mode is present, a subsequent request for the can sleep mode request is cancelled right at t he point in time when it was submitted.
chapter 21 can controller user?s manual u19201ej3v0ud 1206 (2) status in can sleep mode the can module is in one of the following states after it enters the can sleep mode. ? the internal operating clock is stopped a nd the power consumption is minimized. ? the function to detect the falling edg e of the can reception pin (crxdn) remains in effect to wake up the can module from the can bus. ? to wake up the can module from the cpu, data c an be written to the psmode1 and psmode0 bits, but nothing can be written to other cann module registers or bits. ? the cann module registers can be read, exc ept for the cnlipt, cnrg pt, cnlopt, and cntgpt registers. ? the cann message buffer register s cannot be written or read. ? cngmctrl.mbon bit is cleared to 0. ? a request for transition to the initializati on mode is not acknowledged and is ignored. remark n = 0, 1 (3) releasing can sleep mode the can sleep mode is releas ed by the following events. ? when the cpu writes 00b to the psmode1 and psmode0 bits ? a falling edge at the can reception pin (crxdn) (i.e. the can bus level shifts from recessive to dominant) cautions 1. even if the falling edge belongs to the sof of a r eceive message, this message will not be received and stored. if the cpu has turn ed off the clock to the can while the can was in sleep mode, later on the can sleep mode will not be released and psmode[1:0] bits will continue to be 01b unless the clock for the can is provided again. in addition to this, the receive message will not be received afterwards. 2. if a falling edge is detected at the can reception pin (crxdn) while the can clock is supplied, the psmode0 bit must be cleared by software. (for de tails, refer to the processing in figure 21-53.) after releasing the sleep mode, the can module return s to the operation mode from which the can sleep mode was requested and the psmode1 and psmode0 bits are rese t to 00b. if the can sleep mode is released by a change in the can bus state, the cnints.cints5 bit is se t to 1, regardless of the cnie.cie bit. after the can module is released from the can sleep mode, it participa tes in the can bus again by automatically detecting 11 consecutive recessive-level bits on the can bus. after releasing the sleep mode and before accessing the message buffer by application again, confi rm that cngmctrl.mbon bit = 1. when a request for transition to the initialization mode is made while the can module is in the can sleep mode, that request is ignored; the cpu has to be released from sleep mode by software first before entering the initialization mode. caution when the can sleep mode is released by an event of the can bus, a wakeup interrupt occurs even if the event of the can bus occurs immediately a fter the mode has been changed to the sleep mode. note that the in terrupt can occur at any time. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1207 21.11.2 can stop mode the can stop mode can be used to set the can controller to standby mode to reduce power consumption. the can module can enter the can stop mode only from the ca n sleep mode. release of the can stop mode puts the can module in the can sleep mode. the can stop mode can only be released (shifting to can sleep mode) by writing 01b to the cnctrl.psmode1 and cnctrl.psmode0 bits and not by a change in the ca n bus state. no message is transmitted even when transmission requests are issued or pending. remark n = 0, 1 (1) entering can stop mode a can stop mode transition request is issued by writing 11b to the psmode1 and psmode0 bits. a can stop mode request is only acknowledged when the ca n module is in the can sleep mode. in all other modes, the request is ignored. caution to set the can module to the can stop m ode, the module must be in the can sleep mode. to confirm that the module is in the sleep mode, check that the psmode1 and psmode0 bits = 01b, and then request the can stop m ode. if a bus change occurs at the can reception pin (crxdn) while this process is being performed, the can sleep mode is automatically released. in th is case, the can stop mode tr ansition request cannot be acknowledged (while the can clock is supplied, however, the psmode0 must be cleared by software after the bus level of the can reception pin (crxdn) is changed). (2) status in can stop mode the can module is in one of the following states after it enters the can stop mode. ? the internal operating clock is stopped a nd the power consumption is minimized. ? to wake up the can module from the cpu, data c an be written to the psmode1 and psmode0 bits, but nothing can be written to other cann module registers or bits. ? the cann module registers can be read, exc ept for the cnlipt, cnrg pt, cnlopt, and cntgpt registers. ? the cann message buffer register s cannot be written or read. ? the cngmctrl.mbon bit is cleared to 0. ? an initialization mode transition reques t is not acknowledged and is ignored. (3) releasing can stop mode the can stop mode can only be rele ased by writing 01b to the psmode1 and psmode0 bits. after releasing the can stop mode, the can module enters the can sleep mode. when the initialization mode is reques ted while the can module is in t he can stop mode, that request is ignored; the cpu has to release t he stop mode and subsequently the ca n sleep mode before entering into initialization mode. it is impossible to enter another operation mode directly from the can stop mode without entering the can sleep mode, the request will be ignored.
chapter 21 can controller user?s manual u19201ej3v0ud 1208 21.11.3 example of using power saving modes in some application systems, it may be necessary to plac e the cpu in a power saving mode to reduce the power consumption. by using the power saving mode specific to the can module and the power saving mode specific to the cpu in combination, the cpu can be woken up fr om the power saving status by the can bus. here is an example of using the power saving modes. first, put the can module in the can sleep mode (psmod e1, psmode0 bits = 01b). next, put the cpu in the power saving mode. if an edge transition from recessive to dom inant is detected at the crxdn signal in this status, the cints5 bit in the can module is set to 1. if the cnctrl.cie5 bit is set to 1, a wakeup interrupt (intcnwup) is generated. the can module is automat ically released from the can sleep mode (psmode1, psmode0 bits = 00b) and returns to normal operation mode (while the can cloc k is supplied, however, t he psmode0 must be cleared by software after a bus level change is detected at the can reception pin (crxdn). ). the cpu, in response to intcnwup, can release its own power saving mode and return to normal operation mode. to further reduce the power consumpti on of the cpu, the internal clocks, in cluding that of the can module, may be tuned off. in this case, the operating clock supplied to t he can module is turned off after the can module is put in the can sleep mode. then the cp u enters a power saving mode in which the clock supplied to the cpu is turned off. if an edge transition from recessive to dominant is detected at the crxdn signal in this status, the can module can set the cints5 bit to 1 and generate a wa keup interrupt (intcnwup) even if it is not supplied with a clock. the other functions, however, do not operate because the clock supply to the can module is shut off, and the module remains in the can sleep mode. the cpu, in response to intcnwup , releases its power saving mode, resumes supply of the internal clocks, including the clock to the can module, a fter oscillation stabilization time has elapsed, and starts instruction execution. the ca n module is immediately released from t he can sleep mode when the clock supply is resumed, and returns to normal operation mode (psmode1, psmode0 bits = 00b). remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1209 21.12 interrupt function the can module provides 6 different interrupt sources. the occurrence of these interrupt source s is stored in interrupt status regist ers. four separate interrupt request signals are generated from the six interrupt sources. when an interrupt request signal that corresponds to two or more interrupt sources is generated, the interrupt sources can be identified by us ing an interrupt status register. after an interrupt source has occurred, the corresponding inte rrupt status bit must be cleared to 0 by software. table 21-20. list of can module interrupt sources interrupt status bit interrupt enable bit no. name register name register interrupt request signal interrupt source description 1 cints0 note 1 cnints cie0 note 1 cnie intcntrx message frame successfu lly transmitted from message buffer m 2 cints1 note 1 cnints cie1 note 1 cnie intcnrec valid message frame reception in message buffer m 3 cints2 cnints cie2 cnie can module error state interrupt note 2 4 cints3 cnints cie3 cnie can module protocol error interrupt note 3 5 cints4 cnints cie4 cnie intcnerr can module arbitration loss interrupt 6 cints5 cnints cie5 cnie intcnwup can module wakeup interrupt from can sleep mode note 4 notes 1. the cnmctrl.ie bit (message buffer interrupt enable bit) of the corresponding message buffer has to be set to 1 for that message buffer to participate in the interrupt generation process. 2. this interrupt is generated when the transmission/rec eption error counter is at the warning level, or in the error passive or bus-off state. 3. this interrupt is generated when a stuff error, form error, ack error, bit e rror, or crc error occurs. 4. this interrupt is generated when the can module is woken up from the can sleep mode because a falling edge is detected at the can reception pin (c an bus transition from recessive to dominant). remark n = 0, 1 m = 00 to 31
chapter 21 can controller user?s manual u19201ej3v0ud 1210 21.13 diagnosis functions and special operational modes the can module provides a receive-only mode, single- shot mode, and self-test mode to support can bus diagnosis functions or the operation of special can communication methods. 21.13.1 receive-only mode the receive-only mode is used to monitor receive mess ages without causing any interference on the can bus and can be used for can bus analysis nodes. for example, this mode can be used for automatic baud- rate detection. the baud rate in the can module is changed until ?valid reception? is dete cted, so that the baud rates in the module match (?valid reception? means a message frame has been received in the can protocol la yer without occurrence of an error and with an appropriate ack between nodes connected to the can bus). a valid rec eption does not require mess age frames to be stored in a receive message buffer (data frames) or transmit message bu ffer (remote frames). the event of valid reception is indicated by setting the cnctrl.valid bit (1). figure 21-33. can module terminal co nnection in receive-only mode can macro tx rx crxdn ctxdn fixed to the recessive level
chapter 21 can controller user?s manual u19201ej3v0ud 1211 in the receive-only mode, no message frames can be transm itted from the can module to the can bus. transmit requests issued for message buffers defined as transmit message buffers are held pending. in the receive-only mode, the can transmission pin (ctxdn) in the can module is fixed to the recessive level. therefore, no active error flag can be transmitted from t he can module to the can bus even when a can bus error is detected while receiving a message frame. since no transmission can be issued from the can module, the transmission error counter the cnerc.tec7 to cnerc.tec0 bits are never updated. therefore, a can module in the receive-only mode does no t enter the bus-off state. furthermore, ack is not returned to the can bus in th is mode upon the valid reception of a message frame. internally, the local node recognizes that it has transmitted ack. an overload frame cannot be transmitted to the can bus. caution if only two can nodes are conn ected to the can bus and one of them is operating in the receive- only mode, there is no ack on the can bus. due to the missing ack, the tran smitting node will transmit an active error flag, a nd repeat transmitting a message fr ame. the transmitting node becomes error passive after tran smitting the message frame 16 ti mes (assuming that the error counter was 0 in the beginning and no other erro rs have occurred). wh en the message frame is transmitted for the 17th time, the transmitting node generates a pa ssive error flag. the receiving node in the receive-only mode det ects the first valid m essage frame at this point, and the valid bit is set to 1 for the first time. remark n = 0, 1 21.13.2 single-shot mode in the single-shot mode, automatic re-t ransmission as defined in the can protoc ol is switched off. (according to the can protocol, a message frame transmission that has been aborted by either arbitration loss or error occurrence has to be repeated without control by software. ) all other behavior of single-shot mode is identical to normal operation mode. features of single-shot mode can not be used in combination with normal mode with abt. the single-shot mode disables the re-transmission of an aborted message frame transmission according to the setting of the cnctrl.al bit. when the al bit is cleared to 0, re-transmission upon arbitration loss and upon error occurrence is disabled. if the al bit is set to 1, re-trans mission upon error occurrence is disabled, but re-transmission upon arbitration loss is enabled. as a consequence, the cnmctrlm.trq bi t in a message buffer defined as a transmit message buffer is cleared to 0 by the following events. ? successful transmission of the message frame ? arbitration loss while sending the message frame (al bit = 0) ? error occurrence while sending the message frame the events arbitration loss and error occurrence can be distinguished by checking the cnints.cints4 and cnints.cints3 bits, and the type of the error can be identi fied by reading the cnlec.lec2 to cnlec.lec0 bits of the register. upon successful transmission of the message frame, the tr ansmit completion interrupt the cints0 bit of the cnints register is set to 1. if the cnie.cie0 bit is se t to 1 at this time, an interrupt request signal is output. the single-shot mode can be used when emulating time-t riggered communication methods (e.g., ttcan level 1). caution the al bit is only valid in single-shot mode. it does not affect the op eration of re-transmission upon arbitration loss in other operation modes. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1212 21.13.3 self-test mode in the self-test mode, message frame transmission and message frame reception can be tested without connecting the can node to the can bus or without affecting the can bus. in the self-test mode, the can module is completely disconnected from the ca n bus, but transmission and reception are internally looped back. the can transmi ssion pin (ctxdn) is fixed to the recessive level. if the falling edge on the can reception pin (crxdn) is det ected after the can module has entered the can sleep mode from the self-test mode, however, the module is released from the can sl eep mode in the same manner as the other operation modes (when the sleep mode is released while the can clock is supplied, however, the psmode0 bit must be cleared by software after a falling edge is detected at the can reception pin (c rxdn). ).to keep the module in the can sleep mode, use the can reception pin (crxdn) as a port pin. remark n = 0, 1 figure 21-34. can module terminal connection in self-test mode can macro tx rx crxdn ctxdn fixed to the recessive level
chapter 21 can controller user?s manual u19201ej3v0ud 1213 21.13.4 transmission/reception ope ration in each operation mode table 21-21 shows the transmission/recept ion operation in each operation mode. table 21-21. overview of transmission/r eception operation in each operation mode operation mode data frame/ remote frame transmission ack transmission error frame/ overload frame transmission retransmission automatic block transmission (abt) setting of valid bit storing data in message buffer initialization mode ? ? ? ? ? ? ? normal operation mode ? normal operation mode with abt receive-only mode ? ? ? ? ? single-shot mode ? note 1 ? self test mode note 2 note 2 note 2 note 2 ? note 2 note 2 notes 1. if arbitration is lost, retransmission can be selected by the cnctrl.al bit. 2. each signal is not output to the external circ uit but is internally generated by the can module.
chapter 21 can controller user?s manual u19201ej3v0ud 1214 21.14 time stamp function can is an asynchronous, serial protocol. all nodes connect ed to the can bus have a local, autonomous clock. as a consequence, the clocks of the nodes have no relation (i.e., the clocks are asynchronous and may even have different frequencies). in some applications, however, a common time base over the network (= global time base) is needed. in order to build up a global time base, a time stam p function is used. the essential mechan ism of a time stamp function is the capture of timer values triggered by signals on the can bus. 21.14.1 time stamp function the can controller supports the capturing of timer values triggered by a specific frame. an on-chip 16-bit capture timer unit in a microcontroller system is us ed in addition to the can c ontroller. the 16-bit capture timer unit captures the timer value according to a trigger signal (tsout) for ca pturing that is out put when a data frame is received from the can controller. the cpu can retrie ve the time of occurrence of the capt ure event, i.e., the time stamp of the message received from the can bus, by reading the captur ed value. the tsout signal can be selected from the following two event sources and is specified by the cnts.tssel bit. ? sof event (start of frame) (tssel bit = 0) ? eof event (last bit of end of frame) (tssel bit = 1) the tsout signal is enabled by setting the cnts.tsen bit to 1. figure 21-35. timing diagram of capture signal tsout t tsout sof sof sof sof the tsout signal toggles its level upon occurrence of the selected event during data frame reception (in figure 21-34, the sof is used as the trigger event source). to capture a timer value by using the tsout signal, the capture timer unit must detect the capture signal at both the rising edge and falling edge. this time stamp function is controlled by the cnts.tsl ock bit. when the tslock bit is cleared to 0, the tsout signal toggles upon occurrence of the selected event. if the tslock bit is set to 1, the tsout signal toggles upon occurrence of the selected event, but the toggle is stopped as the tsen bit is automatically cleared to 0 when a data frame starts to be received and stored in message buffer 0. this suppresses the subsequent toggle occurrence by the tsout signal, so that the time stamp value toggled last (= captured last) can be saved as the time stamp value of the time at which the data frame was received in message buffer 0.
chapter 21 can controller user?s manual u19201ej3v0ud 1215 caution the time stamp function using the tslock bit stops toggle of the tsout signal by receiving a data frame in message buffer 0. therefore, me ssage buffer 0 must be set as a receive message buffer. since a receive messag e buffer cannot receive a remote frame, toggle of the tsout signal cannot be stopped by recep tion of a remote frame. togg le of the tsout signal does not stop when a data frame is received in a message buffer other than message buffer 0. for these reasons, a data frame ca nnot be received in message buffer 0 when the can module is in the normal operation mode with abt, becau se message buffer 0 must be set as a transmit message buffer. in this oper ation mode, therefore, the function to stop toggle of the tsout signal by the tslock bit cannot be used. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1216 21.15 baud rate settings 21.15.1 bit rate setting conditions make sure that the settings are within the range of limit values for ensuring co rrect operation of the can controller, as follows. (a) 5tq spt (sampling point) 17 tq spt = tseg1 + 1tq (b) 8 tq dbt (data bit time) 25 tq dbt = tseg1 + tseg2 + 1tq = tseg2 + spt (c) 1 tq sjw (synchronization jump width) 4tq sjw dbt ? spt (d) 4tq tseg1 16tq [3 setting value of tseg1[3:0] 15] (e) 1tq tseg2 8tq [0 setting value of tseg2[2:0] 7] remark tq = 1/f tq (f tq : can protocol layer base system clock) tseg1[3:0] (cnbtr.tseg13 to cn btr.tseg10 bits) (n = 0, 1) tseg2[2:0] (cnbtr.tseg22 to cn btr.tseg20 bits) (n = 0, 1) table 21-22 shows the combinations of bi t rates that satisfy the above conditions.
chapter 21 can controller user?s manual u19201ej3v0ud 1217 table 21-22. settable bit rate combinations (1/3) valid bit rate setting cnbtr register setting value dbt length sync segment prop segment phase segment1 phase segment2 tseg13 to tseg10 tseg22 to tseg20 sampling point (unit: %) 25 1 8 8 8 1111 111 68.0 24 1 7 8 8 1110 111 66.7 24 1 9 7 7 1111 110 70.8 23 1 6 8 8 1101 111 65.2 23 1 8 7 7 1110 110 69.6 23 1 10 6 6 1111 101 73.9 22 1 5 8 8 1100 111 63.6 22 1 7 7 7 1101 110 68.2 22 1 9 6 6 1110 101 72.7 22 1 11 5 5 1111 100 77.3 21 1 4 8 8 1011 111 61.9 21 1 6 7 7 1100 110 66.7 21 1 8 6 6 1101 101 71.4 21 1 10 5 5 1110 100 76.2 21 1 12 4 4 1111 011 81.0 20 1 3 8 8 1010 111 60.0 20 1 5 7 7 1011 110 65.0 20 1 7 6 6 1100 101 70.0 20 1 9 5 5 1101 100 75.0 20 1 11 4 4 1110 011 80.0 20 1 13 3 3 1111 010 85.0 19 1 2 8 8 1001 111 57.9 19 1 4 7 7 1010 110 63.2 19 1 6 6 6 1011 101 68.4 19 1 8 5 5 1100 100 73.7 19 1 10 4 4 1101 011 78.9 19 1 12 3 3 1110 010 84.2 19 1 14 2 2 1111 001 89.5 18 1 1 8 8 1000 111 55.6 18 1 3 7 7 1001 110 61.1 18 1 5 6 6 1010 101 66.7 18 1 7 5 5 1011 100 72.2 18 1 9 4 4 1100 011 77.8 18 1 11 3 3 1101 010 83.3 18 1 13 2 2 1110 001 88.9 18 1 15 1 1 1111 000 94.4 remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1218 table 21-22. settable bit rate combinations (2/3) valid bit rate setting cnbtr register setting value dbt length sync segment prop segment phase segment1 phase segment2 tseg13 to tseg10 tseg22 to tseg20 sampling point (unit: %) 17 1 2 7 7 1000 110 58.8 17 1 4 6 6 1001 101 64.7 17 1 6 5 5 1010 100 70.6 17 1 8 4 4 1011 011 76.5 17 1 10 3 3 1100 010 82.4 17 1 12 2 2 1101 001 88.2 17 1 14 1 1 1110 000 94.1 16 1 1 7 7 0111 110 56.3 16 1 3 6 6 1000 101 62.5 16 1 5 5 5 1001 100 68.8 16 1 7 4 4 1010 011 75.0 16 1 9 3 3 1011 010 81.3 16 1 11 2 2 1100 001 87.5 16 1 13 1 1 1101 000 93.8 15 1 2 6 6 0111 101 60.0 15 1 4 5 5 1000 100 66.7 15 1 6 4 4 1001 011 73.3 15 1 8 3 3 1010 010 80.0 15 1 10 2 2 1011 001 86.7 15 1 12 1 1 1100 000 93.3 14 1 1 6 6 0110 101 57.1 14 1 3 5 5 0111 100 64.3 14 1 5 4 4 1000 011 71.4 14 1 7 3 3 1001 010 78.6 14 1 9 2 2 1010 001 85.7 14 1 11 1 1 1011 000 92.9 13 1 2 5 5 0110 100 61.5 13 1 4 4 4 0111 011 69.2 13 1 6 3 3 1000 010 76.9 13 1 8 2 2 1001 001 84.6 13 1 10 1 1 1010 000 92.3 12 1 1 5 5 0101 100 58.3 12 1 3 4 4 0110 011 66.7 12 1 5 3 3 0111 010 75.0 12 1 7 2 2 1000 001 83.3 12 1 9 1 1 1001 000 91.7 remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1219 table 21-22. settable bit rate combinations (3/3) valid bit rate setting cnbtr register setting value dbt length sync segment prop segment phase segment1 phase segment2 tseg13 to tseg10 tseg22 to tseg20 sampling point (unit: %) 11 1 2 4 4 0101 011 63.6 11 1 4 3 3 0110 010 72.7 11 1 6 2 2 0111 001 81.8 11 1 8 1 1 1000 000 90.9 10 1 1 4 4 0100 011 60.0 10 1 3 3 3 0101 010 70.0 10 1 5 2 2 0110 001 80.0 10 1 7 1 1 0111 000 90.0 9 1 2 3 3 0100 010 66.7 9 1 4 2 2 0101 001 77.8 9 1 6 1 1 0110 000 88.9 8 1 1 3 3 0011 010 62.5 8 1 3 2 2 0100 001 75.0 8 1 5 1 1 0101 000 87.5 7 note 1 2 2 2 0011 001 71.4 7 note 1 4 1 1 0100 000 85.7 6 note 1 1 2 2 0010 001 66.7 6 note 1 3 1 1 0011 000 83.3 5 note 1 2 1 1 0010 000 80.0 4 note 1 1 1 1 0001 000 75.0 note setting with a dbt value of 7 or less is valid only wh en the value of the cnbrp r egister is other than 00h. caution the values in table 21-22 do not guarantee th e operation of the network system. thoroughly check the effect on the network system, taking into consideration oscillation errors and delays of the can bus and can transceiver. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1220 21.15.2 representative examples of baud rate settings tables 21-23 and 21-24 show representative examples of baud rate settings. table 21-23. representative e xamples of baud rate settings (f canmod = 8 mhz) (1/2) valid bit rate setting (unit: kbps) cnbtr register setting value set baud rate value (unit: kbps) division ratio of cnbrp register cnbrp register set value length of dbt sync segment prop segment phase segment1 phase segment2 tseg13 to tseg10 tseg22 to tseg20 sampling point (unit: %) 1000 1 00000000 8 1 1 3 3 0011 010 62.5 1000 1 00000000 8 1 3 2 2 0100 001 75.0 1000 1 00000000 8 1 5 1 1 0101 000 87.5 500 1 00000000 16 1 1 7 7 0111 110 56.3 500 1 00000000 16 1 3 6 6 1000 101 62.5 500 1 00000000 16 1 5 5 5 1001 100 68.8 500 1 00000000 16 1 7 4 4 1010 011 75.0 500 1 00000000 16 1 9 3 3 1011 010 81.3 500 1 00000000 16 1 11 2 2 1100 001 87.5 500 1 00000000 16 1 13 1 1 1101 000 93.8 500 2 00000001 8 1 1 3 3 0011 010 62.5 500 2 00000001 8 1 3 2 2 0100 001 75.0 500 2 00000001 8 1 5 1 1 0101 000 87.5 250 2 00000001 16 1 1 7 7 0111 110 56.3 250 2 00000001 16 1 3 6 6 1000 101 62.5 250 2 00000001 16 1 5 5 5 1001 100 68.8 250 2 00000001 16 1 7 4 4 1010 011 75.0 250 2 00000001 16 1 9 3 3 1011 010 81.3 250 2 00000001 16 1 11 2 2 1100 001 87.5 250 2 00000001 16 1 13 1 1 1101 000 93.8 250 4 00000011 8 1 3 2 2 0100 001 75.0 250 4 00000011 8 1 5 1 1 0101 000 87.5 125 4 00000011 16 1 1 7 7 0111 110 56.3 125 4 00000011 16 1 3 6 6 1000 101 62.5 125 4 00000011 16 1 5 5 5 1001 100 68.8 125 4 00000011 16 1 7 4 4 1010 011 75.0 125 4 00000011 16 1 9 3 3 1011 010 81.3 125 4 00000011 16 1 11 2 2 1100 001 87.5 125 4 00000011 16 1 13 1 1 1101 000 93.8 125 8 00000111 8 1 3 2 2 0100 001 75.0 125 8 00000111 8 1 5 1 1 0101 000 87.5 caution the values in table 21-23 do not guarantee th e operation of the network system. thoroughly check the effect on the network system, taking into consideration oscillation errors and delays of the can bus and can transceiver. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1221 table 21-23. representative e xamples of baud rate settings (f canmod = 8 mhz) (2/2) valid bit rate setting (unit: kbps) cnbtr register setting value set baud rate value (unit: kbps) division ratio of cnbrp register cnbrp register set value length of dbt sync segment prop segment phase segment1 phase segment2 tseg13 to tseg10 tseg22 to tseg20 sampling point (unit: %) 100 4 00000011 20 1 7 6 6 1100 101 70.0 100 4 00000011 20 1 9 5 5 1101 100 75.0 100 5 00000100 16 1 7 4 4 1010 011 75.0 100 5 00000100 16 1 9 3 3 1011 010 81.3 100 8 00000111 10 1 3 3 3 0101 010 70.0 100 8 00000111 10 1 5 2 2 0110 001 80.0 100 10 00001001 8 1 3 2 2 0100 001 75.0 100 10 00001001 8 1 5 1 1 0101 000 87.5 83.3 4 00000011 24 1 7 8 8 1110 111 66.7 83.3 4 00000011 24 1 9 7 7 1111 110 70.8 83.3 6 00000101 16 1 5 5 5 1001 100 68.8 83.3 6 00000101 16 1 7 4 4 1010 011 75.0 83.3 6 00000101 16 1 9 3 3 1011 010 81.3 83.3 6 00000101 16 1 11 2 2 1100 001 87.5 83.3 8 00000111 12 1 5 3 3 0111 010 75.0 83.3 8 00000111 12 1 7 2 2 1000 001 83.3 83.3 12 00001011 8 1 3 2 2 0100 001 75.0 83.3 12 00001011 8 1 5 1 1 0101 000 87.5 33.3 10 00001001 24 1 7 8 8 1110 111 66.7 33.3 10 00001001 24 1 9 7 7 1111 110 70.8 33.3 12 00001011 20 1 7 6 6 1100 101 70.0 33.3 12 00001011 20 1 9 5 5 1101 100 75.0 33.3 15 00001110 16 1 7 4 4 1010 011 75.0 33.3 15 00001110 16 1 9 3 3 1011 010 81.3 33.3 16 00001111 15 1 6 4 4 1001 011 73.3 33.3 16 00001111 15 1 8 3 3 1010 010 80.0 33.3 20 00010011 12 1 5 3 3 0111 010 75.0 33.3 20 00010011 12 1 7 2 2 1000 001 83.3 33.3 24 00010111 10 1 3 3 3 0101 010 70.0 33.3 24 00010111 10 1 5 2 2 0110 001 80.0 33.3 30 00011101 8 1 3 2 2 0100 001 75.0 33.3 30 00011101 8 1 5 1 1 0101 000 87.5 caution the values in table 21-23 do not guarantee th e operation of the network system. thoroughly check the effect on the network system, taking into consideration oscillation errors and delays of the can bus and can transceiver. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1222 table 21-24. representative e xamples of baud rate settings (f canmod = 16 mhz) (1/2) valid bit rate setting (unit: kbps) cnbtr register setting value set baud rate value (unit: kbps) division ratio of cnbrp register cnbrp register set value length of dbt sync segment prop segment phase segment1 phase segment2 tseg13 to tseg10 tseg22 to tseg20 sampling point (unit: %) 1000 1 00000000 16 1 1 7 7 0111 110 56.3 1000 1 00000000 16 1 3 6 6 1000 101 62.5 1000 1 00000000 16 1 5 5 5 1001 100 68.8 1000 1 00000000 16 1 7 4 4 1010 011 75.0 1000 1 00000000 16 1 9 3 3 1011 010 81.3 1000 1 00000000 16 1 11 2 2 1100 001 87.5 1000 1 00000000 16 1 13 1 1 1101 000 93.8 1000 2 00000001 8 1 3 2 2 0100 001 75.0 1000 2 00000001 8 1 5 1 1 0101 000 87.5 500 2 00000001 16 1 1 7 7 0111 110 56.3 500 2 00000001 16 1 3 6 6 1000 101 62.5 500 2 00000001 16 1 5 5 5 1001 100 68.8 500 2 00000001 16 1 7 4 4 1010 011 75.0 500 2 00000001 16 1 9 3 3 1011 010 81.3 500 2 00000001 16 1 11 2 2 1100 001 87.5 500 2 00000001 16 1 13 1 1 1101 000 93.8 500 4 00000011 8 1 3 2 2 0100 001 75.0 500 4 00000011 8 1 5 1 1 0101 000 87.5 250 4 00000011 16 1 3 6 6 1000 101 62.5 250 4 00000011 16 1 5 5 5 1001 100 68.8 250 4 00000011 16 1 7 4 4 1010 011 75.0 250 4 00000011 16 1 9 3 3 1011 010 81.3 250 4 00000011 16 1 11 2 2 1100 001 87.5 250 8 00000111 8 1 3 2 2 0100 001 75.0 250 8 00000111 8 1 5 1 1 0101 000 87.5 125 8 00000111 16 1 3 6 6 1000 101 62.5 125 8 00000111 16 1 7 4 4 1010 011 75.0 125 8 00000111 16 1 9 3 3 1011 010 81.3 125 8 00000111 16 1 11 2 2 1100 001 87.5 125 16 00001111 8 1 3 2 2 0100 001 75.0 125 16 00001111 8 1 5 1 1 0101 000 87.5 caution the values in table 21-24 do not guarantee th e operation of the network system. thoroughly check the effect on the network system, taking into consideration oscillation errors and delays of the can bus and can transceiver. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1223 table 21-24. representative e xamples of baud rate settings (f canmod = 16 mhz) (2/2) valid bit rate setting (unit: kbps) cnbtr register setting value set baud rate value (unit: kbps) division ratio of cnbrp register cnbrp register set value length of dbt sync segment prop segment phase segment1 phase segment2 tseg13 to tseg10 tseg22 to tseg20 sampling point (unit: %) 100 8 00000111 20 1 9 5 5 1101 100 75.0 100 8 00000111 20 1 11 4 4 1110 011 80.0 100 10 00001001 16 1 7 4 4 1010 011 75.0 100 10 00001001 16 1 9 3 3 1011 010 81.3 100 16 00001111 10 1 3 3 3 0101 010 70.0 100 16 00001111 10 1 5 2 2 0110 001 80.0 100 20 00010011 8 1 3 2 2 0100 001 75.0 83.3 8 00000111 24 1 7 8 8 1110 111 66.7 83.3 8 00000111 24 1 9 7 7 1111 110 70.8 83.3 12 00001011 16 1 7 4 4 1010 011 75.0 83.3 12 00001011 16 1 9 3 3 1011 010 81.3 83.3 12 00001011 16 1 11 2 2 1100 001 87.5 83.3 16 00001111 12 1 5 3 3 0111 010 75.0 83.3 16 00001111 12 1 7 2 2 1000 001 83.3 83.3 24 00010111 8 1 3 2 2 0100 001 75.0 83.3 24 00010111 8 1 5 1 1 0101 000 87.5 33.3 30 00011101 24 1 7 8 8 1110 111 66.7 33.3 30 00011101 24 1 9 7 7 1111 110 70.8 33.3 24 00010111 20 1 9 5 5 1101 100 75.0 33.3 24 00010111 20 1 11 4 4 1110 011 80.0 33.3 30 00011101 16 1 7 4 4 1010 011 75.0 33.3 30 00011101 16 1 9 3 3 1011 010 81.3 33.3 32 00011111 15 1 8 3 3 1010 010 80.0 33.3 32 00011111 15 1 10 2 2 1011 001 86.7 33.3 37 00100100 13 1 6 3 3 1000 010 76.9 33.3 37 00100100 13 1 8 2 2 1001 001 84.6 33.3 40 00100111 12 1 5 3 3 0111 010 75.0 33.3 40 00100111 12 1 7 2 2 1000 001 83.3 33.3 48 00101111 10 1 3 3 3 0101 010 70.0 33.3 48 00101111 10 1 5 2 2 0110 001 80.0 33.3 60 00111011 8 1 3 2 2 0100 001 75.0 33.3 60 00111011 8 1 5 1 1 0101 000 87.5 caution the values in table 21-24 do not guarantee th e operation of the network system. thoroughly check the effect on the network system, taking into consideration oscillation errors and delays of the can bus and can transceiver. remark n = 0, 1
chapter 21 can controller user?s manual u19201ej3v0ud 1224 21.16 operation of can controller the processing procedure shown below is recommended to operate the can controller. develop your program by referring to this recommended processing procedure. remark n = 0, 1 m = 00 to 31 figure 21-36. initialization start set cngmcs register. set cnbrp register, cnbtr register. set cnie register. set cnmask register. initialize message buffers. set cnctrl register (set opmode bit). end set cngmctrl register (set gom bit = 1) remark opmode: normal operation mode, normal operation mode with abt, receive-only mode, single- shot mode, self-test mode
chapter 21 can controller user?s manual u19201ej3v0ud 1225 figure 21-37. re-initialization start set cnbrp register, cnbtr register. set cnie register. set cnmask register. set cnctrl register. (set opmode bit) end clear opmode. init mode? no yes no cnerc and cninfo register clear? initialize message buffers. yes set ccerc bit. set ccerc bit = 1 caution after setting the can module to the initializ ation mode, avoid setting the module to another operation mode immediately after. if it is necessary to immediat ely set the module to another operation mode, be sure to access registers other than the cnctrl and cngmctrl registers (e.g., set a message buffer). remark opmode: normal operation mode, normal operation mode with abt, receive-only mode, single- shot mode, self-test mode
chapter 21 can controller user?s manual u19201ej3v0ud 1226 figure 21-38. message buffer initialization start set cnmconfm register. set cnmidhm register, cnmidlm register. set cnmdlcm register. clear cnmdatam register. set cnmctrlm register. end transmit message buffer? yes no clear rdy bit. set rdy bit = 0 clear rdy bit = 1 rdy bit = 1? rdy bit = 0? no yes yes set rdy bit. set rdy bit = 1 clear rdy bit = 0 no cautions 1. before a message buffer is in itialized, the rdy bit must be cleared. 2. make the following settings for message buffers not u sed by the application. ? clear the cnmctrlm.rdy, cnmctrlm .trq, and cnmctrlm.dn bits to 0. ? clear the cnmconfm.ma0 bit to 0.
chapter 21 can controller user?s manual u19201ej3v0ud 1227 figure 21-39 shows the processing for a receive mess age buffer (cnmconfm.mt2 to cnmconfm.mt0 bits = 001b to 101b). figure 21-39. message buffer redefinition start set message buffers end rdy = 1? no ye s clear rdy bit cnmctrlm.set_rdy = 0 cnmctrlm.clear_rdy = 1 rdy = 0? rstat = 0 or valid = 1? note no clear valid bit cnctrlclear_valid =1 set rdy bit cnmctrlm.set_rdy = 1 cnmctrlm.clear_rdy = 0 ye s ye s no wait for 4 can data bits start set message buffers. end rdy = 1? no ye s clear rdy bit. cnmctrlm.set_rdy = 0 cnmctrlm.clear_rdy = 1 rdy = 0? rstat = 0 or valid = 1? note 1 no clear valid bit. cnctrlclear_valid =1 set rdy bit. cnmctrlm.set_rdy = 1 cnmctrlm.clear_rdy = 0 ye s ye s no wait for a period of 4 can data bits note 2 . notes 1. if redefinition is performed during a message recept ion, confirm that a message is being received because the rdy bit must be set after a message is completely received. 2. this 4-bit period may redefine the message bu ffer while a message is received and stored.
chapter 21 can controller user?s manual u19201ej3v0ud 1228 figure 21-40 shows the processing for a transmit message buffer during transmission (mt2 to mt0 bits of cnmconfm register = 000b). figure 21-40. message buffer re definition during transmission start end rdy = 0? no ye s remote frame data frame transmit abort process clear rdy bit cnmctrlm.set_rdy = 0 cnmctrlm.clear_rdy = 1 transmit? = 1 ye s wait for 1can data bits no start end rdy bit = 0? no ye s data frame or remote frame? set rdy bit. set_rdy bit = 1 clear_rdy bit = 0 set cnmdataxm, cnmdlcm registers. clear rtr bit of cnmconfm register. set cnmidlm and cnmidhm registers. set cnmdlcm register. set rtr bit of cnmconfm register. set cnmidlm and cnmidhm registers. remote frame data frame transmit abort process clear rdy bit. set_rdy bit = 0 clear_rdy bit = 1 transmit? set trq bit. set_trq bit = 1 clear_trq bit = 0 ye s wait for a 1-bit period of can data. no
chapter 21 can controller user?s manual u19201ej3v0ud 1229 figure 21-41 shows the processing for a transmit message buffer (cnmconfm.mt2 to cnmconfm.mt0 bits = 000b). figure 21-41. message transmit processing start set trq bit. set trq bit = 1 clear trq bit = 0 end trq bit = 0? yes no clear rdy bit. set rdy bit = 0 clear rdy bit = 1 set rdy bit. set rdy bit = 1 clear rdy bit = 0 rdy bit = 0? yes no data frame or remote frame? remote frame data frame set rtr bit of cnmdlcm register and cnmconfm register. set cnmidlm and cnmidhm registers. set cnmdataxm, cnmdlcm registers. clear rtr bit of cnmconfm register. set cnmidlm and cnmidhm registers. cautions 1. the trq bit should be set after the rdy bit is set. 2. the rdy bit and trq bit should not be set at the same time.
chapter 21 can controller user?s manual u19201ej3v0ud 1230 figure 21-42 shows the processing for a transmit message buffer (cnmconfm.mt2 to cnmconfm.mt0 bits = 000b). figure 21-42. abt message transmit processing start end abttrg = 0? no ye s clear rdy bit cnmctrlm.set_rdy = 0 rdy = 0? set rdy bit ye s no set abttrg bit set all abt transmit messages? tstat = 0? ye s no ye s no start end abttrg bit = 0? no ye s clear rdy bit set_rdy bit = 0 clear_rdy bit = 1 rdy bit = 0? set rdy bit. ye s no set abttrg bit. set all abt transmit messages? tstat bit = 0? ye s no ye s no set_abttrg = 1 clear_abttrg = 0 set_rdy bit = 1 clear_rdy bit = 0 set cnmdataxm register. set cnmdlcm register. clear rtr bit of cnmconfm register. set cnmidlm and cnmidhm registers. caution the abttrg bit should be set to 1 after the tstat bit is cl eared to 0. the checking of the tstat bit and the setting for the abttrg bit to 1 must be continuous. remark this processing (message transmit processing wit h abs) can only be applied to message buffers 0 to 7. for message buffers other t han the abt message buffers, refer to figure 21-41 .
chapter 21 can controller user?s manual u19201ej3v0ud 1231 figure 21-43. transmission via in terrupt (using cnlopt register) start end transmit completion interrupt servicing read cnlopt register. clear rdy bit. set rdy bit = 0 clear rdy bit = 1 rdy bit = 0? no yes set rdy bit. set rdy bit = 1 clear rdy bit = 0 set trq bit. set trq bit = 1 clear trq bit = 0 data frame or remote frame? remote frame data frame set cnmdlcm register. set rtr bit of cnmconfm register. set cnmidlm and cnmidhm registers. set cnmdataxm, cnmdlcm registers. clear rtr bit of cnmconfm register. set cnmidlm and cnmidhm registers. cautions 1. the trq bit should be set after the rdy bit is set. 2. the rdy bit and trq bit should not be set at the same time. remark check the mbon bit at the start and end of the in terrupt routine to see if the message buffer and transmit history register can be accessed, because a can sleep mode transition request which has been held pending may be under execution. if t he mbon bit is cleared (0), stop the processing under execution. re-execute the processing afte r the mbon bit is set (1) again. it is therefore recommended to cancel the can sleep mode trans ition request before executing transmission interrupt servicing.
chapter 21 can controller user?s manual u19201ej3v0ud 1232 figure 21-44. transmission via in terrupt (using cntgpt register) start end clear rdy bit. set rdy bit = 0 clear rdy bit = 1 tovf bit = 1? clear tovf bit. clear tovf bit = 1 thpm bit = 1? yes no yes no transmit completion interrupt servicing set rdy bit. set rdy bit = 1 clear rdy bit = 0 set trq bit. set rdy bit = 1 clear rdy bit = 0 read cntgpt register. rdy bit = 0? yes no data frame or remote frame? remote frame data frame set cnmdlcm register. set rtr bit of cnmconfm register. set cnmidlm and cnmidhm registers. set cnmdataxm, cnmdlcm registers. clear rtr bit of cnmconfm register. set cnmidlm and cnmidhm registers. cautions 1. the trq bit should be set after the rdy bit is set. 2. the rdy bit and trq bit should not be set at the same time. remarks 1. check the mbon bit at the start and end of the in terrupt routine to see if the message buffer and transmit history register can be accessed, bec ause a can sleep mode transition request which has been held pending may be under execution. if the mbon bit is cleared (0), stop the processing under execution. re-execute the proce ssing after the mbon bit is set (1) again. it is therefore recommended to cancel the can sl eep mode transition request before executing transmission interrupt servicing. 2. if the tovf bit is set (1) again, the transmit hi story list contradicts. therefore, scan all the transmit message buffers that have completed transmission.
chapter 21 can controller user?s manual u19201ej3v0ud 1233 figure 21-45. transmi ssion via software polling start end read cntgpt register. cints0 bit = 1? tovf bit = 1? clear tovf bit. clear tovf bit = 1 thpm bit = 1? yes no yes no yes no clear cints0 bit. clear cints0 bit = 1 clear rdy bit. set rdy bit = 0 clear rdy bit = 1 set rdy bit. set rdy bit = 1 clear rdy bit = 0 set trq bit. set trq bit = 1 clear trq bit = 0 rdy bit = 0? no yes data frame or remote frame? set cnmdlcm register. set rtr bit of cnmconfm register. set cnmidlm and cnmidhm registers. set cnmdataxm, cnmdlcm registers. clear rtr bit of cnmconfm register. set cnmidlm and cnmidhm registers. remote frame data frame cautions 1. the trq bit should be set after the rdy bit is set. 2. the rdy bit and trq bit should not be set at the same time. remarks 1. check the mbon bit at the start and end of the polling routine to see if the message buffer and transmit history register can be accessed, bec ause a can sleep mode transition request which has been held pending may be under execution. if the mbon bit is cleared (0), stop the processing under execution. re-execute the pr ocessing after the mbon bit is set (1) again. 2. if the tovf bit is set (1) again, the transmit hi story list contradicts. therefore, scan all the transmit message buffers that have completed transmission.
chapter 21 can controller user?s manual u19201ej3v0ud 1234 figure 21-46. transmission abort processing (oth er than in normal operation mode with abt) start no yes end clear trq bit. set trq bit = 0 clear trq bit = 1 tstat bit = 0? no wait for a period of 11 can data bits note . yes read cnlopt register. message buffer to be aborted matches cnlopt register? transmission successful transmit abort request was successful. note during a period of a total of 11 bits, 3 bits of in terframe space and 8 bits of suspend transmission, the transmission request may have already been acknowle dged by the protocol layer. consequently, transmission may not be aborted but star ted even if the trq bit is cleared. cautions 1. execute transmissi on abort processing by clearing th e trq bit, not the rdy bit. 2. before making a sleep mode transition request, confirm th at there is no transmission request left using this processing. 3. the tstat bit can be period ically checked by a user app lication or can be checked after the transmit completion interrupt. 4. do not execute a new transmission request that includes other message buffers while transmission abort processing is in progress. 5. if data of the same message buffer are successively transmitted or if only one message buffer is used, judgments wh ether transmission has been successfully executed or failed may contradict. in such a case, make a judgm ent by using the histor y information of the cntgpt register.
chapter 21 can controller user?s manual u19201ej3v0ud 1235 figure 21-47. transmission abort pr ocessing except for abt transmission (normal operation mode with abt) start read cnlopt register end no ye s tstat = 0? message buffer to be aborted matches cnlopt register? no wait for 11 can data bits transmission successful transmit abort request was successful. ye s no abttrg = 0? = 0 ye s start read cnlopt register. end no ye s clear trq bit. set_trq bit = 0 clear_trq bit = 1 tstat bit = 0? message buffer to be aborted matches cnlopt register? no wait for a period of 11 can data bits. note ye s no abttrg bit = 0? clear abttrg bit. set_abttrg bit = 0 clear_abttrg bit = 1 ye s note during a period of a total of 11 bits, 3 bits of in terframe space and 8 bits of suspend transmission, the transmission request may have already been acknowledged by the protocol layer. consequently, transmission may not be aborted but star ted even if the trq bit is cleared. cautions 1. execute transmissi on abort processing by clearing th e trq bit, not the rdy bit. 2. before making a sleep mo de transition request, confirm th at there is no transmission request left using this processing. 3. the tstat bit can be periodically checked by a user application or can be checked after the transmit completion interrupt. 4. do not execute a new transmission request including in the other message buffers while transmission abort processing is in progress. 5. if data of the same message buffer are su ccessively transmitted or if only one message buffer is used, judgments whet her transmission has been su ccessfully executed or failed may contradict. in such a cas e, make a judgment by using th e history information of the cntgpt register.
chapter 21 can controller user?s manual u19201ej3v0ud 1236 figure 21-48 (a) shows processing that does not skip resu ming the transmission of a message that was interrupted when the transmission of an abt message buffer was aborted. figure 21-48 (a). abt transmission abort pr ocessing (normal operation mode with abt) end abttrg bit = 0? yes no start no yes clear abttrg bit. set abttrg bit = 0 clear abttrg bit = 1 set abtclr bit. set abtclr bit = 1. clear trq bit of message buffer whose transmission was aborted. transmit abort transmission start pointer clear? tstat bit = 0? yes no cautions 1. do not set any tr ansmission requests while abt tran smission abort processing is in progress. 2. make a can sleep mode/can stop mode tr ansition request after the abttrg bit is cleared (after abt mode is stopped) following the procedure shown in figure 21-48 (a) or (b). when clearing a transmi ssion request in an area other than the abt ar ea, follow the procedure shown in figure 21-47.
chapter 21 can controller user?s manual u19201ej3v0ud 1237 figure 21-48 (b) shows the processing that does not ski p resuming the transmission of a message that was interrupted when the transmission of an abt message buffer was aborted. figure 21-48 (b). abt transm ission abort processing (norma l operation mode with abt) end abttrg bit = 0? yes no start no yes clear abttrg bit. set abttrg bit = 0 clear abttrg bit = 1 set abtclr bit. set abtclr bit = 1 transmit abort transmission start pointer clear? clear trq bit of message buffer undergoing transmission. cautions 1. do not set any tr ansmission requests while abt tran smission abort processing is in progress. 2. make a can sleep mode/can stop mode tr ansition request after the abttrg bit is cleared (after abt mode is stopped) following the procedure shown in figure 21-48 (a) or (b). when clearing a transmi ssion request in an area other than the abt ar ea, follow the procedure shown in figure 21-47.
chapter 21 can controller user?s manual u19201ej3v0ud 1238 figure 21-49. reception via inte rrupt (using cnlipt register) start end read cnlipt register. dn bit = 0 and muc bit = 0 note yes no clear dn bit. clear dn bit = 1 clear cints1 bit. clear cints1 bit = 1 transmit abort read cnmdataxm, cnmdlcm, cnmidlm, and cnmidhm registers. note check the muc and dn bits using one read access. remark check the mbon bit at the start and end of the in terrupt routine to see if the message buffer and receive history register can be accessed, bec ause a can sleep mode transition request which has been held pending may be under execution. if t he mbon bit is cleared (0), stop the processing under execution. re-execute the processing afte r the mbon bit is set (1) again. it is therefore recommended to cancel the can sleep mode transit ion request before executing reception interrupt servicing.
chapter 21 can controller user?s manual u19201ej3v0ud 1239 figure 21-50. reception via inte rrupt (using cnrgpt register) end rovf bit = 1? yes no clear rovf bit. clear rovf bit = 1 rhpm bit = 1? yes start no clear dn bit. clear dn bit = 1 dn bit = 0 and muc bit = 0 note read cnmdataxm, cnmdlcm, cnmidlm, and cnmidhm registers. yes no receive completion interrupt read cnrgpt register. read normal data. read illegal data. note check the muc and dn bits using one read access. remarks 1. check the mbon bit at the start and end of the in terrupt routine to see if the message buffer and receive history register can be accessed, bec ause a can sleep mode transition request which has been held pending may be under execution. if the mbon bit is cleared (0), stop the processing under execution. re-execute the proce ssing after the mbon bit is set (1) again. it is therefore recommended to cancel the can sl eep mode transition request before executing reception interrupt servicing. 2. if the rovf bit has been once set (1), the receive hi story list contradicts. therefore, scan all the receive message buffers that have completed reception.
chapter 21 can controller user?s manual u19201ej3v0ud 1240 figure 21-51. reception via software polling start end read cnrgpt register yes no rovf bit = 1? yes no clear rovf bit. clear rovf bit = 1 clear dn bit. clear dn bit = 1 rhpm bit = 1? no yes cints1 bit = 1? no yes clear cints1 bit. clear cints1 bit = 1 read cnmdataxm, cnmdlcm, cnmidlm, and cnmidhm registers. dn bit = 0 and muc bit = 0 note read normal data. read illegal data. note check the muc and dn bits using one read access. remarks 1. check the mbon bit at the start and end of the polling routine to see if the message buffer and receive history register can be accessed, bec ause a can sleep mode transition request which has been held pending may be under execution. if the mbon bit is cleared (0), stop the processing under execution. re-execute the proc essing after the mbon bit is set (1) again. 2. if the rovf bit has been once set (1), the receive hi story list contradicts. therefore, scan all the receive message buffers that have completed reception.
chapter 21 can controller user?s manual u19201ej3v0ud 1241 figure 21-52. setting can sleep mode/stop mode start (when psmode[1:0] = 00b) psmode0 = 1? set psmode0 bit set_psmode1 = 1 clear_psmode1 = 0 can sleep mode can sleep mode end ye s no set psmode1 bit. set_psmode1 = 1 clear_psmode1 = 0 psmode1 = 1? can stop mode request can sleep mode again? set cnctrl register. (set opmode) ye s no ye s no access to registers other than the cnctrl and cngmctrl registers. init mode? ye s no clear cints5 bit. clear_cints5 = 1 clear opmode. caution to abort transmission befo re making a request for the can sleep mode, perform processing according to figur es 21-46 to 21-48.
chapter 21 can controller user?s manual u19201ej3v0ud 1242 figure 21-53. clear can sleep/stop mode start end clear psmode1 bit. set psmode1 bit = 0 clear psmode1 bit = 1 can stop mode can sleep mode after dominant edge detection, psmode0 bit = 0 cints5 bit = 1 clear cints5 bit. clear cints5 bit = 1 (when can clock is not supplied) can sleep mode release when can bus becomes active (when can clock is supplied note ) can sleep mode release when can bus becomes active clear cints5 bit. clear cints5 bit = 1 clear psmode0 bit. set psmode0 bit = 0 clear psmode0 bit = 1 clear psmode0 bit. set psmode0 bit = 0 clear psmode0 bit = 1 after dominant edge detection, psmode0 bit = 0/1 cints5 bit = 1 can sleep mode release by user note the state in which the can clock is supplied m eans the state in which t he can sleep mode is set without setting any of the following cpu standby modes. ? stop mode ? idle1 and idle2 modes ? the main clock has been stopped in subclock operation mode or sub-idle mode
chapter 21 can controller user?s manual u19201ej3v0ud 1243 figure 21-54. bus-off recovery (other than in normal operation mode with abt) start boff bit = 1? no yes set ccerc bit. set ccerc bit = 1 end no yes set cnctrl register. (clear opmode bit) access to register other than cnctrl and cngmctrl registers. forced recovery from bus off? set cnctrl register. (set opmode bit) set cnctrl register. (set opmode bit) wait for recovery from bus off. clear all trq bits note . note to initialize the message buffer by clearing the rdy bit before starting the bus-off recovery sequence, clear all the trq bits. caution if a request to change the mode from the initialization mode to an y operation mode is made to execute the bus-off recovery sequence agai n during a bus-off recovery sequence, the receive error counter (cnerc.rec0 to rec6 bits ) is cleared. it is therefore necessary to detect 11 contiguous recessive bi ts 128 times on the bus again. remark opmode: normal operation mode, normal operation mode with abt, receive-only mode, single- shot mode, self-test mode
chapter 21 can controller user?s manual u19201ej3v0ud 1244 figure 21-55. bus-off recovery (normal operation mode with abt) start no yes set ccerc bit. set ccerc bit = 1 end no yes access to register other than cnctrl and cngmctrl registers. set cnctrl register. (set opmode bit.) set cnctrl register. (set opmode.) clear all trq bit note boff bit = 1? set cnctrl register. (clear opmode bit.) clear abttrg bit. set abttrg bit = 0 clear abttrg bit = 1 forced recovery from bus off? wait for recovery from bus off. note to initialize the message buffer by clearing the rdy bit before starting the bus-off recovery sequence, clear all the trq bits. caution if a request to change the mode from the initialization mode to an y operation mode is made to execute the bus-off recovery sequence agai n during a bus-off recovery sequence, the receive error counter (cnerc.rec0 to rec6 bits ) is cleared. it is therefore necessary to detect 11 contiguous recessive bi ts 128 times on the bus again. remark opmode: normal operation mode, normal operation mode with abt, receive-only mode, single- shot mode, self-test mode
chapter 21 can controller user?s manual u19201ej3v0ud 1245 figure 21-56. normal shutdown process start clear gom bit. set gom bit = 0 clear gom bit = 1 shutdown successful gom bit = 0, efsd bit = 0 end init mode
chapter 21 can controller user?s manual u19201ej3v0ud 1246 figure 21-57. forced shutdown process start set efsd bit. set efsd bit = 1 clear gom bit. set gom bit = 0 clear gom bit = 1 shutdown successful gom bit = 0, efsd bit = 0 end must be a continuous write. gom bit = 0? yes no caution if access to another register is executed by software (interrupts including nmi) or dma immediately after the efsd bit has been set to 1 and before the gom bit is cleared to 0, setting the efsd bit is invalid and the gom bit is not cleared.
chapter 21 can controller user?s manual u19201ej3v0ud 1247 figure 21-58. error handling start cints2 bit = 1? cints3 bit = 1? cints4 bit = 1? clear cints2 bit. clear cints2 bit = 1 end yes no no yes no yes check can module state. (read cninfo register) check can protocol error state. (read cnlec register) clear cints3 bit. clear cints3 bit = 1 clear cints4 bit. clear cints4 bit = 1 error interrupt
chapter 21 can controller user?s manual u19201ej3v0ud 1248 figure 21-59. setting cpu standby (from can sleep mode) start set psmode0 bit. set psmode0 bit = 1 clear psmode0 bit = 0 yes no psmode0 bit = 1? can sleep mode set cpu standby mode. end clear cints5 bit. clear cints5 bit = 1 clear psmode0 bit. set psmode0 bit = 0 clear psmode0 bit = 1 yes no mbon bit = 0? yes no cints5 bit 1? note check if the cpu is in the can sleep mode befor e setting it to the standby mode. the can sleep mode may be released by wakeup after it is checked if the cpu is in the can sleep mode and before the cpu is set in the standby mode.
chapter 21 can controller user?s manual u19201ej3v0ud 1249 figure 21-60. setting cpu st andby (from can stop mode) start end set psmode0 bit. set psmode0 bit = 1 clear psmode0 bit = 0 psmode0 bit = 1? psmode1 bit = 1? no yes no set psmode1 bit. set psmode1 bit = 1 clear psmode1 bit = 0 clear psmode0 bit. set psmode0 bit = 0 clear psmode0 bit = 1 clear cints5 bit note clear cints5 bit = 1 yes mbon bit = 1? yes no can stop mode set cpu standby mode. can sleep mode note during wakeup interrupts caution the can stop mode can only be released by writing 01 to th e cnctrl.psmode1 and cnctrl.psmode0 bits. the can stop mode ca nnot be released by changing the can bus.
user?s manual u19201ej3v0ud 1250 chapter 22 dma function (dma controller) the v850e/sj3-h and v850e/sk3-h include a direct memory access (dma) controller (dmac) that executes and controls dma transfer. the dmac controls data transfer between memory and i/o, between memo ries, or between i/os based on dma requests issued by the on-chip peripheral i/o (serial inte rface, timer/counter, a/d conv erter, and key interrupt), interrupts from external input pins, or software triggers (memory refers to internal ram, external memory, or expanded internal ram). 22.1 features ? 4 independent dma channels ? transfer unit: 8/16 bits ? maximum transfer count: 65,536 (2 16 ) ? transfer type: two-cycle transfer ? transfer mode: single transfer mode ? transfer requests ? request by interrupts from on-chip peripheral i/o (ser ial interface, timer/counter, a/d converter, and key interrupt) or interrupts from external input pin ? requests by software trigger ? transfer targets ? internal ram ? peripheral i/o ? peripheral i/o ? peripheral i/o ? internal ram ? external memory ? external memory ? peripheral i/o ? external memory ? external memory ? expanded internal ram ? peripheral i/o ? expanded internal ram ? external memory
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1251 22.2 configuration cpu internal ram on-chip peripheral i/o on-chip peripheral i/o bus internal bus data control address control count control channel control dmac v850e/sj3-h, v850e/sk3-h bus interface external bus external ram external rom external i/o dma source address register n (dsanh/dsanl) dma transfer count register n (dbcn) dma channel control register n (dchcn) dma destination address register n (ddanh/ddanl) dma addressing control register n (dadcn) dma trigger factor register n (dtfrn) expanded internal ram remark n = 0 to 3
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1252 22.3 registers (1) dma source address registers 0 to 3 (dsa0 to dsa3) the dsa0 to dsa3 registers set the dma source addresse s (26 bits each) for dma channel n (n = 0 to 3). these registers are divided into two 16-bit registers, dsanh and dsanl. these registers can be read or written in 16-bit units. external memory, on-chip peripheral i/o, or expanded internal ram internal ram ir 0 1 specification of dma transfer source set the address (a25 to a16) of the dma transfer source (default value is undefined). during dma transfer, the next dma transfer source address is held. when dma transfer is completed, the dma address set first is held. sa25 to sa16 set the address (a15 to a0) of the dma transfer source (default value is undefined). during dma transfer, the next dma transfer source address is held. when dma transfer is completed, the dma address set first is held. sa15 to sa0 after reset: undefined r/w address: dsa0h fffff082h, dsa1h fffff08ah, dsa2h fffff092h, dsa3h fffff09ah, dsa0l fffff080h, dsa1l fffff088h, dsa2l fffff090h, dsa3l fffff098h dsanl (n = 0 to 3) sa15 sa14 sa13 sa12 sa6 sa5 sa4 sa3 sa2 sa1 sa0 sa7 sa8 sa9 sa10 sa11 dsanh (n = 0 to 3) ir 000 sa22 sa21 sa20 sa19 sa18 sa17 sa16 sa23 sa24 sa25 0 0 cautions 1. be sure to clear bits 14 to 10 of the dsanh register to 0. 2. set the dsanh and dsanl registers at the following timing when dma transfer is disabled (dchcn.enn bit = 0). ? period from after reset to start of first dma transfer ? period from after channel initialization by dchcn.initn bit to start of dma transfer ? period from after completion of dma transfer (dchcn.tcn bit = 1) to start of the next dma transfer 3. when the value of the dsan register is read, two 16-bit re gisters, dsanh and dsanl, are read. if reading and updating conflict, the value being updated may be read (see 22.13 cautions). 4. following reset, set the dsanh, dsanl, ddanh, ddanl, and dbcn registers before starting dma transfer. if these registers are not set, the operation when dma transfer is started is not guaranteed.
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1253 (2) dma destination address regi sters 0 to 3 (dda0 to dda3) the dda0 to dda3 registers set the dma destination addre ss (26 bits each) for dma channel n (n = 0 to 3). these registers are divided into two 16-bit registers, ddanh and ddanl. these registers can be read or written in 16-bit units. external memory, on-chip peripheral i/o, or expanded internal ram internal ram ir 0 1 specification of dma transfer destination set an address (a25 to a16) of dma transfer destination (default value is undefined). during dma transfer, the next dma transfer destination address is held. when dma transfer is completed, the dma transfer source address set first is held. da25 to da16 set an address (a15 to a0) of dma transfer destination (default value is undefined). during dma transfer, the next dma transfer destination address is held. when dma transfer is completed, the dma transfer source address set first is held. da15 to da0 after reset: undefined r/w address: dda0h fffff086h, dda1h fffff08eh, dda2h fffff096h, dda3h fffff09eh, dda0l fffff084h, dda1l fffff08ch, dda2l fffff094h, dda3l fffff09ch ddanl (n = 0 to 3) da15 da14 da13 da12 da6 da5 da4 da3 da2 da1 da0 da7 da8 da9 da10 da11 ddanh (n = 0 to 3) ir 000 da22 da21 da20 da19 da18 da17 da16 da23 da24 da25 0 0 cautions 1. be sure to clear bits 14 to 10 of the ddanh register to 0. 2. set the ddanh and ddanl registers at the following timing when dma transfer is disabled (dchcn.enn bit = 0). ? period from after reset to start of first dma transfer ? period from after channel initialization by dchcn.initn bit to start of dma transfer ? period from after completion of dma transfer (dchcn.tcn bit = 1) to start of the next dma transfer 3. when the value of the ddan register is read, two 16-bit registers, ddanh and ddanl, are read. if reading and updating conflict, a value being updated may be read (see 22.13 cautions). 4. following reset, set the dsanh, dsanl, ddanh, ddanl, and dbcn registers before starting dma transfer. if these registers are not set, the operation when dma transfer is started is not guaranteed.
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1254 (3) dma transfer count regi sters 0 to 3 (dbc0 to dbc3) the dbc0 to dbc3 registers are 16-bit registers that se t the transfer count for dma channel n (n = 0 to 3). these registers hold the remaining tr ansfer count during dma transfer. these registers are decremented by 1 per one transfer regardless of the trans fer data unit (8/16 bits), and the transfer is terminated if a borrow occurs. these registers can be read or written in 16-bit units. transfer count 1 or remaining transfer count transfer count 2 or remaining transfer count : transfer count 65,536 (2 16 ) or remaining transfer count bc15 to bc0 0000h 0001h : ffffh transfer count setting or remaining transfer count during dma transfer after reset: undefined r/w address: dbc0 fffff0c0h, dbc1 fffff0c2h, dbc2 fffff0c4h, dbc3 fffff0c6h dbcn (n = 0 to 3) 15 bc15 14 bc14 13 bc13 12 bc12 11 bc11 10 bc10 9 bc9 8 bc8 7 bc7 6 bc6 5 bc5 4 bc4 3 bc3 2 bc2 1 bc1 0 bc0 the number of transfer data set first is held when dma transfer is complete. cautions 1. set the dbcn register at the following timing when dma transfer is disabled (dchcn.enn bit = 0). ? period from after reset to start of first dma transfer ? period from after channel initialization by dchcn.initn bit to start of dma transfer ? period from after completion of dma transfer (dchcn.tcn bit = 1) to start of the next dma transfer 2. following reset, set the dsanh, dsanl, ddanh, ddanl, and dbcn registers before starting dma transfer. if these registers are not set, the operation when dma transfer is started is not guaranteed.
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1255 (4) dma addressing control registers 0 to 3 (dadc0 to dadc3) the dadc0 to dadc3 registers are 16-bit registers that control the dma transfer mode for dma channel n (n = 0 to 3). these registers can be read or written in 16-bit units. reset sets these registers to 0000h. dadcn (n = 0 to 3) 8 bits 16 bits ds0 0 1 setting of transfer data size increment decrement fixed setting prohibited sad1 0 0 1 1 sad0 0 1 0 1 setting of count direction of the transfer source address increment decrement fixed setting prohibited dad1 0 0 1 1 dad0 0 1 0 1 setting of count direction of the destination address after reset: 0000h r/w address: dadc0 fffff0d0h, dadc1 fffff0d2h, dadc2 fffff0d4h, dadc3 fffff0d6h sad1 sad0 dad1 dad0 0 0 0 0 0ds000 00 0 0 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 cautions 1. be sure to clear bits 15, 13 to 8, and 3 to 0 of the dadcn register to 0. 2. set the dadcn register at the following ti ming when dma transfer is disabled (dchcn.enn bit = 0). ? period from after reset to start of first dma transfer ? period from after channel initialization by dchcn.initn bit to start of dma transfer ? period from after completion of dma transfer (dchcn.tcn bit = 1) to start of the next dma transfer 3. the ds0 bit specifies the size of the transfer data, and does not control bus sizing. if 8-bit data (ds0 bit = 0) is set, therefore, the lower data bus is not always used. 4. if the transfer data size is set to 16 bits (ds0 bit = 1), transfer cannot be started from an odd address. transfer is always started from an address with the first bit of the lower address aligned to 0. 5. if dma transfer is executed on an on-chip pe ripheral i/o register (as the transfer source or destination), be sure to specify the same transfer size as the re gister size. for example, to execute dma transfer on an 8-bit register , be sure to specify 8-bit transfer.
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1256 (5) dma channel control registers 0 to 3 (dchc0 to dchc3) the dchc0 to dchc3 registers are 8-bit registers t hat control the dma transfer operating mode for dma channel n. these registers can be read or written in 8-bit or 1-bit units. (however, bit 7 is read-only and bits 1 and 2 are write-only. if bit 1 or 2 is read, the read value is always 0.) reset sets these registers to 00h. dchcn (n = 0 to 3) dma transfer had not completed. dma transfer had completed. it is set to 1 on the last dma transfer and cleared to 0 when it is read. tcn note 1 0 1 status flag indicates whether dma transfer through dma channel n has completed or not dma transfer disabled dma transfer enabled dma transfer is enabled when the enn bit is set to 1. when dma transfer is completed (when a terminal count is generated), this bit is automatically cleared to 0. to abort dma transfer, clear the enn bit to 0 by software. to resume, set the enn bit to 1 again. when stopping dma transfer (forcibly terminating, reexecuting, aborting or resuming), however, be sure to observe the procedure described in 22.13 cautions . enn 0 1 setting of whether dma transfer through dma channel n is to be enabled or disabled this is a software startup trigger of dma transfer. if this bit is set to 1 in the dma transfer enable state (tcn bit = 0, enn bit = 1), dma transfer is started. stgn note 2 after reset: 00h r/w address: dchc0 fffff0e0h, dchc1 fffff0e2h, dchc2 fffff0e4h, dchc3 fffff0e6h tcn note 1 0 0 0 0 initn note 2 stgn note 2 enn <0> <1> <2> 3 4 5 6 <7> initn note 2 if the initn bit is set to 1 with dma transfer disabled (enn bit = 0), the dma transfer status can be initialized. when re-setting the dma transfer status (re-setting the ddanh, ddanl, dsanh, dsanl, dbcn, and dadcn registers) before dma transfer is completed (before the tcn bit is set to 1), be sure to initialize the dma channel. when initializing the dma controller, however, be sure to observe the procedure described in 22.13 cautions . notes 1. the tcn bit is read-only. 2. the initn and stgn bits are write-only. cautions 1. be sure to clear bits 6 to 3 of the dchcn register to 0. 2. when dma transfer is completed (when a terminal count is generated), the enn bit is cleared to 0 and then the tcn bit is set to 1. if the dchcn regist er is read while its bits are being updated, a value indicating ?transfer not co mpleted and transfer is disabled? (tcn bit = 0 and enn bit = 0) may be read.
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1257 (6) dma trigger factor registers 0 to 3 (dtfr0 to dtfr3) the dtfr0 to dtfr3 registers are 8-bit registers that control the dma transfer start trigger via interrupt request signals from on-chip peripheral i/o. the interrupt request signals set by these re gisters serve as dma transfer start factors. these registers can be read or written in 8-bit units. however, dfn bit can be read or written in 1-bit units. reset sets these registers to 00h. (1/2) dtfrn (n = 0 to 3) no dma transfer request dma transfer request dfn note 0 1 dma transfer request status flag after reset: 00h r/w address: dtfr0 fffff810h, dtfr1 fffff812h, dtfr2 fffff814h, dtfr3 fffff816h dfn 0 ifcn5 ifcn4 ifcn3 ifcn2 ifcn1 ifcn0 0 1 2 3 4 5 6 <7> note do not set the dfn bit to 1 by software. write 0 to this bit to clear a dma transfer request if an interrupt that is specified as the cause of starting dma transfer occurs while dma transfer is disabled. cautions 1. set the ifcn5 to if cn0 bits at the following timing when dma transfer is disabled (dchcn.enn bit = 0). ? period from after reset to start of first dma transfer ? period from after channel initialization by dchcn.initn bit to start of dma transfer ? period from after completion of dma transfer (dchcn.tcn bit = 1) to start of the next dma transfer
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1258 (2/2) cautions 2. be sure to follow the steps be low when changing the dtfrn register settings. ? when the values to be set to bits ifcn5 to ifcn0 are not set to bits ifcm5 to ifcm0 of another channel (n = 0 to 3, m = 0 to 3, n m) <1> stop the dman operation of the ch annel to be rewritten (dchcn.enn bit = 0). <2> change the dtfrn register settings. (be sure to set dfn bit = 0 and change the settings in the 8-bit manipulation.) <3> confirm that dfn bit = 0. (st op the interrupt generation source operation beforehand.) <4> enable the dman operation (enn bit = 1). ? when the values to be set to bits ifcn5 to ifcn0 are set to bits ifcm5 to ifcm0 of another channel (n = 0 to 3, m = 0 to 3, n m) <1> stop the dman operation of the ch annel to be rewritten (dchcn.enn bit = 0). <2> stop the dmam operation of the chan nel where the same values are set to bits ifcm5 to ifcm0 as the values to be used to rewrite bits ifcn5 to ifcn0 (dchcm.emm bit = 0). <3> change the dtfrn register settings. (be sure to set dfn bit = 0 and change the settings in the 8-bit manipulation.) <4> confirm that bits dfn and dfm = 0. (stop the interrupt generation source operation beforehand.) <5> enable the dman operation (bits enn and emm = 1). 3. an interrupt request that is generated in the standby mode (idel1, idle2, stop, or sub- idle mode) does not start the dma transfer cycle (nor is the dfn bit set to 1). 4. if a dma start factor is selected by the ifcn 5 to ifcn0 bits, the dfn bi t is set to 1 when an interrupt occurs from the selected on-chip pe ripheral i/o, regardless of whether the dma transfer is enabled or disable d. if dma is enabled in this status, dma transfer is immediately started. 5. in the v850e/sk3-h, when using uarta1 and i 2 c02 at the same time, and using the intua1r signal as the dma transfer start factor, set the dtfrob1 bit of option byte 0000007ah (refer to chapter 33 option byte function) to 1. in this case, the intiic2 signal cannot be used as the dma transfer start factor. 6. in the v850e/sk3-h, when using uarta2 and i 2 c00 at the same time, and using the intua2r signal as the dma transfer start factor, set the dtfrob1 bit of option byte 0000007ah (refer to chapter 33 option byte function) to 1. in this case, the intiic0 signal cannot be used as the dma transfer start factor. remark for the ifcn5 to ifcn0 bits, see table 22-1 dma transfer start factors .
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1259 table 22-1. dma transfer start factors (1/2) dtfr register option byte 0000007ah note ifcn5 ifcn4 ifcn3 ifcn2 ifcn1 ifcn0 dtfrob1 dtfrob0 interrupt source 0 0 0 0 0 0 x x dma request by interrupt disabled 0 0 0 0 0 1 x x intp0 0 0 0 0 1 0 x x intp1 0 0 0 0 1 1 x x intp2 0 0 0 1 0 0 x x intp3 0 0 0 1 0 1 x x intp4 0 0 0 1 1 0 x x intp5 0 0 0 1 1 1 x x intp6 0 0 1 0 0 0 x x intp7 0 inttq0ov 0 0 1 0 0 1 x 1 ntub0tir 0 0 1 0 1 0 x x inttq0cc0 0 0 1 0 1 1 x x inttq0cc1 0 0 1 1 0 0 x x inttq0cc2 0 0 1 1 0 1 x x inttq0cc3 0 inttp0ov 0 0 1 1 1 0 x 1 intub0tit 0 0 1 1 1 1 x x inttp0cc0 0 1 0 0 0 0 x x inttp0cc1 0 inttp1ov 0 1 0 0 0 1 x 1 intub1tir 0 1 0 0 1 0 x x inttp1cc0 0 1 0 0 1 1 x x inttp1cc1 0 inttp2ov 0 1 0 1 0 0 x 1 intub1tit 0 1 0 1 0 1 x x inttp2cc0 0 1 0 1 1 0 x x inttp2cc1 0 1 0 1 1 1 x x inttp3cc0 0 1 1 0 0 0 x x inttp3cc1 0 1 1 0 0 1 x x inttp4cc0 0 1 1 0 1 0 x x inttp4cc1 0 1 1 0 1 1 x x inttp5cc0 0 1 1 1 0 0 x x inttp5cc1 0 1 1 1 0 1 x x inttm0eq0 0 1 1 1 1 0 x x intcb0r/intiic1 0 1 1 1 1 1 x x intcb0t 1 0 0 0 0 0 x x intcb1r 1 0 0 0 0 1 x x intcb1t 1 0 0 0 1 0 x x intcb2r 1 0 0 0 1 1 x x intcb2t 1 0 0 1 0 0 x x intcb3r 1 0 0 1 0 1 x x intcb3t 1 0 0 1 1 0 x x intua0r/intcb4r 1 0 0 1 1 1 x x intua0t/intcb4t note for details, refer to chapter 33 option byte function . remark n = 0 to 3
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1260 table 22-1. dma transfer start factors (2/2) dtfr register option byte 0000007ah note 1 ifcn5 ifcn4 ifcn3 ifcn2 ifcn1 ifcn0 dtfrob1 dtfrob0 interrupt source 0 intua1r/intiic2 1 0 1 0 0 0 1 x intua1r 1 0 1 0 0 1 x x intua1t 0 intua2r/intiic0 1 0 1 0 1 0 1 x intua2r 1 0 1 0 1 1 x x intua2t 1 0 1 1 0 0 x x intad 0 intkr 1 0 1 1 0 1 x 1 inttm1eq0 0 interr 1 0 1 1 1 0 x 1 intce0t note 2 0 intsta 1 0 1 1 1 1 x 1 intce1t note 2 1 1 0 0 0 0 x x intie1 0 intp8 1 1 0 0 0 1 x 1 inttm2eq0 1 1 0 0 1 0 x x inttp6cc0 1 1 0 0 1 1 x x inttp6cc1 1 1 0 1 0 0 x x inttp7cc0 1 1 0 1 0 1 x x inttp7cc1 1 1 0 1 1 0 x x inttp8cc0 1 1 0 1 1 1 x x inttp8cc1 1 1 1 0 0 0 x x intcb5r 1 1 1 0 0 1 x x intcb5t 1 1 1 0 1 0 x x intua3r 1 1 1 0 1 1 x x intua3t 1 1 1 1 0 0 x x intua4r 1 1 1 1 0 1 x x intua4t 1 1 1 1 1 0 x x intua5r 1 1 1 1 1 1 x x intua5t notes 1. for details, refer to chapter 33 option byte function . 2. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) remark n = 0 to 3
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1261 22.4 transfer targets table 22-2 shows the relationship between the transfer targets ( : transfer enabled, : transfer disabled). table 22-2. relationship between transfer targets transfer destination internal rom on-chip peripheral i/o internal ram external memory expanded internal ram on-chip peripheral i/o internal ram external memory expanded internal ram source internal rom caution the operation is not guaranteed for combinat ions of transfer destination and source marked with ? ? in table 22-2. 22.5 transfer modes single transfer is supported as the transfer mode. in single transfer mode, the bus is released at each byte/hal fword transfer. if there is a subsequent dma transfer request, transfer is performed again once. this operation continues until a terminal count occurs. when the dmac has released the bus, if another higher priority dma transfer request is issued, the higher priority dma request always takes precedence. if a new transfer request of the same channel and a transfer request of another channel with a lower priority are generated in a transfer cycle, dma transfer of the channel with the lower priority is executed after the bus is released to the cpu (the new transfer request of the same channel is ignored in the transfer cycle).
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1262 22.6 transfer types as a transfer type, the 2-cycle transfer is supported. in two-cycle transfer, data transfer is performed in two cycles, a read cycle and a write cycle. in the read cycle, the transfer source address is output and reading is performed from the source to the dmac. in the write cycle, the transfer destination addr ess is output and writing is performed from the dmac to the destination. an idle cycle of one clock is always inserted between a read cycle and a write cycle. if the data bus width differs between the transfer source and destination for dma transfe r of two cycles, the operation is performed as follows. <16-bit data transfer> <1> transfer from 32-bit bus 16-bit bus a read cycle (the higher 16 bits are in a high-impedan ce state) is generated, followed by generation of a write cycle (16 bits). <2> transfer from 16-/32-bit bus to 8-bit bus a 16-bit read cycle is generated once, and then an 8-bit write cycle is generated twice. <3> transfer from 8-bit bus to 16-/32-bit bus an 8-bit read cycle is generated twice, and then a 16-bit write cycle is generated once. <4> transfer between 16-bit bus and 32-bit bus a 16-bit read cycle is generated once, and then a 16-bit write cycle is generated once. for dma transfer executed to an on-chip peripheral i/o register (transfer source /destination), be sure to specify the same transfer size as the register size. for example, for dma transfer to an 8-bit register, be sure to specify byte (8- bit) transfer. remark the bus width of each transfer target (tr ansfer source/destination) is as follows. ? on-chip peripheral i/o: 16-bit bus width ? internal ram: 32-bit bus width ? external memory: 8-bit or 16-bit bus width ? expanded internal ram: 32-bit bus width
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1263 22.7 dma channel priorities the dma channel priorities are fixed as follows. dma channel 0 > dma channel 1 > dma channel 2 > dma channel 3 the priorities are checked for every transfer cycle. caution if two or more dma channels are starte d with the same factor, a dma channel with a lower priority may be acknowledged earlier than a dma channel with a higher priority. 22.8 time related to dma transfer the time required to respond to a dma request, and the minimum number of clocks required for dma transfer are shown below. single transfer: dma response time (<1>) + transfer source memory access (<2>) + 1 note 1 + transfer destination memory access (<2>) dma cycle minimum number of execution clocks <1> dma request response time 4 clocks (min.) + noise elimination time note 2 external memory access depends on connected memory. internal ram access 2 clocks note 3 peripheral i/o register access 3 clocks + number of wait cycles specified by vswc register note 4 <2> memory access expanded internal ram 3 + n clocks note 5 notes 1. one clock is always inserted between a read cycle and a write cycle in dma transfer. 2. if an external interrupt (intpn) is specified as the tr igger to start dma transfer, noise elimination time is added (n = 0 to 9). 3. two clocks are required for a dma cycle. 4. more wait cycles are necessary for accessing a specific peripheral i/o register (for details, see 3.4.9 (2) ). 5. before using the expanded internal ram, be sure to execute the initial setting of the expanded internal ram. for details of the expanded internal ram, see 3.4.4 (6) (b) initial settings for expanded internal ram ). remark n: number of wait cycles inserted by wait pin
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1264 22.9 dma transfer start factors there are two types of dma transfe r start factors, as shown below. (1) request by software if the stgn bit is set to 1 while the dchcn.tcn bit = 0 and enn bit = 1 (dma transfer enabled), dma transfer is started. to request the next dma transfer cycle immediately after that, confirm, by using th e dbcn register, that the preceding dma transfer cycle has been completed, and set the stgn bit to 1 again (n = 0 to 3). tcn bit = 0, enn bit = 1 stgn bit = 1 ? starts the first dma transfer. confirm that the contents of the dbcn register have been updated. stgn bit = 1 ? starts the second dma transfer. : generation of terminal count ? enn bit = 0, tc n bit = 1, and intdman signal is generated. (2) request by on-chip peripheral i/o if an interrupt request is generated from the on-chip peripheral i/o set by the dtfrn register when the dchcn.tcn bit = 0 and enn bit = 1 (dma transf er enabled), dma transfer is started. cautions 1. two start factors (software trigger a nd hardware trigger) cannot be used for one dma channel. if two start factors are simultane ously generated for one dma channel, only one of them is valid. the start factor that is valid cannot be identified. 2. a new transfer request that is generate d after the preceding dma transfer request was generated or in the preceding dma tran sfer cycle is ignored (cleared). 3. the transfer request inte rval of the same dma channel varies depending on the setting of bus wait in the dma transfer cycle, the start status of the other channels, or the external bus hold request. in particular, as described in caution 2, a new transfer request that is generated for the same channel before the dma transfer cycle or during the dma transfer cycle is ignored. therefore, the transfer re quest intervals for the same dma channel must be sufficiently separated by th e system. when the software tr igger is used, completion of the dma transfer cycle that was generated before can be checked by updating the dbcn register.
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1265 22.10 dma abort factors dma transfer is aborted if a bus hold occurs. the same applies if transfer is ex ecuted between the intern al memory/on-chip peripheral i/o and internal memory/on-chip peripheral i/o. when the bus hold is cleared, dma transfer is resumed. 22.11 end of dma transfer when dma transfer has been completed the number of ti mes set to the dbcn register and when the dchcn.enn bit is cleared to 0 and tcn bit is set to 1, a dma transfer end interrupt request signal (intdman) is generated for the interrupt controller (intc) (n = 0 to 3). the v850e/sj3-h and v850e/sk3-h do not output a terminal count signal to an external device. therefore, confirm completion of dma transfer by using the dma transfer end interrupt or polling the tcn bit. 22.12 operation timing figures 22-1 to 22-4 show dma operation timing.
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1266 figure 22-1. priority of dma (1) preparation for transfer read write idle end processing dma2 processing cpu processing dma1 processing cpu processing cpu processing dma0 processing dma0 transfer request system clock dma1 transfer request dma2 transfer request dma transfer mode of processing df0 bit df1 bit df2 bit preparation for transfer read write idle end processing preparation for transfer read remarks 1. transfer in the order of dma0 dma1 dma2 2. in the case of transfer between external memory spaces (multiplexed bus, no wait)
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1267 figure 22-2. priority of dma (2) preparation for transfer read write idle dma0 transfer request system clock dma1 transfer request dma2 transfer request dma transfer mode of processing df0 bit df1 bit df2 bit cpu processing dma0 processing cpu processing dma1 processing cpu processing dma0 processing read write idle end processing read preparation for transfer preparation for transfer end processing remarks 1. transfer in the order of dma0 dma1 dma0 (dma2 is held pending.) 2. in the case of transfer between external memory spaces (multiplexed bus, no wait)
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1268 figure 22-3. period in which dma transfer request is ignored (1) preparation for transfer read cycle write cycle idle end processing dma transfer mode of processing dfn bit system clock transfer request generated after this can be acknowledged dma0 processing cpu processing cpu processing note 2 note 2 dman transfer request note 1 note 2 notes 1. interrupt from on-chip peripheral i/o , or software trigger (stgn bit) 2. new dma request of the same channel is ignor ed between when the first request is generated and the end processing is complete. remark in the case of transfer between external memory spaces (multiplexed bus, no wait)
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1269 figure 22-4. period in which dma transfer request is ignored (2) preparation for transfer read write idle end processing write end processing preparation for transfer read idle <1> <2> <3> <4> cpu processing dma0 processing cpu processing dma1 processing cpu processing preparation for transfer read dma0 transfer request system clock dma1 transfer request dma2 transfer request dma transfer mode of processing df0 bit df1 bit df2 bit dma0 processing <1> dma0 transfer request <2> new dma0 transfer request is generated during dma0 transfer. a dma transfer request of the same channel is ignored during dma transfer. <3> requests for dma0 and dma1 are generated at the same time. dma0 request is ignored (a dma transfer request of the same channel during transfer is ignored). dma1 request is acknowledged. <4> requests for dma0, dma1, and dma2 are generated at the same time. dma1 request is ignored (a dma transfer request of the same channel during transfer is ignored). dma0 request is acknowledged according to priority. dma2 request is held pending (transfer of dma2 occurs next).
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1270 22.13 cautions (1) caution for vswc register when using the dmac, be sure to set an appropriate val ue, in accordance with the operating frequency, to the vswc register. when the default value (77h) of the vsw c register is used, or if an inappr opriate value is set to the vswc register, the operation is not correctly perfo rmed (for details of the vswc register, see 3.4.9 (1) (a) system wait control register (vswc) ). (2) caution for dma transfer executed on internal ram when executing the following instructions located in th e internal ram, do not ex ecute a dma transfer that transfers data to/from the internal ram (transfer source/destination), because the cpu may not operate correctly afterward. ? bit manipulation instruction located in internal ram (set1, clr1, or not1) ? data access instruction to misaligned address located in internal ram conversely, when executing a dma transfer to tran sfer data to/from the in ternal ram (transfer source/destination), do not execut e the above two instructions. (3) caution for reading dchcn .tcn bit (n = 0 to 3) when performing a dma transfer from the internal ram, if t he tcn bit is read by the interrupt servicing routine, either of the following conditions must be satisfied. ? when the tcn bit is read at the start of the interrup t servicing routine, perform the read operation twice consecutively. ? execute at least one instruction at the start of the interrupt servici ng routine to access (read/write) the internal ram, on-chip peripheral i/o register area, pr ogrammable peripheral i/o register area, or external memory area before reading the tcn bit.
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1271 (4) procedure of stopping dma transfer (clearing enn bit) forcibly clearing the enn bit to 0 during dma transfer c an stop the dma transfer under execution. to stop the dma transfer, however, be sure to exec ute either of the following two procedur es. if the enn bit is cleared to 0 by using a different procedure, the operation is not guaranteed. (a) cancel the all dma transfers under execution, an d retry the dma transfer from the first step. <1> suppress a transfer request from the dma requ est source (stop the operation of the on-chip peripheral i/o). <2> check that the dma transfer request is not held pe nding, by using the dfn bit (check if the dfn bit = 0). if the request is held pending, clear the dfn bit to 0. <3> if it has been confirmed that no dma transfer req uest is held pending, clear the enn bit to 0 (this operation stops dma transfer). <4> set the initn bit to 1 (this operation in itializes the status of dma transfer). (b) stop the dma transfer under execution, and resume. <1> suppress a transfer request from the dma requ est source (stop the operation of the on-chip peripheral i/o). <2> check that the dma transfer request is not held pe nding, by using the dfn bit (check if the dfn bit = 0). if the request is held pending, wait until execution of the pending dma transfer request is completed. <3> if it has been confirmed that no dma transfer req uest is held pending, clear the enn bit to 0 (this operation stops dma transfer). <4> set the enn bit to 1 to resume dma transfer. <5> resume the operation of the dma request source that has been stopped (sta rt the operation of the on-chip peripheral i/o). (5) memory boundary the operation is not guaranteed if th e address of the transfer source or destination exceeds the area of the dma target (external memory, internal ram, on-chip peripheral i/o, or expanded internal ram) during dma transfer. (6) transferring misaligned data dma transfer of misaligned data with a 16-bit bus width is not supported. if an odd address is specified as the trans fer source or destination, the leas t significant bit of the address is forcibly assumed to be 0. (7) bus arbitration for cpu because the dma controller has a higher priority bus ma stership than the cpu, a cpu access that takes place during dma transfer is held pending unt il the dma transfer cycle is complete d and the bus is released to the cpu. however, the cpu can access the internal rom and internal ram for which dma transfer is not being executed. ? the cpu can access the internal rom and internal ram when dma transfer is being executed between the external memory and on-chip peripheral i/o, and the expanded internal ram and internal peripheral i/o. ? the cpu can access the internal rom when dma trans fer is being executed between the on-chip peripheral i/o and internal ram.
chapter 22 dma function (dma controller) user?s manual u19201ej3v0ud 1272 ? the cpu can access the internal rom and internal ram when dma transfer is being executed between on- chip peripheral i/os. (8) registers/bits that must not be rewritten during dma operation set the following registers at the following ti ming when a dma operation is not under execution. [registers] ? dsanh, dsanl, ddanh, ddanl, dbcn, and dadcn registers ? dtfrn.ifcn5 to dtfrn.ifcn0 bits [timing of setting] ? period from after reset to start of the first dma transfer ? time after channel initializ ation to start of dma transfer ? period from after completion of dma transfer (tcn bit = 1) to start of the next dma transfer (9) be sure to set the following register bits to 0. ? bits 14 to 10 of dsanh register ? bits 14 to 10 of ddanh register ? bits 15, 13 to 8, and 3 to 0 of dadcn register ? bits 6 to 3 of dchcn register (10) dma start factor care must be exercised when setting the same start trigger for multiple dma channels. if dma transfers via such dma channels are activat ed, the dma channel with a lower priority may be acknowledged prior to the dma channel with a higher priority. (11) read values of dsan and ddan registers values in the middle of updating may be read from t he dsan and ddan registers during dma transfer (n = 0 to 3). for example, if the dsanh regist er and then the dsanl register ar e read when the dma transfer source address (dsan register) is 0000ffffh and the count direction is incremental (dadcn.sad1 and dadcn.sad0 bits = 00), the value of the dsan regist er differs as follows, depending on whether dma transfer is executed immediately after the dsanh register is read. (a) if dma transfer does not occu r while dsan register is read <1> read value of dsanh register: dsanh = 0000h <2> read value of dsanl register: dsanl = ffffh (b) if dma transfer occurs while dsan register is read <1> read value of dsanh register: dsanh = 0000h <2> occurrence of dma transfer <3> incrementing dsan register: dsan = 00010000h <4> read value of dsanl register: dsanl = 0000h
user?s manual u19201ej3v0ud 1273 chapter 23 crc function 23.1 functions ? crc operation circuit for detection of data block errors ? generation of 16-bit crc code using a crc-ccitt (x 16 + x 12 + x 5 + 1) generation polynomial for blocks of data of any length in 8-bit units ? crc code is set to the crc data register each time 1-by te data is transferred to the crcin register, after the initial value is set to the crcd register. 23.2 configuration the crc function includes the following hardware. table 23-1. crc configuration item configuration control registers crc input register (crcin) crc data register (crcd) figure 23-1. block diagram of crc register crc data register (crcd) (16 bits) crc input register (crcin) (8 bits) internal bus internal bus crc code generator
chapter 23 crc function user?s manual u19201ej3v0ud 1274 23.3 registers (1) crc input register (crcin) the crcin register is an 8-bit register for setting data. this register can be read or written in 8-bit units. reset sets this register to 00h. crcin 654321 after reset: 00h r/w address: fffff310h 7 0 (2) crc data register (crcd) the crcd register is a 16-bit register that stores the crc-ccitt operation results. this register can be read or written in 16-bit units. reset sets this register to 0000h. caution accessing the crcd register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-ch ip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock crcd 12 10 8 6 4 2 after reset: 0000h r/w address: fffff312h 14 0 13 11 9 7 5 3 15 1
chapter 23 crc function user?s manual u19201ej3v0ud 1275 23.4 operation an example of the crc operation circuit is shown below. figure 23-2. crc operation circui t operation example (lsb first) (1) setting of crcin = 01h 1189h b15 b0 b0 b7 crc code is stored (2) crcd register read the code when 01h is sent lsb first is (1000 0000). therefore, the crc code from generation polynomial x 16 + x 12 + x 5 + 1 becomes the remainder when (1000 0000) x 16 is divided by (1 0001 0000 0010 0001) using the modulo-2 operation formula. the modulo-2 operation is performed based on the following formula. 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 ? 1 = 1 1 0001 0000 0010 0001 1000 0000 0000 0000 0000 0000 1000 1000 0001 0000 1 1000 0001 0000 1000 0 1000 1000 0001 0000 1 1001 0001 1000 1000 1000 1000 lsb lsb msb msb therefore, the crc code becomes . since lsb first is used, this corresponds to 1189h in hexadecimal notation. 1001 9811 0001 1000 1000
chapter 23 crc function user?s manual u19201ej3v0ud 1276 23.5 usage method how to use the crc logic circuit is described below. figure 23-3. crc operation flow start write of 0000h to crcd register crcd register read crcin register write yes no input data exists? end [basic usage method] <1> write 0000h to the crcd register. <2> write the required quantity of data to the crcin register. <3> read the crcd register.
chapter 23 crc function user?s manual u19201ej3v0ud 1277 communication errors can easily be det ected if the crc code is transmitted/ received along with transmit/receive data when transmitting/receiving data consisting of several bytes. the following is an illustration using the transmission of 12345678h (0001 0010 0011 0100 0101 0110 0111 1000b) lsb-first as an example. figure 23-4. crc transmission example 78 transmit/receive data (12345678h) crc code (08f6h) 56 34 12 f6 08 setting procedure on transmitting side <1> write the initial value 0000h to the crcd register. <2> write the 1 byte of data to be transmitted first to the transmit buffer register. (at this time, also write the same data to the crcin register.) <3> when transmitting several bytes of data, write t he same data to the crcin register each time transmit data is written to the transmit buffer register. <4> after all the data has been transmitted, write t he contents of the crcd regi ster (crc code) to the transmit buffer register and transmit them. (since th is is lsb first, transmit the data starting from the lower bytes, then the higher bytes.) setting procedure on receiving side <1> write the initial value 0000h to the crcd register. <2> when reception of the first 1 byte of data is comp lete, write that receive data to the crcin register. <3> if receiving several bytes of data, write the rece ive data to the crcin register upon every reception completion. (in the case of normal reception, w hen all the receive data has been written to the crcin register, the contents of the crcd re gister on the receiving side and t he contents of the crcd register on the transmitting side are the same.) <4> next, the crc code is transmitted from the transmi tting side, so write this data to the crcin register similarly to receive data. <5> when reception of all the data, including the crc c ode, has been completed, reception was normal if the contents of the crcd register are 0000 h. if the contents of the crcd re gister are other than 0000h, this indicates a communication error, so transmit a resend request to the transmitting side.
user?s manual u19201ej3v0ud 1278 chapter 24 interrupt/except ion processing function the v850e/sj3-h and v850e/sk3-h are provided with a dedicated interrupt controller (intc) for interrupt servicing and can process a total of 100/ 104/106/108/110/114 interrupt requests. an interrupt is an event that occurs independently of program execution, and an ex ception is an event whose occurrence is dependent on program execution. the v850e/sj3-h and v850e/sk3-h can process interrupt request signals from the on-chip peripheral hardware and external sources. moreover, exception processing can be started by the trap instructi on (software exception) or by generation of an exception event (i.e. fe tching of an illegal opcode) (exception trap). 24.1 features interrupts ? non-maskable interrupts: 2 sources ? maskable interrupts: external: 10, in ternal: 88/92/94/96/98/102 sources (see table 1-1 ) ? 8 levels of programmable priorities (maskable interrupts) ? multiple interrupt control according to priority ? masks can be specified for eac h maskable interrupt request. ? noise elimination, edge detection, and valid edge specification for external interrupt request signals. exceptions ? software exceptions: 32 sources ? exception trap: 2 sources (illegal opcode exception and debug trap) interrupt/exception sources are listed in table 24-1.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1279 table 24-1. interrupt source list (1/5) type classification default priority name trigger generating unit exception code handler address restored pc interrupt control register reset interrupt ? reset reset pin input reset by internal source reset 0000h 00000000h undefined ? ? nmi nmi pin valid edge input pin 0010h 00000010h nextpc ? non- maskable interrupt ? intwdt2 wdt2 over flow wdt2 0020h 00000020h note 1 ? ? trap0n note 2 trap instruction ? 004nh note 2 00000040h nextpc ? software exception exception ? trap1n note 2 trap instruction ? 005nh note 2 00000050h nextpc ? exception trap exception ? ilgop/ dbg0 illegal opcode/ dbtrap instruction ? 0060h 00000060h nextpc ? 0 intlvi low voltage detection poclvi 0080h 00000080h nextpc lviic 1 intp0 external interrupt pin input edge detection (intp0) pin 0090h 00000090h nextpc pic0 2 intp1 external interrupt pin input edge detection (intp1) pin 00a0h 000000a0h nextpc pic1 3 intp2 external interrupt pin input edge detection (intp2) pin 00b0h 000000b0h nextpc pic2 4 intp3 external interrupt pin input edge detection (intp3) pin 00c0h 000000c0h nextpc pic3 5 intp4 external interrupt pin input edge detection (intp4) pin 00d0h 000000d0h nextpc pic4 6 intp5 external interrupt pin input edge detection (intp5) pin 00e0h 000000e0h nextpc pic5 7 intp6 external interrupt pin input edge detection (intp6) pin 00f0h 000000f0h nextpc pic6 8 intp7 external interrupt pin input edge detection (intp7) pin 0100h 00000100h nextpc pic7 9 inttq0ov tmq0 overflow tm q0 0110h 00000110h nextpc tq0ovic 10 inttq0cc0 tmq0 capture 0/ compare 0 match tmq0 0120h 00000120h nextpc tq0ccic0 11 inttq0cc1 tmq0 capture 1/ compare 1 match tmq0 0130h 00000130h nextpc tq0ccic1 12 inttq0cc2 tmq0 capture 2/ compare 2 match tmq0 0140h 00000140h nextpc tq0ccic2 13 inttq0cc3 tmq0 capture 3/ compare 3 match tmq0 0150h 00000150h nextpc tq0ccic3 14 inttp0ov tmp0 overflow tm p0 0160h 00000160h nextpc tp0ovic 15 inttp0cc0 tmp0 capture 0/ compare 0 match tmp0 0170h 00000170h nextpc tp0ccic0 16 inttp0cc1 tmp0 capture 1/ compare 1 match tmp0 0180h 00000180h nextpc tp0ccic1 maskable interrupt 17 inttp1ov tmp1 overflow tm p1 0190h 00000190h nextpc tp1ovic notes 1. for the restoring in the case of intwdt2, see 24.2.2 (2) intwdt2 signal . 2. n = 0 to fh
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1280 table 24-1. interrupt source list (2/5) type classification default priority name trigger generating unit exception code handler address restored pc interrupt control register 18 inttp1cc0 tmp1 capture 0/ compare 0 match tmp1 01a0h 000001a0h nextpc tp1ccic0 19 inttp1cc1 tmp1 capture 1/ compare 1 match tmp1 01b0h 000001b0h nextpc tp1ccic1 20 inttp2ov tmp2 overflow tmp2 01c0h 000001c0h nextpc tp2ovic 21 inttp2cc0 tmp2 capture 0/ compare 0 match tmp2 01d0h 000001d0h nextpc tp2ccic0 22 inttp2cc1 tmp2 capture 1/ compare 1 match tmp2 01e0h 000001e0h nextpc tp2ccic1 23 inttp3ov tmp3 overflow tmp3 01f0h 000001f0h nextpc tp3ovic 24 inttp3cc0 tmp3 capture 0/ compare 0 match tmp3 0200h 00000200h nextpc tp3ccic0 25 inttp3cc1 tmp3 capture 1/ compare 1 match tmp3 0210h 00000210h nextpc tp3ccic1 26 inttp4ov tmp4 overflow tmp4 0220h 00000220h nextpc tp4ovic 27 inttp4cc0 tmp4 capture 0/ compare 0 match tmp4 0230h 00000230h nextpc tp4ccic0 28 inttp4cc1 tmp4 capture 1/ compare 1 match tmp4 0240h 00000240h nextpc tp4ccic1 29 inttp5ov tmp5 overflow tmp5 0250h 00000250h nextpc tp5ovic 30 inttp5cc0 tmp5 capture 0/ compare 0 match tmp5 0260h 00000260h nextpc tp5ccic0 31 inttp5cc1 tmp5 capture 1/ compare 1 match tmp5 0270h 00000270h nextpc tp5ccic1 32 inttm0eq0 tmm0 compare match t mm0 0280h 00000280h nextpc tm0eqic0 33 intcb0r/ intiic1 csib0 reception completion/csib0 reception error/iic1 transfer completion csib0/ i 2 c01 0290h 00000290h nextpc cb0ric/ iicic1 34 intcb0t csib0 consecutive transmission write enable csib0 02a0h 000002a0h nextpc cb0tic 35 intcb1r csib1 reception completion/csib1 reception error csib1 02b0h 000002b0h nextpc cb1ric 36 intcb1t csib1 consecutive transmission write enable csib1 02c0h 000002c0h nextpc cb1tic 37 intcb2r csib2 reception completion/csib2 reception error csib2 02d0h 000002d0h nextpc cb2ric 38 intcb2t csib2 consecutive transmission write enable csib2 02e0h 000002e0h nextpc cb2tic 39 intcb3r csib3 reception completion/csib3 reception error csib3 02f0h 000002f0h nextpc cb3ric maskable interrupt 40 intcb3t csib3 consecutive transmission write enable csib3 0300h 00000300h nextpc cb3tic
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1281 table 24-1. interrupt source list (3/5) type classification default priority name trigger generating unit exception code handler address restored pc interrupt control register 41 intua0r/ intcb4r uarta0 reception completion/uarta0 reception error/csib4 reception completion/ csib4 reception error uarta0/ csib4 0310h 00000310h nextpc ua0ric/ cb4ric 42 intua0t/ intcb4t uarta0 consecutive transmission enable/csib4 consecutive transmission write enable uarta0/ csib4 0320h 00000320h nextpc ua0tic/ cb4tic 43 intua1r uarta1 reception completion/uarta1 reception error uarta1 0330h 00000330h nextpc ua1ric 44 intua1t uarta1 consecutive transmission enable uarta1 0340h 00000340h nextpc ua1tic 45 intua2r uarta2 reception completion/uarta2 reception error uarta2 0350h 00000350h nextpc ua2ric 46 intua2t uarta2 consecutive transmission enable uarta2 0360h 00000360h nextpc ua2tic 47 intad a/d conversion comple tion a/d 0370h 00000370h nextpc adic 48 intdma0 dma0 transfer completi on dma 0380h 00000380h nextpc dmaic0 49 intdma1 dma1 transfer completi on dma 0390h 00000390h nextpc dmaic1 50 intdma2 dma2 transfer completion dma 03a0h 000003a0h nextpc dmaic2 51 intdma3 dma3 transfer completion dma 03b0h 000003b0h nextpc dmaic3 52 intkr key return interrupt kr 03c0h 000003c0h nextpc kric 53 intwti watch timer interval wt 03d0h 000003d0h nextpc wtiic 54 intwt watch timer reference ti me wt 03e0h 000003e0h nextpc wtic 55 intc0err note 1 afcan0 error afcan0 03f0h 000003f0h nextpc erric0 56 intc0wup note 1 afcan0 wakeup afcan0 0400h 00000400h nextpc wupic0 57 intc0rec note 1 afcan0 reception afcan0 0410h 00000410h nextpc recic0 58 intc0trx note 2 afcan0 transmission afcan0 0420h 00000420h nextpc trxic0 59 intc1err note 2 afcan1 error afcan1 0430h 00000430h nextpc erric1 60 intc1wup note 2 afcan1 wakeup afcan1 0440h 00000440h nextpc wupic1 61 intc1rec note 2 afcan1 reception afcan1 0450h 00000450h nextpc recic1 62 intc1trx note 2 afcan1 transmission afcan1 0460h 00000460h nextpc trxic1 63 intp8 external interrupt pin input edge detection (intp8) pin 0470h 00000470h nextpc pic8 64 inttp6ov tmp6 overflow tm p6 0480h 00000480h nextpc tp6ovic 65 inttp6cc0 tmp6 capture 0/ compare 0 match tmp6 0490h 00000490h nextpc tp6ccic0 66 inttp6cc1 tmp6 capture 1/ compare 1 match tmp6 04a0h 000004a0h nextpc tp6ccic1 67 inttp7ov tmp7 overflow tmp7 04b0h 000004b0h nextpc tp7ovic 68 inttp7cc0 tmp7 capture 0/ compare 0 match tmp7 04c0h 000004c0h nextpc tp7ccic0 maskable interrupt 69 inttp7cc1 tmp7 capture 1/ compare 1 match tmp7 04d0h 000004d0h nextpc tp7ccic1 notes 1. can controller version only 2. can controller (2-channel) version only
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1282 table 24-1. interrupt source list (4/5) type classification default priority name trigger generating unit exception code handler address restored pc interrupt control register 70 inttp8ov tmp8 overflow tmp8 04e0h 000004e0h nextpc tp8ovic 71 inttp8cc0 tmp8 capture 0/ compare 0 match tmp8 04f0h 000004f0h nextpc tp8ccic0 72 inttp8cc1 tmp8 capture 1/ compare 1 match tmp8 0500h 00000500h nextpc tp8ccic1 73 intcb5r csib5 reception completion/csib5 reception error csib5 0510h 00000510h nextpc cb5ric 74 intcb5t csib5 consecutive transmission write enable csib5 0520h 00000520h nextpc cb5tic 75 intua3r uarta3 reception completion/uarta3 reception error uarta3 0530h 00000530h nextpc ua3ric 76 intua3t uarta3 consecutive transmission enable uarta3 0540h 00000540h nextpc ua3tic 80 intua4r uarta4 reception completion/uarta4 reception error uarta4 0580h 00000580h nextpc ua4ric 81 intua4t uarta4 consecutive transmission enable uarta4 0590h 00000590h nextpc ua4tic 82 intiic3 i 2 c03 transfer completion i 2 c03 05a0h 000005a0h nextpc iicic3 83 intiic0 i 2 c00 transfer completion i 2 c00 05b0h 000005b0h nextpc iicic0 84 intiic2 i 2 c02 transfer completion i 2 c02 05c0h 000005c0h nextpc iicic2 85 intiic4 note i 2 c04 transfer completion i 2 c04 05d0h 000005d0h nextpc iicic4 86 intiic5 note i 2 c05 transfer completion i 2 c05 05e0h 000005e0h nextpc iicic5 87 intp9 external interrupt pin input edge detection (intp9) pin 05f0h 000005f0h nextpc pic9 88 inttp7iec tmp7 encoder clear tm p7 0600h 00000600h nextpc tp7iecic 89 inttp8iec tmp8 encoder clear tm p8 0610h 00000610h nextpc tp8iecic 90 inttm1eq0 tmm1 compare match t mm1 0620h 00000620h nextpc tm1eqic0 91 inttm2eq0 tmm2 compare match t mm2 0630h 00000630h nextpc tm2eqic0 92 intce0t note csie0 transmission/ reception completion csie0 0640h 00000640h nextpc ce0tic 93 intce0tiof note csie0buf overflow csie0 0650h 00000650h nextpc ce0tiofic 94 intce1t note csie1 transmission/ reception completion csie1 0660h 00000660h nextpc ce1tic 95 intce1tiof note csie1buf overflow csie1 0670h 00000670h nextpc ce1tiofic 96 intub0tir uartb0 reception completion uartb0 0680h 00000680h nextpc ub0tiric 97 intub0tit uartb0 transmission enable uartb0 0690h 00000690h nextpc ub0titic 98 intub0tif uartb0 fifo transmission completion uartb0 06a0h 000006a0h nextpc ub0tific 99 intub0tire uartb0 reception error ua rtb0 06b0h 000006b0h nextpc ub0tireic 100 intub0tito uartb0 reception timeout ua rtb0 06c0h 000006c0h nextpc ub0titoic 101 intub1tir uartb1 reception completion uartb1 06d0h 000006d0h nextpc ub1tiric 102 intub1tit uartb1 transmission enable uartb1 06e0h 000 006e0h nextpc ub1titic 103 intub1tif uartb1 fifo transmission completion uartb1 06f0h 000006f0h nextpc ub1tific maskable interrupt 104 intub1tire uartb1 reception error uartb1 0700h 00000700h nextpc ub1tireic note not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v 850e/sj3-h), and 70f3933 (v850e/sj3-h)
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1283 table 24-1. interrupt source list (5/5) type classification default priority name trigger generating unit exception code handler address restored pc interrupt control register 105 intub1tito uartb1 reception tim eout uartb1 0710h 00000710h nextpc ub1titoic 106 intua5r uarta5 reception completion/uarta5 reception error uarta5 0720h 00000720h nextpc ua5ric 107 intua5t uarta5 consecutive transmission enable uarta5 0730h 00000730h nextpc ua5tic 108 interr iebus error i ebus 0740h 00000740h nextpc erric 109 intsta iebus status i ebus 0750h 00000750h nextpc staic 110 intie1 iebus data interrupt iebus 0760h 00000760h nextpc ieic1 111 intie2 iebus error/iebus stat us iebus 0770h 00000770h nextpc ieic2 112 intrtc0 rtc constant cycle signal rtc 0780h 00000780h nextpc rtc0ic 113 intrtc1 rtc alarm match rtc 0790h 00000790h nextpc rtc1ic maskable interrupt 114 intrtc2 rtc interval signal rtc 07a0h 000007a0h nextpc rtc2ic remarks 1. default priority: the priority order when two or more maskable interrupt requests occur at the same time. the highest priority is 0. the priority order of non-maskable interrupt is intwdt2 > nmi. restored pc: the value of the program count er (pc) saved to eipc, fepc, or dbpc when interrupt servicing is started. note, however, that the restored pc when a non- maskable or maskable interrupt is acknowledged while one of the following instructions is being executed does not become the nextpc (if an interrupt is acknowledged during interrupt execution, execution stops, and then resumes after the interrupt servicing has finished). ? load instructions (sld.b, sld.bu, sld.h, sld.hu, sld.w) ? division instructions (div, divh, divu, divhu) ? prepare, dispose instructions (only if an interrupt is generated before the stack pointer is updated) nextpc: the pc value that starts the proc essing following interrupt/exception processing. 2. the execution address of the illegal instruction when an illegal opcode exception occurs is calculated by (restored pc ? 4).
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1284 24.2 non-maskable interrupts a non-maskable interrupt request signal is acknowledged unconditionally, even when interrupts are in the interrupt disabled (di) status. an nmi is not subject to priority control and takes precedence over all the other interrupt request signals. this product has the following two non-maskable interrupt request signals. ? nmi pin input (nmi) ? non-maskable interrupt request signal generated by overflow of watchdog timer (intwdt2) the valid edge of the nmi pin can be selected from four types: ?rising edge? , ?falling edge?, ?both edges?, and ?no edge detection?. the non-maskable interrupt request signal generated by ov erflow of the watchdog timer 2 (intwdt2) functions when the wdtm2.wdm21 and wdtm2.wdm20 bits are set to ?01?. if two or more non-maskable interrupt request signals occur at the same time, the interrupt with the higher priority is serviced, as follows (the interrupt reques t signal with the lower priority is ignored). intwdt2 > nmi if a new nmi or intwdt2 request signal is issued while a nmi is being serviced, it is serviced as follows. (1) if new nmi request signal is i ssued while nmi is being serviced the new nmi request signal is held pending, regardle ss of the value of the psw.np bit. the pending nmi request signal is acknowledged after the nmi currently under execution has been serviced (after the reti instruction has been executed). (2) if intwdt2 request signal is issued while nmi is being serviced the intwdt2 request signal is held pending if the np bit remains set (1) while the nmi is being serviced. the pending intwdt2 request signal is acknowledged after the nmi currently under execution has been serviced (after the reti instruction has been executed). if the np bit is cleared (0) while the nmi is being serviced, the newly generated intwdt2 request signal is executed (the nmi servicing is stopped). caution for the non-maskable in terrupt servicing executed by th e non-maskable interrupt request signal (intwdt2), see 24.2.2 (2) intwdt2 signal. figure 24-1. non-maskable interrupt requ est signal acknowledgment operation (1/2) (a) nmi and intwdt2 request signa ls generated at the same time main routine system reset nmi and intwd t2 requests (generated simultaneously) intwd t2 servicing
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1285 figure 24-1. non-maskable interrupt requ est signal acknowledgment operation (2/2) (b) non-maskable interrupt request signal ge nerated during non-maskab le interrupt servicing non-maskable interrupt being serviced non-maskable interrupt request signal generated during non-maskable interrupt servicing nmi intwdt2 nmi ? nmi request generated during nmi servicing ? intwdt2 request generated during nmi servicing (np bit = 1 retained before intwdt2 request) main routine nmi request nmi servicing (held pending) servicing of pending nmi nmi request main routine system reset nmi request nmi servicing (held pending) intwdt2 servicing intwdt2 request ? intwdt2 request generated during nmi servicing (np bit = 0 set before intwdt2 request) main routine system reset nmi request nmi servicing intwdt2 servicing intwdt2 request np = 0 ? intwdt2 request generated during nmi servicing (np = 0 set after intwdt2 request) main routine system reset nmi request nmi servicing intwdt2 servicing np = 0 ? intwdt2 request generated during intwdt2 servicing main routine system reset intwdt2 request intwdt2 servicing (invalid) ? nmi request generated during intwdt2 servicing intwdt2 main routine system reset intwdt2 request intwdt2 servicing (invalid) nmi request (held pending) intwdt2 request intwdt2 request
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1286 24.2.1 operation if a non-maskable interrupt request signal is generated, th e cpu performs the following processing, and transfers control to the handler routine. <1> saves the restored pc to fepc. <2> saves the current psw to fepsw. <3> writes exception code (0010h, 0020h) to the higher halfword (fecc) of ecr. <4> sets the psw.np and psw.id bits to 1 and clears the psw.ep bit to 0. <5> sets the handler address (00000010h, 00000020h) corresponding to the non-maskable interrupt to the pc, and transfers control. the servicing configuration of a non-maska ble interrupt is shown in figure 24-2. figure 24-2. servicing configurat ion of non-maskable interrupt psw.np fepc fepsw ecr.fecc psw.np psw.ep psw.id pc restored pc psw 0010h, 0020h 1 0 1 00000010h, 00000020h 1 0 nmi input non-maskable interrupt request interrupt servicing interrupt request held pending intc acknowledged cpu processing
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1287 24.2.2 restore (1) from nmi pin input execution is restored from the nmi se rvicing by the reti instruction. when the reti instruction is execut ed, the cpu performs the following proc essing, and transfers control to the address of the restored pc. <1> loads the restored pc and psw from fepc and f epsw, respectively, because the psw.ep bit is 0 and the psw.np bit is 1. <2> transfers control back to the address of the restored pc and psw. figure 24-3 illustrates how the reti instruction is processed. figure 24-3. reti instruction processing psw.ep reti instruction psw.np original processing restored 1 1 0 0 pc psw eipc eipsw pc psw fepc fepsw caution when the ep and np bits are changed by the ldsr instruction duri ng non-maskable interrupt servicing, in order to restore the pc and psw correctly during recovery by the reti instruction, it is necessary to set the ep bit back to 0 and the np bit back to 1 using the ldsr instruction immediately befo re the reti instruction. remark the solid line shows the cpu processing flow.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1288 (2) from intwdt2 signal restoring from non-maskable interrupt servicing exec uted by the non-maskable interrupt request (intwdt2) by using the reti instruction is disabled. execute the following software reset processing. figure 24-4. software reset processing intwdt2 occurs. fepc software reset processing address fepsw value that sets np bit = 1, ep bit = 0 reti reti 10 times (fepc and fepsw note must be set.) psw psw default value setting initialization processing intwdt2 servicing routine software reset processing routine note fepsw value that sets np bit = 1, ep bit = 0 24.2.3 np flag the np flag is a status flag that indicates that non -maskable interrupt servicing is under execution. this flag is set when a non-maskable interrupt request signal has been acknowledged, and masks non-maskable interrupt requests to prohibit multiple interrupts from being acknowledged. 0 np ep id sat cy ov s z psw no non-maskable interrupt servicing non-maskable interrupt currently being serviced np 0 1 non-maskable interrupt servicing status after reset: 00000020h
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1289 24.3 maskable interrupts maskable interrupt request signals can be masked by interrupt control registers. the v850e/sj3-h and v850e/sk3-h have 98/102/104/106/108/ 112 maskable interrupt sources. if two or more maskable interrupt request signals ar e generated at the same ti me, they are acknowledged according to the default priority. in addition to the default prio rity, eight levels of priorities can be specified by using the interrupt control registers (p rogrammable priority control). when an interrupt request signal has been acknowledged, the acknowledgment of other maskable interrupt request signals is disabled and the interrupt disabled (di) status is set. when the ei instruction is executed in an interrupt servicing routine, the interr upt enabled (ei) status is set, which enables servicing of interrupts having a higher priority t han the interrupt request signal in progress (specified by the interrupt control register). note that only interrupts with a higher priority will have this capability; interrupts with the same priority level cannot be nested. to enable multiple interrupts, however, save eipc and eipsw to memory or general -purpose registers before executing the ei instruction, and execute the di instruction bef ore the reti instruction to re store the original values of eipc and eipsw. 24.3.1 operation if a maskable interrupt occurs, the cpu performs the fo llowing processing, and transfers control to a handler routine. <1> saves the restored pc to eipc. <2> saves the current psw to eipsw. <3> writes an exception code to the lower halfword of ecr (eicc). <4> sets the psw. id bit to 1 and clears the psw. ep bit to 0. <5> sets the handler address corresponding to each interrupt to the pc, and transfers control. the maskable interrupt request signal masked by intc and the maskable interrupt request signal generated while another interrupt is being serviced (while the psw.np bit = 1 or the psw.id bit = 1) are held pending inside intc. in this case, servicing a new maskable interrupt is start ed in accordance with the priority of the pending maskable interrupt request signal if either the maskable interrupt is unmasked or the np and id bits are cleared to 0 by using the reti or ldsr instruction. how maskable interrupts are serviced is illustrated below.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1290 figure 24-5. maskable interrupt servicing int input xxif = 1 no xxmk = 0 no is the interrupt mask released? yes yes no no no maskable interrupt request interrupt request held pending psw.np psw.id 1 1 interrupt request held pending 0 0 interrupt servicing cpu processing intc acknowledged yes yes yes priority higher than that of interrupt currently being serviced? priority higher than that of other interrupt request? highest default priority of interrupt requests with the same priority? eipc eipsw ecr.eicc psw.ep psw.id corresponding bit of ispr note pc restored pc psw exception code 0 1 1 handler address interrupt requested? note for the ispr register, see 24.3.6 in-service priority register (ispr) .
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1291 24.3.2 restore recovery from maskable interrupt servicing is carried out by the reti instruction. when the reti instruction is executed , the cpu performs the following steps, and transfers control to the address of the restored pc. <1> loads the restored pc and psw from eipc and eipsw because the psw.ep bit is 0 and the psw.np bit is 0. <2> transfers control to the address of the restored pc and psw. figure 24-6 illustrates the proce ssing of the reti instruction. figure 24-6. reti instruction processing psw.ep reti instruction psw.np restores original processing 1 1 0 0 pc psw corresponding bit of ispr note eipc eipsw 0 pc psw fepc fepsw note for the ispr register, see 24.3.6 in-service priority register (ispr) . caution when the ep and np bits are changed by the ldsr instruction during maskable interrupt servicing, in order to restore the pc and psw correctly during recovery by the reti instruction, it is necessary to set the ep bit back to 0 and the np bit back to 0 using the ldsr instruction immediately befo re the reti instruction. remark the solid line shows the cpu processing flow.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1292 24.3.3 priorities of maskable interrupts the intc performs multiple interrupt servicing in which an interrupt is acknowledged while another interrupt is being serviced. multiple interrupts can be controlled by priority levels. there are two types of priority level c ontrol: control based on the default pr iority levels, and control based on the programmable priority levels that are spec ified by the interrupt priority level s pecification bit (xxprn) of the interrupt control register (xxicn). when two or more interrupts hav ing the same priority level specified by the xxprn bit are generated at the same time, interrupt request signals are serv iced in order depending on the priority level allocated to each interrupt request type (default priority leve l) beforehand. for more information, see table 24-1 interrupt/exception source list . the programmable priority control custom izes interrupt request signals into eight levels by setting the priority level specification flag. note that when an interrupt request signal is acknowledged , the psw.id flag is automatica lly set to 1. therefore, when multiple interrupts are to be used, clear the id flag to 0 beforehand (for example, by pl acing the ei instruction in the interrupt servicing program) to set the interrupt enable mode. remark xx: identification name of each peripheral unit (see table 24-2 interrupt control register (xxicn) ) n: peripheral unit number (see table 24-2 interrupt control register (xxicn) ).
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1293 figure 24-7. example of processing in which another interrupt request signal is issued while an interrupt is being serviced (1/2) main routine ei ei interrupt request a (level 3) servicing of a servicing of b servicing of c interrupt request c (level 3) servicing of d servicing of e ei interrupt request e (level 2) servicing of f ei servicing of g interrupt request g (level 1) interrupt request h (level 1) servicing of h interrupt request b is acknowledged because the priority of b is higher than that of a and interrupts are enabled. although the priority of interrupt request d is higher than that of c, d is held pending because interrupts are disabled. interrupt request f is held pending even if interrupts are enabled because its priority is lower than that of e. interrupt request h is held pending even if interrupts are enabled because its priority is the same as that of g. interrupt request b (level 2) interrupt request d (level 2) interrupt request f (level 3) caution to perform multiple interrupt servicing, th e values of the eipc and eipsw registers must be saved before executing the ei instruction. when returning from multiple interrupt servicing, restore the values of eipc and eipsw after executing the di instruction. remarks 1. a to u in the figure are the temporary names of interrupt request signals shown for the sake of explanation. 2. the default priority in the figure indicates t he relative priority between two interrupt request signals.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1294 figure 24-7. example of processing in which another interrupt request signal is issued while an interrupt is being serviced (2/2) main routine ei interrupt request i (level 2) servicing of i servicing of k interrupt request j (level 3) servicing of j interrupt request l (level 2) ei ei ei interrupt request o (level 3) interrupt request s (level 1) interrupt request k (level 1) servicing of l servicing of n servicing of m servicing of s servicing of u servicing of t interrupt request m (level 3) interrupt request n (level 1) servicing of o interrupt request p (level 2) interrupt request q (level 1) interrupt request r (level 0) interrupt request u (level 2) note 2 interrupt request t (level 2) note 1 servicing of p servicing of q servicing of r ei if levels 3 to 0 are acknowledged interrupt request j is held pending because its priority is lower than that of i. k that occurs after j is acknowledged because it has the higher priority. interrupt requests m and n are held pending because servicing of l is performed in the interrupt disabled status. pending interrupt requests are acknowledged after servicing of interrupt request l. at this time, interrupt request n is acknowledged first even though m has occurred first because the priority of n is higher than that of m. pending interrupt requests t and u are acknowledged after servicing of s. because the priorities of t and u are the same, u is acknowledged first because it has the higher default priority, regardless of the order in which the interrupt requests have been generated. caution to perform multiple interrupt servicing, th e values of the eipc and eipsw registers must be saved before executing the ei instruction. when returning from multiple interrupt servicing, restore the values of eipc and eipsw after executing the di instruction. notes 1. lower default priority 2. higher default priority
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1295 figure 24-8. example of servicing interrupt request signals simu ltaneously generated default priority a > b > c main routine ei interrupt request a (level 2) interrupt request b (level 1) interrupt request c (level 1) servicing of interrupt request b . . servicing of interrupt request c servicing of interrupt request a interrupt request b and c are acknowledged first according to their priorities. because the priorities of b and c are the same, b is acknowledged first according to the default priority. caution to perform multiple interrupt servicing, th e values of the eipc and eipsw registers must be saved before executing the ei instruction. when returning from multiple interrupt servicing, restore the values of eipc and eipsw after executing the di instruction. remarks 1. a to c in the figure are the temporary names of interrupt request signals shown for the sake of explanation. 2. the default priority in the figure indicates t he relative priority between two interrupt request signals.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1296 24.3.4 interrupt control register (xxicn) the xxicn register is assigned to each interrupt request signal (maskable interrupt) and sets the control conditions for each maskable interrupt request. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 47h. cautions 1. disable interrupts (di) or mask the interrupt to read the xxicn.xxifn bit. if the xxifn bit is read while interrupts are enabled (ei) or whil e the interrupt is unmasked, the correct value may not be read when acknowledging an interrupt and reading the bit conflict. 2. when manipulating the xxicn .xxmkn bit with the state where an interrupt request can be generated (including an interrupt disable (d i) state), be sure to manipulate with a bit manipulation instruction or by using the imrm .xxmkn and imr7l.xxmkn bits (m = 0 to 6). xxifn interrupt request not issued interrupt request issued xxifn 0 1 interrupt request flag note xxicn xxmkn 0 0 0 xxprn2 xxprn1 xxprn0 interrupt servicing enabled interrupt servicing disabled (pending) xxmkn 0 1 interrupt mask flag specifies level 0 (highest). specifies level 1. specifies level 2. specifies level 3. specifies level 4. specifies level 5. specifies level 6. specifies level 7 (lowest). xxprn2 0 0 0 0 1 1 1 1 interrupt priority specification bit xxprn1 0 0 1 1 0 0 1 1 xxprn0 0 1 0 1 0 1 0 1 after reset: 47h r/w address: fffff110h to fffff1f4h <6> <7> note the flag xxlfn is reset automatically by the hardwa re if an interrupt request signal is acknowledged. caution be sure to set bits 3 to 5 to ?0?. remark xx: identification name of each peripheral unit (see table 24-2 interrupt control register (xxicn) ) n: peripheral unit number (see table 24-2 interrupt control register (xxicn) ) the addresses and bits of the interrupt control registers are as follows.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1297 table 24-2. interrupt control register (xxicn) (1/3) bit address register <7> <6> 5 4 3 2 1 0 fffff110h lviic lviif lvimk 0 0 0 lvipr2 lvipr1 lvipr0 fffff112h pic0 pif0 pmk0 0 0 0 ppr02 ppr01 ppr00 fffff114h pic1 pif1 pmk1 0 0 0 ppr12 ppr11 ppr10 fffff116h pic2 pif2 pmk2 0 0 0 ppr22 ppr21 ppr20 fffff118h pic3 pif3 pmk3 0 0 0 ppr32 ppr31 ppr30 fffff11ah pic4 pif4 pmk4 0 0 0 ppr42 ppr41 ppr40 fffff11ch pic5 pif5 pmk5 0 0 0 ppr52 ppr51 ppr50 fffff11eh pic6 pif6 pmk6 0 0 0 ppr62 ppr61 ppr60 fffff120h pic7 pif7 pmk7 0 0 0 ppr72 ppr71 ppr70 fffff122h tq0ovic tq0ovif tq0ovmk 0 0 0 tq0ovpr2 tq0ovpr1 tq0ovpr0 fffff124h tq0ccic0 tq0ccif0 tq0ccmk0 0 0 0 tq0ccpr02 tq0ccpr01 tq0ccpr00 fffff126h tq0ccic1 tq0ccif1 tq0ccmk1 0 0 0 tq0ccpr12 tq0ccpr11 tq0ccpr10 fffff128h tq0ccic2 tq0ccif2 tq0ccmk2 0 0 0 tq0ccpr22 tq0ccpr21 tq0ccpr20 fffff12ah tq0ccic3 tq0ccif3 tq0ccmk3 0 0 0 tq0ccpr32 tq0ccpr31 tq0ccpr30 fffff12ch tp0ovic tp0ovif tp0ovmk 0 0 0 tp0ovpr2 tp0ovpr1 tp0ovpr0 fffff12eh tp0ccic0 tp0ccif0 tp0ccmk0 0 0 0 tp0ccpr02 tp0ccpr01 tp0ccpr00 fffff130h tp0ccic1 tp0ccif1 tp0ccmk1 0 0 0 tp0ccpr12 tp0ccpr11 tp0ccpr10 fffff132h tp1ovic tp1ovif tp1ovmk 0 0 0 tp1ovpr2 tp1ovpr1 tp1ovpr0 fffff134h tp1ccic0 tp1ccif0 tp1ccmk0 0 0 0 tp1ccpr02 tp1ccpr01 tp1ccpr00 fffff136h tp1ccic1 tp1ccif1 tp1ccmk1 0 0 0 tp1ccpr12 tp1ccpr11 tp1ccpr10 fffff138h tp2ovic tp2ovif tp2ovmk 0 0 0 tp2ovpr2 tp2ovpr1 tp2ovpr0 fffff13ah tp2ccic0 tp2ccif0 tp2ccmk0 0 0 0 tp2ccpr02 tp2ccpr01 tp2ccpr00 fffff13ch tp2ccic1 tp2ccif1 tp2ccmk1 0 0 0 tp2ccpr12 tp2ccpr11 tp2ccpr10 fffff13eh tp3ovic tp3ovif tp3ovmk 0 0 0 tp3ovpr2 tp3ovpr1 tp3ovpr0 fffff140h tp3ccic0 tp3ccif0 tp3ccmk0 0 0 0 tp3ccpr02 tp3ccpr01 tp3ccpr00 fffff142h tp3ccic1 tp3ccif1 tp3ccmk1 0 0 0 tp3ccpr12 tp3ccpr11 tp3ccpr10 fffff144h tp4ovic tp4ovif tp4ovmk 0 0 0 tp4ovpr2 tp4ovpr1 tp4ovpr0 fffff146h tp4ccic0 tp4ccif0 tp4ccmk0 0 0 0 tp4ccpr02 tp4ccpr01 tp4ccpr00 fffff148h tp4ccic1 tp4ccif1 tp4ccmk1 0 0 0 tp4ccpr12 tp4ccpr11 tp4ccpr10 fffff14ah tp5ovic tp5ovif tp5ovmk 0 0 0 tp5ovpr2 tp5ovpr1 tp5ovpr0 fffff14ch tp5ccic0 tp5ccif0 tp5ccmk0 0 0 0 tp5ccpr02 tp5ccpr01 tp5ccpr00 fffff14eh tp5ccic1 tp5ccif1 tp5ccmk1 0 0 0 tp5ccpr12 tp5ccpr11 tp5ccpr10 fffff150h tm0eqic0 tm0eqif0 tm0eqmk0 0 0 0 tm0eqpr02 tm0eqpr01 tm0eqpr00 fffff152h cb0ric/ iicic1 cb0rif/ iicif1 cb0rmk/ iicmk1 0 0 0 cb0rpr2/ iicpr12 cb0rpr1/ iicpr11 cb0rpr0/ iicpr10 fffff154h cb0tic cb0tif cb0tmk 0 0 0 cb0tpr2 cb0tpr1 cb0tpr0 fffff156h cb1ric cb1rif cb1rmk 0 0 0 cb1rpr2 cb1rpr1 cb1rpr0 fffff158h cb1tic cb1tif cb1tmk 0 0 0 cb1tpr2 cb1tpr1 cb1tpr0 fffff15ah cb2ric cb2rif cb2rmk 0 0 0 cb2rpr2 cb2rpr1 cb2rpr0 fffff15ch cb2tic cb2tif cb2tmk 0 0 0 cb2tpr2 cb2tpr1 cb2tpr0 fffff15eh cb3ric cb3rif cb3rmk 0 0 0 cb3rpr2 cb3rpr1 cb3rpr0 fffff160h cb3tic cb3tif cb3tmk 0 0 0 cb3tpr2 cb3tpr1 cb3tpr0
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1298 table 24-2. interrupt control register (xxicn) (2/3) bit address register <7> <6> 5 4 3 2 1 0 fffff162h ua0ric/ cb4ric ua0rif/ cb4rif ua0rmk/ cb4rmk 0 0 0 ua0rpr2/ cb4rpr2 ua0rpr1/ cb4rpr1 ua0rpr0/ cb4rpr0 fffff164h ua0tic/ cb4tic ua0tif/ cb4tif ua0tmk/ cb4tmk 0 0 0 ua0tpr2/ cb4tpr2 ua0tpr1/ cb4tpr1 ua0tpr0/ cb4tpr0 fffff166h ua1ric ua1rif ua1rmk 0 0 0 ua1rpr2 ua1rpr1 ua1rpr0 fffff168h ua1tic ua1tif ua1tmk 0 0 0 ua1tpr2 ua1tpr1 ua1tpr0 fffff16ah ua2ric ua2rif ua2rmk 0 0 0 ua2rpr2 ua2rpr1 ua2rpr0 fffff16ch ua2tic ua2tif ua2tmk 0 0 0 ua2tpr2 ua2tpr1 ua2tpr0 fffff16eh adic adif admk 0 0 0 adpr2 adpr1 adpr0 fffff170h dmaic0 dmaif0 dmamk0 0 0 0 dmapr02 dmapr01 dmapr00 fffff172h dmaic1 dmaif1 dmamk1 0 0 0 dmapr12 dmapr11 dmapr10 fffff174h dmaic2 dmaif2 dmamk2 0 0 0 dmapr22 dmapr21 dmapr20 fffff176h dmaic3 dmaif3 dmamk3 0 0 0 dmapr32 dmapr31 dmapr30 fffff178h kric krif krmk 0 0 0 krpr2 krpr1 krpr0 fffff17ah wtiic wtiif wtimk 0 0 0 wtipr2 wtipr1 wtipr0 fffff17ch wtic wtif wtmk 0 0 0 wtpr2 wtpr1 wtpr0 fffff17eh erric0 note 1 errif0 errmk0 0 0 0 errpr02 errpr01 errpr00 fffff180h wupic0 note 1 wupif0 wupmk0 0 0 0 wuppr02 wuppr01 wuppr00 fffff182h recic0 note 1 recif0 recmk0 0 0 0 recpr02 recpr01 recpr00 fffff184h trxic0 note 1 trxif0 trxmk0 0 0 0 trxpr02 trxpr01 trxpr00 fffff186h erric1 note 2 errif1 errmk1 0 0 0 errpr12 errpr11 errpr10 fffff188h wupic1 note 2 wupif1 wupmk1 0 0 0 wuppr12 wuppr11 wuppr10 fffff18ah recic1 note 2 recif1 recmk1 0 0 0 recpr12 recpr11 recpr10 fffff18ch trxic1 note 2 trxif1 trxmk1 0 0 0 trxpr12 trxpr11 trxpr10 fffff18eh pic8 pif8 pmk8 0 0 0 ppr82 ppr81 ppr80 fffff190h tp6ovic tp6ovif tp6ovmk 0 0 0 tp6ovpr2 tp6ovpr1 tp6ovpr0 fffff192h tp6ccic0 tp6ccif0 tp6ccmk0 0 0 0 tp6ccpr02 tp6ccpr01 tp6ccpr00 fffff194h tp6ccic1 tp6ccif1 tp6ccmk1 0 0 0 tp6ccpr12 tp6ccpr11 tp6ccpr10 fffff196h tp7ovic tp7ovif tp7ovmk 0 0 0 tp7ovpr2 tp7ovpr1 tp7ovpr0 fffff198h tp7ccic0 tp7ccif0 tp7ccmk0 0 0 0 tp7ccpr02 tp7ccpr01 tp7ccpr00 fffff19ah tp7ccic1 tp7ccif1 tp7ccmk1 0 0 0 tp7ccpr12 tp7ccpr11 tp7ccpr10 fffff19ch tp8ovic tp8ovif tp8ovmk 0 0 0 tp8ovpr2 tp8ovpr1 tp8ovpr0 fffff19eh tp8ccic0 tp8ccif0 tp8ccmk0 0 0 0 tp8ccpr02 tp8ccpr01 tp8ccpr00 fffff1a0h tp8ccic1 tp8ccif1 tp8ccmk1 0 0 0 tp8ccpr12 tp8ccpr11 tp8ccpr10 fffff1a2h cb5ric cb5rif cb5rmk 0 0 0 cb5rpr2 cb5rpr1 cb5rpr0 fffff1a4h cb5tic cb5tif cb5tmk 0 0 0 cb5tpr2 cb5tpr1 cb5tpr0 fffff1a6h ua3ric ua3rif ua3rmk 0 0 0 ua3rpr2 ua3rpr1 ua3rpr0 fffff1a8h ua3tic ua3tif ua3tmk 0 0 0 ua3tpr2 ua3tpr1 ua3tpr0 notes 1. can controller version only 2. can controller (2-channel) version only
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1299 table 24-2. interrupt control register (xxicn) (3/3) bit address register <7> <6> 5 4 3 2 1 0 fffff1b0h ua4ric ua4rif ua4rmk 0 0 0 ua4rpr2 ua4rpr1 ua4rpr0 fffff1b2h ua4tic ua4tif ua4tmk 0 0 0 ua4tpr2 ua4tpr1 ua4tpr0 fffff1b4h iicic3 iicif3 iicmk3 0 0 0 iicpr32 iicpr31 iicpr30 fffff1b6h iicic0 iicif0 iicmk0 0 0 0 iicpr02 iicpr01 iicpr00 fffff1b8h iicic2 iicif2 iicmk2 0 0 0 iicpr22 iicpr21 iicpr20 fffff1bah iicic4 note iicif4 iicmk4 0 0 0 iicpr42 iicpr41 iicpr40 fffff1bch iicic5 note iicif5 iicmk5 0 0 0 iicpr52 iicpr51 iicpr50 fffff1beh pic9 pif9 pmk9 0 0 0 ppr92 ppr91 ppr90 fffff1c0h tp7iecic tp7iecif tp7iecmk 0 0 0 tp7iecpr2 tp7iecpr1 tp7iecpr0 fffff1c2h tp8iecic tp8iecif tp8iecmk 0 0 0 tp8iecpr2 tp8iecpr1 tp8iecpr0 fffff1c4h tm1eqic0 tm1eqif0 tm1eqmk0 0 0 0 tm1eqpr02 tm1eqpr01 tm1eqpr00 fffff1c6h tm2eqic0 tm2eqif0 tm2eqmk0 0 0 0 tm2eqpr02 tm2eqpr01 tm2eqpr00 fffff1c8h ce0tic note ce0tif ce0tmk 0 0 0 ce 0tpr2 ce0tpr1 ce0tpr0 fffff1cah ce0tiofic note ce0tiofif ce0tiofmk 0 0 0 ce0t iofpr2 ce0tiofpr1 ce0tiofpr0 fffff1cch ce1tic note ce1tif ce1tmk 0 0 0 ce 1tpr2 ce1tpr1 ce1tpr0 fffff1ceh ce1tiofic note ce1tiofif ce1tiofmk 0 0 0 ce1t iofpr2 ce1tiofpr1 ce1tiofpr0 fffff1d0h ub0tiric ub0tirif ub0tirmk 0 0 0 ub0tirpr2 ub0tirpr1 ub0tirpr0 fffff1d2h ub0titic ub0titif ub0titmk 0 0 0 ub0titpr2 ub0titpr1 ub0titpr0 fffff1d4h ub0tific ub0tifif ub0tifmk 0 0 0 ub0tifpr2 ub0tifpr1 ub0tifpr0 fffff1d6h ub0tireic ub0tireif ub0tiremk 0 0 0 ub0tirepr2 ub0tirepr1 ub0tirepr0 fffff1d8h ub0titoic ub0titoif ub0titomk 0 0 0 ub0titopr2 ub0titopr1 ub0titopr0 fffff1dah ub1tiric ub1tirif ub1tirmk 0 0 0 ub1tirpr2 ub1tirpr1 ub1tirpr0 fffff1dch ub1titic ub1titif ub1titmk 0 0 0 ub1titpr2 ub1titpr1 ub1titpr0 fffff1deh ub1tific ub1tifif ub1tifmk 0 0 0 ub1tifpr2 ub1tifpr1 ub1tifpr0 fffff1e0h ub1tireic ub1tireif ub1tiremk 0 0 0 ub1tirepr2 ub1tirepr1 ub1tirepr0 fffff1e2h ub1titoic ub1titoif ub1titomk 0 0 0 ub1titopr2 ub1titopr1 ub1titopr0 fffff1e4h ua5ric ua5rif ua5rmk 0 0 0 ua5rpr2 ua5rpr1 ua5rpr0 fffff1e6h ua5tic ua5tif ua5tmk 0 0 0 ua5tpr2 ua5tpr1 ua5tpr0 fffff1e8h erric errif errmk 0 0 0 errpr2 errpr1 errpr0 fffff1eah staic staif stamk 0 0 0 stapr2 stapr1 stapr0 fffff1ech ieic1 ieif1 iemk1 0 0 0 iepr12 iepr11 iepr10 fffff1eeh ieic2 ieif2 iemk2 0 0 0 iepr22 iepr21 iepr20 fffff1f0h rtc0ic rtc0if rtc0mk 0 0 0 rtc0pr2 rtc0pr1 rtc0pr0 fffff1f2h rtc1ic rtc1if rtc1mk 0 0 0 rtc1pr2 rtc1pr1 rtc1pr0 fffff1f4h rtc2ic rtc2if rtc2mk 0 0 0 rtc2pr2 rtc2pr1 rtc2pr0 note not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v 850e/sj3-h), and 70f3933 (v850e/sj3-h)
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1300 24.3.5 interrupt mask registers 0 to 6, 7l (imr0 to imr6, imr7l) the imr0 to imr6 and imr7l registers set the interrupt mask state for the maskable interrupts. the xxmkn bit of the imr0 to imr6 and imr7l registers is equivalent to the xxicn.xxmkn bit. the imrm register can be read or written in 16-bit units (m = 0 to 6). if the higher 8 bits of the imrm regi ster are used as an imrmh register and the lower 8 bits as an imrml register, these registers can be read or written in 8-bit or 1-bit units (m = 0 to 6). the imr7l register can be read or wr itten in 8-bit or 1-bit units. reset sets these registers to ffffh. caution the device file defi nes the xxicn.xxm kn bit as a reserved word. if a bit is manipulated using the name of xxmkn, the contents of the xxicn register , instead of the imrm and imr7l registers, are rewritten (as a result, the contents of the im rm and imr7l registers are also rewritten).
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1301 (1/2) pmk8 errmk0 note 4 imr3 (imr3h note 1 ) trxmk1 note 3 wtmk recmk1 note 3 wtimk wupmk1 note 3 krmk errmk1 note 3 dmamk3 trxmk0 note 4 dmamk2 recmk0 note 4 dmamk1 wupmk0 note 4 dmamk0 1 tp8ccmk0 imr4 (imr4h note 1 ) 1 tp8ovmk 1 tp7ccmk1 ua3tmk tp7ccmk0 ua3rmk tp7ovmk cb5tmk tp6ccmk1 cb5rmk tp6ccmk0 tp8ccmk1 tp6ovmk ce1tiofmk note 2 pmk9 tp7iecmk ua4rmk imr5 (imr5h note 1 ) ce1tmk note 2 iicmk5 note 2 iicmk4 note 2 ce0tmk note 2 iicmk2 iicmk0 iicmk3 tm1eqmk0 ua5rmk ce0tiofmk note 2 tm2eqmk0 ub1tifmk tp8iecmk ub1titomk ub1tiremk ua4tmk 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 0 iemk2 imr6 (imr6h note 1 ) iemk1 ub1titmk stamk ub1tirmk errmk ub0titomk ua5tmk ub0tiremk ub0tifmk ub0titmkub0tirmk 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 0 0 imr7l imr6l imr5l imr4l imr3l rtc2mk rtc1mk rtc0mk 1 2 3 4 5 6 7 0 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 0 8 9 10 11 12 14 13 15 1 2 3 4 5 6 7 0 admk cb3rmk imr2 (imr2h note 1 ) ua2tmk cb2tmk ua2rmk cb2rmk ua1tmk cb1tmk ua1rmk cb1rmk ua0tmk/ cb4tmk cb0tmk ua0rmk/ cb4rmk cb0rmk/ iicmk1 cb3tmk tm0eqmk0 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 0 imr2l tp5ccmk1 tp3ovmk imr1 (imr1h note 1 ) tp5ccmk0 tp2ccmk1 tp5ovmk tp2ccmk0 tp4ccmk1 tp2ovmk tp4ccmk0 tp1ccmk1 tp4ovmk tp1ccmk0 tp3ccmk1 tp1ovmk tp3ccmk0 tp0ccmk1 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 0 imr1l tp0ccmk0 pmk6 imr0 (imr0h note 1 ) tp0ovmk pmk5 tq0ccmk3 pmk4 tq0ccmk2 pmk3 tq0ccmk1 pmk2 tq0ccmk0 pmk1 tq0ovmk pmk0 pmk7 lvimk 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 0 imr0l after reset: 1fh r/w address: imr7l fffff10eh after reset: ffffh r/w address: imr6 fffff10ch, imr6l fffff10ch, imr6h fffff10dh after reset: ffffh r/w address: imr5 fffff10ah, imr5l fffff10ah, imr5h fffff10bh after reset: ffffh r/w address: imr4 fffff108h, imr4l fffff108h, imr4h fffff109h after reset: ffffh r/w address: imr3 fffff106h, imr3l fffff106h, imr3h fffff107h after reset: ffffh r/w address: imr2 fffff104h, imr2l fffff104h, imr2h fffff105h after reset: ffffh r/w address: imr1 fffff102h, imr1l fffff102h, imr1h fffff103h after reset: ffffh r/w address: imr0 fffff100h, imr0l fffff100h, imr0h fffff101h 0 0 1 1
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1302 (2/2) xxmkn 0 1 interrupt servicing enabled interrupt servicing disabled setting of interrupt mask flag notes 1. to read bits 8 to 15 of the imr0 to imr6 registers in 8-bit or 1-bit units, specify them as bits 0 to 7 of the imr0h to imr6h registers. 2. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v 850e/sj3-h), and 70f3933 (v850e/sj3- h). be sure to set these bits to 1 in the pd70f3931 (v850e/sj3-h), 70f 3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). 3. can controller (2-channel) versions only. be sure to set the registers to 1 when other than the above. 4. can controller versions only. be sure to set the registers to 1 when other than the above. caution set bits 13 to 15 of the imr4 register and bits 3 and 4 of the imr7l register to 1, and set bits 5 to 7 of the imr7l register to 0. if the setti ng of these bits is changed, the operation is not guaranteed. remark xx: identification name of each peripheral unit (see table 24-2 interrupt control register (xxicn) ). n: peripheral unit number (see table 24-2 interrupt control register (xxicn) )
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1303 24.3.6 in-service priority register (ispr) the ispr register holds the priority level of the maskable interrupt curr ently acknowledged. when an interrupt request signal is acknowledged, the bit of this register corresponding to the priori ty level of that interrupt request signal is set to 1 and remains set while the interrupt is serviced. when the reti instruction is execut ed, the bit corresponding to the in terrupt request signal having the highest priority is automatically cleared to 0 by hardware. howeve r, it is not cleared to 0 when execution is returned from non- maskable interrupt servicing or exception processing. this register is read-only, in 8-bit or 1-bit units. reset sets this register to 00h. caution if an interrupt is acknowledged while the ispr register is being read in the interrupt enabled (ei) status, the value of the ispr register after the bits of th e register have been set by acknowledging the interrupt may be read. to accu rately read the value of the ispr register before an interrupt is acknowledged, read th e register while interrupts are disabled (di). ispr7 interrupt request signal with priority n not acknowledged interrupt request signal with priority n acknowledged isprn 0 1 priority of interrupt currently acknowledged ispr ispr6 ispr5 ispr4 ispr3 ispr2 ispr1 ispr0 after reset: 00h r address: fffff1fah <7> <6> <5> <4> <3> <2> <1> <0> remark n = 0 to 7 (priority level)
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1304 24.3.7 id flag this flag controls the maskable interr upt?s operating state, and st ores control information regarding enabling or disabling of interrupt request signals. an inte rrupt disable flag (id) is assigned to the psw. reset sets this flag to 00000020h. 0 np ep id sat cy ov s z psw maskable interrupt request signal acknowledgment enabled maskable interrupt request signal acknowledgment disabled (pending) id 0 1 specification of maskable interrupt servicing note after reset: 00000020h note interrupt disable flag (id) function this bit is set to 1 by the di instruction and cleared to 0 by the ei instruction. its value is also modified by the reti instruction or ldsr instru ction when referencing the psw. non-maskable interrupt request signals and exceptions are acknowledged regardless of this flag. when a maskable interrupt request signal is acknowledged, the id flag is automatically set to 1 by hardware. the interrupt request signal generated during the acknowledgment disabled period (id flag = 1) is acknowledged when the xxicn.xxifn bit is set to 1, and the id flag is cleared to 0. 24.3.8 watchdog timer mode register 2 (wdtm2) this register can be read or writt en in 8-bit units (for details, see chapter 11 functions of watchdog timer 2 ). reset sets this register to 67h. 0 wdtm2 wdm21 wdm20 0 0 0 0 0 after reset: 67h r/w address: fffff6d0h stops operation non-maskable interrupt request mode reset mode (initial-value) wdm21 0 0 1 wdm20 0 1 selection of watchdog timer operation mode
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1305 24.4 software exception a software exception is generated when the cpu ex ecutes the trap instruction, and can always be acknowledged. 24.4.1 operation if a software exception occurs, the cpu performs the fo llowing processing, and transfers control to the handler routine. <1> saves the restored pc to eipc. <2> saves the current psw to eipsw. <3> writes an exception code to the lower 16 bits (eicc) of ecr (interrupt source). <4> sets the psw.ep and psw.id bits to 1. <5> sets the handler address (00000040h or 00000050h ) corresponding to the software exception to the pc, and transfers control. figure 24-9 illustrates the proce ssing of a software exception. figure 24-9. software exception processing trap instruction eipc eipsw ecr.eicc psw.ep psw.id pc restored pc psw exception code 1 1 handler address cpu processing exception processing note note trap instruction format: trap vector (t he vector is a value from 00h to 1fh.) the handler address is determined by the tr ap instruction?s operand (vector). if the vector is 00h to 0fh, it becomes 00000040h, and if the vector is 10h to 1fh, it becomes 00000050h.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1306 24.4.2 restore recovery from software exception processing is carried out by the reti instruction. by executing the reti instruction, t he cpu carries out the following processi ng and shifts control to the restored pc?s address. <1> loads the restored pc and psw from ei pc and eipsw because the psw.ep bit is 1. <2> transfers control to the address of the restored pc and psw. figure 24-10 illustrates the proce ssing of the reti instruction. figure 24-10. reti instruction processing psw.ep reti instruction pc psw eipc eipsw psw.np original processing restored pc psw fepc fepsw 1 1 0 0 caution when the ep and np bits are changed by the ldsr instruction during the software exception processing, in order to restore the pc and psw correctly during recovery by the reti instruction, it is necessary to set the ep bit back to 1 and the np bit back to 0 using the ldsr instruction immediately befo re the reti instruction. remark the solid line shows the cpu processing flow.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1307 24.4.3 ep flag the ep flag is a status flag used to indica te that exception processing is in progress. it is set when an exception occurs. 0 np ep id sat cy ov s z psw exception processing not in progress. exception processing in progress. ep 0 1 exception processing status after reset: 00000020h
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1308 24.5 exception trap an exception trap is an interrupt that is requested when the illegal execution of an instruction takes place. in the v850e/sj3-h and v850e/sk3-h, an illegal opcode exception (i lgop: illegal opcode trap) is considered as an exception trap. 24.5.1 illegal opcode definition the illegal instruction has an opcode (bits 10 to 5) of 111111b, a sub-opcode (bits 26 to 23) of 0111b to 1111b, and a sub-opcode (bit 16) of 0b. an exception trap is generated when an instruction applicable to this illegal instruction is executed. 15 16 23 22 xxxxxx0 x x x x x x x x x x 1 1 1 1 1 1 x x x x x 27 26 31 0 4 5 10 11 1 1 1 1 1 1 0 1 to x: arbitrary caution since it is possible to assign this instruction to an illegal opcode in the future, it is recommended that it not be used. (1) operation if an exception trap occurs, the cpu performs the followi ng processing, and transfers control to the handler routine. <1> saves the restored pc to dbpc. <2> saves the current psw to dbpsw. <3> sets the psw.np, psw.ep, and psw.id bits to 1. <4> sets the handler address (00000060h) correspondi ng to the exception trap to the pc, and transfers control. figure 24-11 illustrates the processing of the exception trap.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1309 figure 24-11. exception trap processing exception trap (ilgop) occurs dbpc dbpsw psw.np psw.ep psw.id pc restored pc psw 1 1 1 00000060h exception processing cpu processing (2) restore recovery from an exception trap is carried out by the dbret instruction. by executing the dbret instruction, the cpu carries out the following proce ssing and controls the address of the restored pc. <1> loads the restored pc and psw from dbpc and dbpsw. <2> transfers control to the address indicated by the restored pc and psw. caution dbpc and dbpsw can be accessed after the illegal opcode is executed and before the dbret instruction is executed. figure 24-12 illustrates the restore processing from an exception trap. figure 24-12. restore processing from exception trap dbret instruction pc psw dbpc dbpsw jump to address of restored pc
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1310 24.5.2 debug trap a debug trap is an exception that is generated when the dbtrap instru ction is executed and is always acknowledged. (1) operation upon occurrence of a debug trap, the cpu performs the following processing. <1> saves restored pc to dbpc. <2> saves current psw to dbpsw. <3> sets the psw.np, psw.ep, and psw.id bits to 1. <4> sets handler address (00000060h) for debug trap to pc and transfers control. figure 24-13 shows the debug trap processing format. figure 24-13. debug trap processing format dbtrap instruction dbpc dbpsw psw.np psw.ep psw.id pc restored pc psw 1 1 1 00000060h debug monitor routine cpu processing
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1311 (2) restoration restoration from a debug trap is exec uted with the dbret instruction. with the dbret instruction, the cp u performs the following steps and transf ers control to the address of the restored pc. <1> the restored pc and psw are read from dbpc and dbpsw. <2> control is transferred to the fetc hed address of the restored pc and psw. caution dbpc and dbpsw can be accessed after the dbtrap instruction is executed and before the dbret instruction is executed. figure 24-14 shows the processing format for restoration from a debug trap. figure 24-14. processing format of restoration from debug trap dbret instruction pc psw dbpc dbpsw jump to address of restored pc
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1312 24.6 external interrupt request input pins (nmi and intp0 to intp9) 24.6.1 noise elimination (1) eliminating noise on nmi pin the nmi pin has an internal noise elimination circuit that uses analog delay. therefor e, the input level of the nmi pin is not detected as an edge unless it is maintained for a specific time or longer. therefore, an edge is detected after specific time. the nmi pin can be used to release the stop mode. in the stop mode, noise is not eliminated by using the system clock because the internal system clock is stopped. (2) eliminating noise on intp0 to intp9 pins the intp0 to intp9 pins have an internal noise elimination circuit that uses analog delay. therefore, the input level of the nmi pin is not detected as an edge unless it is maintained for a specific time or longer. therefore, an edge is detected after specific time. 24.6.2 edge detection the valid edge of each of the nmi and intp0 to in tp9 pins can be selected from the following four. ? rising edge ? falling edge ? both rising and falling edges ? no edge detected cautions 1. the edge of the nmi pin is not detected after reset. therefore, the interrupt request signal is not acknowledged unless a valid edge is enable d by using the intf0 and intr0 register (the nmi pin functions as a normal port pin). 2. in v850e/sj3-h and v850e/sk3-h, the same exte rnal interrupt request input pins are assigned to two ports. therefore, the setting of each valid edge is set independently in the register corresponding to each port. be sure to use the external interrupt request input pin in either of the two ports. set the valid edge detection of the external interrupt request input pin of the port not being used to ?no edge detected?.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1313 ? relationship between the external interrupt request input pin and the valid edge setting register sharing one port (a) v850e/sj3-h port <1> port <2> pin name pin no. port function valid edge setting register pin no. port function valid edge setting register intp2 20 p05 intf0.intf05, intr0.intr05 24 p42 intf4.intf42, intr4.intr42 intp5 75 p914 intf9.intf914, intr9.intr914 66 p95 intf9l.intf95, intr9l.intr95 intp7 26 p31 intf3.intf31, intr3.intr31 38 p51 intf5.intf51, intr5.intr51 intp8 59 p80 intf8.intf80, intr8.intr80 64 p93 intf9l.intf93, intr9l.intr93 (b) v850e/sk3-h port <1> port <2> pin name pin no. port function valid edge setting register pin no. port function valid edge setting register intp2 22 p05 intf0.intf05, intr0.intr05 26 p42 intf4.intf42, intr4.intr42 intp5 91 p914 intf9.intf914, intr9.intr914 82 p95 intf9l.intf95, intr9l.intr95 intp6 92 p915 intf9.intf915, intr9.intr915 96 p153 intf15.intf153, intr15.intr153 intp7 31 p31 intf3.intf31, intr3.intr31 46 p51 intf5.intf51, intr5.intr51 intp8 71 p80 intf8.intf80, intr8.intr80 80 p93 intf9l.intf93, intr9l.intr93 intp9 59 p66 intf6.intf66, intr6.intr66 95 p152 intf15.intf152, intr15.intr152
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1314 (1) external interrupt fallin g, rising edge specification register 0 (intf0, intr0) the intf0 and intr0 registers are 8-bit registers that specify detection of the falling and rising edges of the nmi pin via bit 2 and the external interrupt pins (intp0 to intp3) via bits 3 to 6. these registers can be read or written in 8-bit or 1-bit units. reset sets these registers to 00h. caution when the function is changed from the extern al interrupt function (alternate function) to the port function, an edge may be detected. there fore, clear the intf0n and intr0n bits to 00, and then set the port mode. 0 intf0 intf06 intp3 intf05 intf04 intf03 intf02 0 0 after reset: 00h r/w address: intf0 fffffc00h, intr0 fffffc20h 0 intr0 intr06 intr05 intr04 intr03 intr02 0 0 intp2 intp1 intp0 nmi intp3 intp2 intp1 intp0 nmi remark for how to specify a valid edge, see table 24-3 . table 24-3. valid edge specification intf0n intr0n valid edge specification (n = 2 to 6) 0 0 no edge detected 0 1 rising edge 1 0 falling edge 1 1 both rising and falling edges caution be sure to clear the intf0n and intr0n bi ts to 00 when these regist ers are not used as the nmi or intp0 to intp3 pins. remark n = 2: control of nmi pin n = 3 to 6: control of intp0 to intp3 pins
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1315 (2) external interrupt fallin g, rising edge specification register 3 (intf3, intr3) the intf3 and intr3 registers are 8-bit registers that specify detection of the falling and rising edges of the external interrupt pin (intp7). these registers can be read or written in 8-bit or 1-bit units. reset sets these registers to 00h. cautions 1. when the function is changed from the external interrupt function (alternate function) to the port function, an edge may be detected. therefore, clear the intf31 and intr31 bits to 00, and then set the port mode. 2. the intp7 pin and rxda0 pin are alternat e-function pins. when using the pin as the rxda0 pin, disable edge detection for th e intp7 alternate-function pin (clear the intf3.intf31 bit and the inrt3.intr31 bit to 0) . when using the pin as the intp7 pin, stop uarta0 reception (clear the ua0ctl0.ua0rxe bit to 0). intf3 after reset: 00h r/w address: intf3 fffffc06h, intr3 fffffc26h 0 0 0 0 0 0 intf31 0 intr3 0 0 0 0 0 0 intr31 0 intp7 intp7 remark for how to specify a valid edge, see table 24-4 . table 24-4. valid edge specification intf31 intr31 valid edge specification 0 0 no edge detected 0 1 rising edge 1 0 falling edge 1 1 both rising and falling edges caution be sure to clear the intf31 and intr31 bits to 00 when these re gisters are not used as intp7 pin.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1316 (3) external interrupt fallin g, rising edge specification register 4 (intf4, intr4) the intf4 and intr4 registers are 8-bit registers that specify detection of the falling and rising edges of the external interrupt pin (intp2). these registers can be read or written in 8-bit or 1-bit units. reset sets these registers to 00h. caution when the function is changed from the extern al interrupt function (alternate function) to the port function, an edge may be detected. there fore, clear the intf42 and intr42 bits to 00, and then set the port mode. intf4 after reset: 00h r/w address: intf4 fffffc08h, intr4 fffffc28h 0 0 0 0 0 intf42 0 0 intr4 0 0 0 0 0 intr42 0 0 intp2 intp2 remark for how to specify a valid edge, see table 24-5 . table 24-5. valid edge specification intf42 intr42 valid edge specification 0 0 no edge detected 0 1 rising edge 1 0 falling edge 1 1 both rising and falling edges caution be sure to clear the intf42 and intr42 bits to 00 when these re gisters are not used as intp2 pin.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1317 (4) external interrupt fallin g, rising edge specification register 5 (intf5, intr5) the intf5 and intr5 registers are 8-bit registers that specify detection of the falling and rising edges of the external interrupt pin (intp7). these registers can be read or written in 8-bit or 1-bit units. reset sets these registers to 00h. caution when the function is changed from the extern al interrupt function (alternate function) to the port function, an edge may be detected. there fore, clear the intf51 and intr51 bits to 00, and then set the port mode. intf5 after reset: 00h r/w address: intf5 fffffc0ah, intr5 fffffc2ah 0 0 0 0 0 0 intf51 0 intr5 0 0 0 0 0 0 intr51 0 intp7 intp7 remark for how to specify a valid edge, see table 24-6 . table 24-6. valid edge specification intf51 intr51 valid edge specification 0 0 no edge detected 0 1 rising edge 1 0 falling edge 1 1 both rising and falling edges caution be sure to clear the intf51 and intr51 bits to 00 when these re gisters are not used as intp7 pin.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1318 (5) external interrupt fallin g, rising edge specification register 6 (intf6, intr6) the intf6 and intr6 registers are 8-bit registers that specify detection of the falling and rising edges of the external interrupt pin (intp9). these registers can be read or written in 8-bit or 1-bit units. reset sets these registers to 00h. caution when the function is changed from the extern al interrupt function (alternate function) to the port function, an edge may be detected. there fore, clear the intf66 and intr66 bits to 00, and then set the port mode. intf6 after reset: 00h r/w address: intf6 fffffc0ch, intr6 fffffc2ch 0 intf66 0 0 0 0 0 0 intr6 0 intr66 0 0 0 0 0 0 intp9 intp9 remark for how to specify a valid edge, see table 24-7 . table 24-7. valid edge specification intf66 intr66 valid edge specification 0 0 no edge detected 0 1 rising edge 1 0 falling edge 1 1 both rising and falling edges caution be sure to clear the intf66 and intr66 bits to 00 when these re gisters are not used as intp9 pin.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1319 (6) external interrupt fallin g, rising edge specification register 8 (intf8, intr8) the intf8 and intr8 registers are 8-bit registers that specify detection of the falling and rising edges of the external interrupt pin (intp8). these registers can be read or written in 8-bit or 1-bit units. reset sets these registers to 00h. cautions 1. when the function is changed from the external interrupt function (alternate function) to the port function, an edge may be detected. therefore, clear the intf80 and intr80 bits to 00, and then set the port mode. 2. the intp8 pin and rxda3 pin are alternat e-function pins. when using the pin as the rxda3 pin, disable edge detection for th e intp8 alternate-function pin (clear the intf8.intf80 bit and the intr8.intr80 bit to 0) . when using the pin as the intp8 pin, stop uarta3 reception (clear the ua3ctl0.ua3rxe bit to 0). 3. be sure to set bits 1 to 7 of the intf8 and intr8 registers to 0. intf8 after reset: 00h r/w address: intf8 fffffc10h, intr8 fffffc30h 0 0 0 0 0 0 0 intf80 intr8 0 0 0 0 0 0 0 intr80 intp8 intp8 remark for how to specify a valid edge, see table 24-8 . table 24-8. valid edge specification intf80 intr80 valid edge specification 0 0 no edge detected 0 1 rising edge 1 0 falling edge 1 1 both rising and falling edges caution be sure to clear the intf80 and intr80 bits to 00 when these re gisters are not used as intp8 pin.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1320 (7) external interrupt fallin g, rising edge specification register 9 (intf9, intr9) the intf9h and intr9h registers are 8-bit registers that specify detection of the falling and rising edges of the external interrupt pins (intp4 to intp6, intp8). these registers can be read or written in 8-bit or 1-bit units. reset sets these registers to 0000h. caution when the function is changed from the extern al interrupt function (alternate function) to the port function, an edge may be detected. therefore, clear the intf9n and intr9n bits to 0, and then set the port mode. intf9 (intf9h note ) intf915 intf914 intf913 0 0 0 0 0 8 9 10 11 12 13 14 15 (intf9l) 0 0 intf95 0 intf93 0 0 0 0 1 2 3 4 5 6 7 intp6 intp5 intp4 intp8 intp5 intr9 (intr9h note ) intr915 intr914 intr913 0 0 0 0 0 8 9 10 11 12 13 14 15 (intr9l) 0 0 intr95 0 intr93 0 0 0 0 1 2 3 4 5 6 7 intp6 intp5 intp4 intp8 intp5 after reset: 0000h r/w address: intf9 fffffc12h, intf9l fffffc12h, intf9h fffffc13h after reset: 0000h r/w address: intr9 fffffc32h, intr9l fffffc32h, intr9h fffffc33h note if bits 8 to 15 of the intf9 and intr9 registers are read or written in 8-bit or 1-bit units, specify them as bits 0 to 7 of the intf9h and intr9h registers. remark for how to specify a valid edge, see table 24-9 . table 24-9. valid edge specification intf9n intr9n valid edge specification (n = 3, 5, 13 to 15) 0 0 no edge detected 0 1 rising edge 1 0 falling edge 1 1 both rising and falling edges caution be sure to clear the intf9n and intr9n bi ts to 00 when these regist ers are not used as any of pins intp4 to intp6, and intp8. remark n = 3, 5, 13 to 15: control of intp4 to intp6, and intp8 pins
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1321 (8) external interrupt falling/risi ng edge specification register 15 (in tf15, intr15) (v850e/sk3-h only) the intf15 and intr15 registers are 8-bit registers that specify detection of the falling and rising edges of the external interrupt pin (intp6, intp9). these registers can be read or written in 8-bit or 1-bit units. reset sets these registers to 00h. cautions 1. when the function is changed from the external interrupt function (alternate function) to the port function, an edge may be detected . therefore, clear the intf15n and intr15n bits to 00, and then set the port mode. 2. be sure to set bits 0, 1, and 4 to 7 of the intf15 and intr15 registers to 0. intf15 after reset: 00h r/w address: intf15 fffffc1eh note , intr15 fffffc3eh note 0 0 0 0 intf153 intf152 0 0 intr15 0 0 0 0 intr153 intr152 0 0 intp6 intp6 intp9 intp9 note v850e/sk3-h only. remark for how to specify a valid edge, see table 24-10 . table 24-10. valid edge specification intf15n intr15n valid edge specification 0 0 no edge detected 0 1 rising edge 1 0 falling edge 1 1 both rising and falling edges caution be sure to clear the intf15n and intr15 n bits to 00 when these re gisters are not used as intp6 or intp9 pin. remark n = 2, 3: control of intp6 and intp9 pins
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1322 (9) noise elimination control register (nfc) digital noise elimination can be selected for the intp3 pi n. the noise elimination settings are performed using the nfc register. when digital noise elimination is selected, the sampling clock for digital sampling can be selected from among f xp /64, f xp /128, f xp /256, f xp /512, f xp /1,024, and f xt . sampling is performed three times. when digital noise elimination is selected, if the cloc k that performs sampling in the standby mode is stopped, then the intp3 interrupt request signal cannot be used for releasing the standby mode. when f xt is used as the sampling clock, the intp3 interrupt request signal c an be used for releasing either the subclock operating mode or the idle1/idle2/stop/sub-idle mode. this register can be read or written in 8-bit units. reset sets this register to 00h. caution after the sampling clock has been changed, it takes 3 sampling clocks to initialize the digital noise eliminator. therefore, if an intp3 valid edge is input within these 3 sampling clocks after the sampling clock has been changed, an interrupt request signal may be generated. therefore, be careful about the following points when using the interrupt and dma functions. ? when using the interrupt function, after the 3 sampling clocks have elapsed, enable interrupts after the interrupt request flag (pic3.pif3 bit) has been cleared. ? when using the dma function (started by intp3), enable dma after 3 sampling clocks have elapsed. nfen nfc 0 0 0 0 nfc2 nfc1 nfc0 f xp /64 f xp /128 f xp /256 f xp /512 f xp /1,024 f xt (subclock) nfc2 0 0 0 0 1 1 digital sampling clock setting prohibited nfc1 0 0 1 1 0 0 nfc0 0 1 0 1 0 1 after reset: 00h r/w address: fffff318h analog noise elimination (60 ns (typ.)) digital noise elimination nfen 0 1 settings of intp3 pin noise elimination other than above caution be sure to set bits 3 to 6 to ?0?. remarks 1. since sampling is performed three times, the reliably eliminated noise width is 2 sampling clocks. 2. in the case of noise with a width smaller than 2 sampling clocks, an interrupt request signal is generated if noise synchronized with the sampling clock is input.
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1323 24.7 interrupt acknowledge time of cpu except the following cases, the interrupt acknowledge time of the cpu is 4 clocks minimum. to input interrupt request signals successively, input the next interrupt req uest signal at least 4 clocks after the preceding interrupt. ? in idle1/idle2/stop mode ? when the external bus is accessed ? when interrupt request non-sampling instructions are successively executed (see 24.8 periods in which interrupts are not acknowledged by cpu .) ? when the interrupt control register is accessed ? when an on-chip peripheral i/o register is accessed ? when a programmable peripheral i/o register is accessed
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1324 figure 24-15. pipeline operation at interr upt request signal acknowledgment (outline) (1) minimum interrupt response time if id ex ifx idx int2 int3 int4 int1 if id ex wb if df ifx if 4 system clocks internal system clock instruction 1 instruction 2 interrupt acknowledgment operation first instruction of interrupt servicing routine interrupt acknowledgment interleave access (2) maximum interrupt response time if id ex mem mem ifx idx int2 int3 int4 int1 if mem wb int3 int3 mem if ifx int3 if 7 system clocks internal system clock instruction 1 instruction 2 interrupt acknowledgment operation first instruction of interrupt servicing routine interrupt acknowledgment interleave access remarks 1. int1 to int4: interrupt acknowledgment processing ifx: invalid instruction fetch idx: invalid instruction decode 2. if the same interrupt request signal is generated while an interrupt of four cycles is being acknowledged, the new interrupt request signal is discarded. the next interrupt request signal from the same source is registered four cycles later. interrupt response time (internal system clock) internal interrupt external interrupt condition minimum 4 4 + analog delay time maximum 7 7 + analog delay time the following cases are exceptions. ? in idle1/idle2/stop mode ? external bus access ? two or more interrupt request non-sample instructions are executed in succession ? access to interrupt control register ? access to on-chip per ipheral i/o register ? access to programmable peripheral i/o register
chapter 24 interrupt/exception processing function user?s manual u19201ej3v0ud 1325 24.8 periods in which interrupts are not acknowledged by cpu an interrupt is acknowledged by the cpu while an instru ction is being executed. however, no interrupt will be acknowledged between an interrupt request non-sample instructi on and the next instruction (int errupt is held pending). the interrupt request non-sample instructions are as follows. ? ei instruction ? di instruction ? ldsr reg2, 0x5 instruction (for psw) ? the store instruction for the prcmd register ? the store, set1, not1, or clr1 inst ructions for the following registers. ? interrupt-related registers: interrupt control register (xxicn), interrupt ma sk registers 0 to 6, 7l (imr0 to imr6, imr7l) ? power save control register (psc) ? on-chip debug mode register (ocdm) remark xx: identification name of each peripheral unit (see table 24-2 interrupt control register (xxicn) ) n: peripheral unit number (see table 24-2 interrupt control register (xxicn) ). 24.9 cautions (1) nmi pin the nmi pin alternately functions as the p02 pin. it func tions as the p02 pin after reset. to enable the nmi pin, validate the nmi pin with the pmc0 register. the initial setting of the nmi pin is ?no edge detected?. select the nmi pin valid edge using the intf0 and intr0 registers. (2) interrupt control register (xxicn) when manipulating the xxicn.xxmkn bit while interrupt requests may occur (including the state in which interrupts are disabled (di)), be sure to use a bit manipulation instruction or use the imrm.xxmkn or imr7l.xxmkn bit (m = 0 to 6). (3) in-service priority register (ispr) if an interrupt is acknowledged while the ispr register is being read in the interrupt enabled (ei) status, the value of the ispr register after the bits of the register have been set by acknowledging the interrupt may be read. to accurately read the value of the ispr register before an interrupt is acknowledged, read the register while interrupts are disabled (di). (4) switching dma transfer start factors in the v850e/sj3-h and v850e/sk3-h, because the intp8 signal and the inttm2eq0 signal of the dma transfer start factors are used alternately, they cannot be used at the same time. when the intp8 signal is used as a dma transfer start factor, set the dtfrob0 bit in option byte 0000007ah to 0 (refer to chapter 33 option byte function ). in this case, the inttm2eq0 signal cannot be used as the dma transfer start factors. remark for details, see table 22-1 dma transfer start factors .
user?s manual u19201ej3v0ud 1326 chapter 25 key interrupt function 25.1 function a key interrupt request signal (intkr) can be generated by inputting a falling edge to the eight key input pins (kr0 to kr7) by setting the krm register. table 25-1. assignment of key return detection pins flag pin description krm0 controls kr0 signal in 1-bit units krm1 controls kr1 signal in 1-bit units krm2 controls kr2 signal in 1-bit units krm3 controls kr3 signal in 1-bit units krm4 controls kr4 signal in 1-bit units krm5 controls kr5 signal in 1-bit units krm6 controls kr6 signal in 1-bit units krm7 controls kr7 signal in 1-bit units figure 25-1. key re turn block diagram intkr key return mode register (krm) krm7 krm6 krm5 krm4 krm3 krm2 krm1 krm0 kr7 kr6 kr5 kr4 kr3 kr2 kr1 kr0
chapter 25 key interrupt function user?s manual u19201ej3v0ud 1327 25.2 register (1) key return mode register (krm) the krm register controls the krm0 to krm7 bits using the kr0 to kr7 signals. this register can be read or writt en in 8-bit or 1-bit units. reset sets this register to 00h. krm7 does not detect key return signal detects key return signal krmn 0 1 control of key return mode krm krm6 krm5 krm4 krm3 krm2 krm1 krm0 after reset: 00h r/w address: fffff300h caution rewrite the krm register after once clearing the krm register to 00h. remark for the alternate-function pin settings, see table 4-25 using port pin as alternate function pin . 25.3 cautions (1) low level input to the kr0 to kr7 pins if a low level is input to any of the kr0 to kr7 pins, the intkr signal is not generated even if the falling edge of another pin is input. (2) use of the kr7 and rxda1 pins at the same time the kr7 and rxda1 pins must not be used at the same time. in the v850e/sk3-h, the kr7 and rxda1 pins are assigned to two ports each, and cannot be us ed at the same time at different ports. to use the kr7 pin, set the ua1ctl0.ua1rxe bit to 0 (it is recommended to set the pfc91 bit to 1 and pfce91 bit to 0 when using the kr7 pin at p91). to use the rxda1 pin, set the krm.krm7 bit of the kr7 pin to 0.
chapter 25 key interrupt function user?s manual u19201ej3v0ud 1328 (3) use of the krn and tiq0m pins at the same time the krn and tiq0m pins must not be us ed at the same time (n = 0 to 3, m = 0 to 3). the kr2 and tiq03 pins and the kr3 and tiq00 pins are assigned to two por ts each, and cannot be used at the same time at different ports. settings for using the krn or tiq0m pin are shown below. pin name when using pin as tiq0 m pin when using pin as krn pin kr0/tiq01 krm.krm0 bit = 0 tq0ioc1.tq0is3, tq0is2 bits = 00 kr1/tiq02 krm.krm1 bit = 0 tq0ioc1.tq0is5, tq0is4 bits = 00 kr2/tiq03 krm.krm2 bit = 0 tq0ioc1.tq0is7, tq0is6 bits = 00 kr3/tiq00 krm.krm3 bit = 0 tq0ioc1.tq0is1, tq0is0 bits = 00 tq0ioc2.tq0ees1, tq0ees0 bits = 00 tq0ioc2.tq0ets1, tq0ets0 bits = 00 (4) notes on setting the krm register if the krm register is changed, an interrupt request signal (intkr) may be generated. to prevent this, change the krm register after disabling interrupts (di) or masking, then clear the interrupt request flag (kric.krif bit) to 0, and enable interrupts (ei) or clear the mask. (5) switching between port mode and alternate-function mode to use the key interrupt function, be sure to set the port pin to the key return pin and then enable the operation with the krm register. to switch from the key return pin to the port pin, disable the operation with the krm register and then set the port pin. (6) switching dma transfer start factor in the v850e/sj3-h and v850e/sk3-h, the intkr signal and the inttm1eq0 signal, both being the dma transfer start factors, are alternate f unctions of the same pin, and they c annot be used at the same time. to use the intkr signal as the dma transfer start fact or, set the dtfrob0 bit in the option byte area 0000007ah to 0 (refer to chapter 33 option byte function ). in this case, the inttm1eq0 signal cannot be used as the dma transfer start factor. remark for details, see table 22-1 dma transfer start factors .
user?s manual u19201ej3v0ud 1329 chapter 26 standby function 26.1 overview the power consumption of the system can be effectively reduced by using the standby modes in combination and selecting the appropriate mode for the application. the available stan dby modes are listed in table 26-1. table 26-1. standby modes mode functional outline halt mode mode in which only the operating clock (f cpu ) of the cpu is stopped idle1 mode mode in which all the operations of the internal circuits except the oscillator, pll note , sscg note , and flash memory are stopped idle2 mode mode in which all the operations of the internal circuits except the oscillator are stopped stop mode mode in which all the operations of the internal circuits except the subclock oscillator and internal oscillator are stopped subclock operation mode mode in which the subclock is used as the internal system clock sub-idle mode mode in which all the operations of the internal circuits except the oscillator are stopped, in the subclock operation mode note the pll and sscg hold the previous operating status.
chapter 26 standby function user?s manual u19201ej3v0ud 1330 26.2 registers (1) power save control register (psc) the psc register is an 8-bit register t hat controls the standby function. the stp bit of this register is used to specify the standby mode. this regist er is a special register that can be written only by the special sequence combinations (see 3.4.8 special registers ). this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 psc nmi1m nmi0m intm 0 0 stp 0 7 <6> <5> <4> 3 2 <1> 0 after reset: 00h r/w address: fffff1feh standby mode release by intwdt2 signal enabled standby mode release by intwdt2 signal disabled nmi1m 0 1 standby mode release control upon occurrence of intwdt2 signal standby mode release by nmi pin input enabled standby mode release by nmi pin input disabled nmi0m 0 1 standby mode release control by nmi pin input standby mode release by maskable interrupt request signal enabled standby mode release by maskable interrupt request signal disabled intm 0 1 standby mode release control via maskable interrupt request signal normal mode standby mode stp 0 1 standby mode note setting note standby mode set by stp bit: idle1, idle2, stop, or sub-idle mode cautions 1. before setting the idle1, idle2, stop, or sub-idle mode, set the psmr.psm1 and psmr.psm0 bits and then set the stp bit. 2. settings of the nmi1m, nmi0m, and in tm bits are invalid when halt mode is released. 3. if the nmi1m, nmi0m, or intm bit is set to 1 at the same ti me the stp bit is set to 1, the setting of nmi1m, nmi0m, or in tm bit becomes invalid. if there is an unmasked interrupt request signal being held pending when the idle1/idle2/stop mode is set, set the bit corresponding to the interrupt request signal (nmi1m, nmi0m, or intm) to 1, and then set the stp bit to 1. 4. be sure to set bits 0, 2, 3, and 7 to ?0?.
chapter 26 standby function user?s manual u19201ej3v0ud 1331 (2) power save mode register (psmr) the psmr register is an 8-bit regist er that controls the operation st atus in the power save mode. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. 0 idle1, sub-idle modes stop, sub-idle modes idle2, sub-idle modes stop mode psm1 0 0 1 1 specification of operation in software standby mode psmr 0 0 0 0 0 psm1 psm0 after reset: 00h r/w address: fffff820h psm0 0 1 0 1 < > < > cautions 1. be sure to cl ear bits 2 to 7 to ?0?. 2. the psm0 and psm1 bits are valid only when the psc.stp bit is 1. remark idle1: in this mode, all operations except the oscillator operation and some other circuits (flash memory, pll, and sscg) are stopped. after the idle1 mode is released, the norma l operation mode is restored without needing to secure the oscillation stabilization time, like the halt mode. idle2: in this mode, all operations ex cept the oscillator operation are stopped. after the idle2 mode is released, the nor mal operation mode is restored following the lapse of the setup time specified by the os ts register (flash memory, pll, and sscg). stop: in this mode, all operations except the subclock oscillator operation are stopped. after the stop mode is released, the normal operation mode is restored following the lapse of the oscillation stabilization time specified by the osts register. sub-idle: in this mode, all other operations are halte d except for the oscillator. after the idle mode has been released by the interrupt request signal, the subclock operation mode will be restored after 12 cycles of the subclock have been secured.
chapter 26 standby function user?s manual u19201ej3v0ud 1332 (3) oscillation stabilization time select register (osts) the wait time until the main oscillati on stabilizes after the stop mode is re leased or the wait time until the on- chip flash memory stabilizes after the idle2 mode is released is controlled by the osts register. the osts register can be read or written 8-bit units. reset sets this register to 06h. (1/2) 0 osts 0 0 0 0 osts2 osts1 osts0 osts2 0 0 0 0 1 1 1 1 selection of oscillation stabilization time/setup time note osts1 0 0 1 1 0 0 1 1 osts0 0 1 0 1 0 1 0 1 after reset: 06h r/w address: fffff6c0h 2 10 /f x 2 11 /f x 2 12 /f x 2 13 /f x 2 14 /f x 2 15 /f x 2 16 /f x 4 mhz 0.256 ms 0.512 ms 1.024 ms 2.048 ms 4.096 ms 8.192 ms 16.38 ms 5 mhz 0.205 ms 0.410 ms 0.819 ms 1.638 ms 3.277 ms 6.554 ms 13.107 ms f x setting prohibited note the oscillation stabilization time and setu p time are required when the stop mode and idle2 mode are released, respectively. remark f x : main oscillation clock frequency cautions 1. the wait time following release of the stop mode does not include the time until the clock oscillation starts (?a? in the figure below) following release of the stop mode, regardless of whether th e stop mode is released by reset or the occurrence of an in terrupt request signal. a stop mode release voltage waveform of x1 pin v ss 2. be sure to clear bits 3 to 7 to ?0?. 3. the oscillation stabilization ti me following reset release is 2 16 /f x (because the initial value of the osts register = 06h).
chapter 26 standby function user?s manual u19201ej3v0ud 1333 (2/2) cautions 4. in clock mode 1, if the syst em shifts to idle2 mode while the pll is operating, be sure to set a setup time of at least 800 s to be inserted after idle2 mode is released. if the pll is stopped, set a setup time of at least 350 s to be inserted after idle2 mode is released. 5. in clock mode 1, if the system shifts to stop mode while th e pll is operating, be sure to set an oscillation stabilizatio n time of at least 1 ms to be inserted after stop mode is released. 6. in clock modes 2, 3, and 4, if the system shifts to idle2 mode while the sscg is operating, be sure to set a setup time of at least 1 ms to be inserted after idle2 mode is released. if the sscg is stopped, set a setup time of at least 800 s to be inserted after idle2 mode is released. 7. in clock modes 2, 3, and 4, if the system shifts to stop mode while the sscg is operating, be sure to set an oscillation stabilization time of at least 2 ms to be inserted after stop mode is released.
chapter 26 standby function user?s manual u19201ej3v0ud 1334 26.3 halt mode 26.3.1 setting and operation status the halt mode is set when a dedicated instruction (halt) is executed in the normal operation mode. in the halt mode, the clock oscillator continues operating. only clock s upply to the cpu is stopped; clock supply to the other on-chip peripheral functions continues. as a result, program execution is stopped, and the inte rnal ram and expanded internal ram retain the contents before the halt mode was set. the on-chip peripheral func tions that are independent of instruction processing by the cpu continue operating. table 26-3 shows the operating status in the halt mode. the average current consumpt ion of the system can be reduced by usi ng the halt mode in combination with the normal operation mode for intermittent operation. cautions 1. insert five or more nop in structions after the halt instruction. 2. if the halt instruction is executed while an unmasked interrupt request signal is being held pending, the status shifts to halt mode, but th e halt mode is then released immediately by the pending interrupt request. 26.3.2 releasing halt mode the halt mode is released by a non-maskable interrupt request signal (nmi pin input, intwdt2 signal), unmasked external interrupt request signal (intp0 to intp 9 pin input), unmasked internal interrupt request signal from a peripheral function operable in the halt mode, or reset signal (reset pin input, reset signal (wdt2res) generation by overflow of watchdog timer 2, reset signal (l vires) generation by low voltage detector (lvi), or reset signal (clmres) generation by clock monitor (clm)). after the halt mode has been released, the normal operation mode is restored. (1) releasing halt mode by non-m askable interrupt request signal or unmasked maskable interrupt request signal the halt mode is released by a non-maskable interrupt request signal or an unmasked maskable interrupt request signal, regardless of the priority of the interrupt request signal. if the halt mode is set in an interrupt servicing routine, however, an interrupt request si gnal that is issued later is serviced as follows. (a) if an interrupt request signal with a priority lower than that of the interrupt requ est currently being serviced is issued, the halt mode is released, but that interrupt request signal is not acknowledged. the interrupt request signal itself is retained. (b) if an interrupt request signal with a priority higher than that of the interrupt requ est currently being serviced is issued (including a non-maskable interrupt req uest signal), the halt mode is released and that interrupt request signal is acknowledged. table 26-2. operation after releasing ha lt mode by interrupt request signal release source interrupt enabled (ei) status interrupt disabled (di) status non-maskable interrupt request signal execution branches to the handler address. maskable interrupt request signal execution branches to the handler address or the next instruction is executed. the next instruction is executed.
chapter 26 standby function user?s manual u19201ej3v0ud 1335 (2) releasing halt mode by reset the same operation as the normal reset operation is performed. table 26-3. operating status in halt mode operating status setting of halt mode item when subclock is not used when subclock is used main clock oscillator oscillation enabled subclock oscillator ? oscillation enabled internal oscillator oscillation enabled pll operable sscg operable cpu stops operation dma operable interrupt controller operable rom correction stops operation timer p (tmp0 to tmp8) operable timer q (tmq0) operable tmm0 operable when a clock other than f xt is selected as the count clock operable tmm1 operable timer m tmm2 operable watch timer operable when f brg is selected as the count clock operable real-time counter (rtc) operable when f brg is selected as the count clock operable watchdog timer 2 operable when a clock other than f xt is selected as the count clock operable csib0 to csib5 operable csie0 note 1 , csie1 note 1 operable i 2 c00 to i 2 c03, i 2 c04 note 1 , i 2 c05 note 1 operable uarta0 to uarta5 operable serial interface uartb0, uartb1 operable can controller note 2 operable iebus controller operable a/d converter operable d/a converter operable real-time output function (rto) operable key interrupt function (kr) operable crc arithmetic circuit operable (in the status in which data is not input to crcin to stop the cpu) external bus interface see 2.3 pin states . port function retains status before halt mode was set internal data the cpu registers, statuses, data, and all other internal data such as the contents of the internal ram and expanded internal ram are retained as they were before the halt mode was set. notes 1. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v 850e/sj3-h), and 70f3933 (v850e/sj3-h) 2. can controller versions only
chapter 26 standby function user?s manual u19201ej3v0ud 1336 26.4 idle1 mode 26.4.1 setting and operation status the idle1 mode is set by clearing the psmr.psm1 and psmr .psm0 bits to 00 and setting the psc.stp bit to 1 in the normal operation mode. in the idle1 mode, the clock oscillat or, pll, sscg, and flash memory cont inue operating but the main clock (f xx ) and peripheral clock (f xp ) stop. as a result, program execution stops and the contents of the internal ra m and expanded internal ram before the idle1 mode was set are retained. the cpu and other on-chi p peripheral functions that operate on the main clock (f xx ) or peripheral clock (f xp ) stop operating. however, t he on-chip peripheral functions that can operate on the main oscillation clock (f x ), subclock (f xt ), internal oscillation clock (f r ) or an external clock continue operating. table 26-5 shows the operating status in the idle1 mode. the idle1 mode can reduce the power consumption more than the halt mode because it stops the operation of the on-chip peripheral functions. the main clock osc illator does not stop, so t he normal operation mode can be restored without waiting for the oscillation stabilization ti me after the idle1 mode has been released, in the same manner as when the halt mode is released. cautions 1. insert five or more nop instructions after the instruction th at stores data in the psc register to set the idle1 mode. 2. if the idle1 mode is set while an unmasked interrupt request signal is being held pending, the idle1 mode is released immediat ely by the pending interrupt request. 26.4.2 releasing idle1 mode the idle1 mode is released by a non-maskable interr upt request signal (nmi pin input, intwdt2 signal), unmasked external interrupt request signal (intp0 to intp 9 pin input), unmasked internal interrupt request signal from a peripheral function operable in the idle1 mode, or reset signal (reset pin in put, reset signal (wdt2res) generation by overflow of watchdog timer 2, reset signal (l vires) generation by low voltage detector (lvi), or reset signal (clmres) generation by clock monitor (clm)). after the idle1 mode has been released, the normal operation mode is restored. (1) releasing idle1 mode by non-maskable interr upt request signal or unmasked maskable interrupt request signal the idle1 mode is released by a non-maskable interr upt request signal or an unmasked maskable interrupt request signal, regardless of the priority of the interrupt request signal. if the idle1 mode is set in an interrupt servicing routine, however, an interrupt request si gnal that is issued later is processed as follows. (a) if an interrupt request signal with a priority lower than that of the interrupt requ est currently being serviced is issued, the idle1 mode is rel eased, but that interrupt request si gnal is not acknowledged. the interrupt request signal itself is retained. (b) if an interrupt request signal with a priority higher than that of the interrupt request currently being serviced is issued (including a non-maskable interrupt request signal), the idle1 mode is released and that interrupt request signal is acknowledged. caution an interrupt request signal that is disabled by setting the psc.nmi1m, psc.nmi0m, and psc.intm bits to 1 becomes invalid and idle1 mode is not released.
chapter 26 standby function user?s manual u19201ej3v0ud 1337 table 26-4. operation after releasing id le1 mode by interrupt request signal release source interrupt enabled (ei) status interrupt disabled (di) status non-maskable interrupt request signal execution branches to the handler address. maskable interrupt request signal execution branches to the handler address or the next instruction is executed. the next instruction is executed. (2) releasing idle1 mode by reset the same operation as the normal reset operation is performed.
chapter 26 standby function user?s manual u19201ej3v0ud 1338 table 26-5. operating status in idle1 mode operating status setting of idle1 mode item when subclock is not used when subclock is used main clock oscillator oscillation enabled subclock oscillator ? oscillation enabled internal oscillator oscillation enabled pll operable sscg operable cpu stops operation dma stops operation interrupt controller stops operation (but standby mode release is possible) rom correction stops operation timer p (tmp0 to tmp8) stops operation timer q (tmq0) stops operation tmm0 operable when intwt (when watch timer is operating) or f r /8 is selected as the count clock operable when intwt (when watch timer is operating) f r /8, or f xt is selected as the count clock tmm1 operable when f brg , f r /8, or inttm0eq0 (when tmm0 is operating) is selected as the count clock. timer m tmm2 operable when f brg , f r /8, or inttm1eq0 (when tmm1 is operating) is selected as the count clock. watch timer operable when f brg is selected as the count clock operable real-time counter (rtc) operable when f brg is selected as the count clock operable watchdog timer 2 operable when f r /8 is selected as the count clock operable when f r /8 or f xt is selected as the count clock csib0 to csib5 operable when the sckbn input clock is selected as the transfer clock (n = 0 to 5) csie0 note 1 , csie1 note 1 stops operation i 2 c00 to i 2 c03, i 2 c04 note 1 , i 2 c05 note 1 stops operation uarta0 to uarta5 stops operation (but uarta0 is operable when the ascka0 input clock is selected) serial interface uartb0, uartb1 stops operation can controller note 2 stops operation iebus controller stops operation a/d converter holds operation (conversion result held) note 3 d/a converter holds operation (output held note 3 ) real-time output function (rto) stops operation (output held) key interrupt function (kr) operable crc arithmetic circuit stops operation external bus interface see 2.3 pin states . port function retains status before idle1 mode was set internal data the cpu registers, statuses, data, and all other internal data such as the contents of the internal ram or expanded internal ram are retained as they were before the idle1 mode was set. notes 1. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v 850e/sj3-h), and 70f3933 (v850e/sj3-h) 2. can controller versions only 3. to realize low power consumption, stop the a/d converter and d/a converter before shifting to the idle1 mode.
chapter 26 standby function user?s manual u19201ej3v0ud 1339 26.5 idle2 mode 26.5.1 setting and operation status the idle2 mode is set by setting the psmr.psm1 and psmr. psm0 bits to 10 and setting the psc.stp bit to 1 in the normal operation mode. in the idle2 mode, the clock oscillator conti nues operation but supply of the main clock (f xx ) and peripheral clock (f xp ) to the pll and sscg stops. the flash memory stops operating. as a result, program execution stops and the contents of the internal ra m and expanded internal ram before the idle2 mode was set are retained. the cpu and other on-chi p peripheral functions that operate on the main clock (f xx ) or peripheral clock (f xp ) stop operating. however, t he on-chip peripheral functions that can operate on the main clock (f x ) oscillation, subclock (f xt ) or internal oscillation clock (f r ) continue operating. table 26-7 shows the operating status in the idle2 mode. the idle2 mode can reduce the power consumption more t han the idle1 mode because it stops the operations of the on-chip peripheral functions, pll, sscg, and flas h memory. however, because the pll, sscg, and flash memory are stopped, a setup time for the pll, sscg, and fl ash memory is required when idle2 mode is released. cautions 1. insert five or more nop instructions after the instruction th at stores data in the psc register to set the idle2 mode. 2. if the idle2 mode is set while an unmasked interrupt request signal is being held pending, the idle2 mode is released immediat ely by the pending interrupt request.
chapter 26 standby function user?s manual u19201ej3v0ud 1340 26.5.2 releasing idle2 mode the idle2 mode is released by a non-maskable interr upt request signal (nmi pin input, intwdt2 signal), unmasked external interrupt request signal (intp0 to intp 9 pin input), unmasked internal interrupt request signal from the peripheral functions operable in the idle2 mode, or reset signal (reset pin input, reset signal generation by overflow of watchdog timer 2 (wdt2res), reset signal gener ation by low voltage detector (lvi) (lvires), or reset signal generation by clock monitor (clm) (clmres)). the pll returns to the operating st atus it was in before the idle2 mode was set. after the idle2 mode has been released, the normal operation mode is restored. (1) releasing idle2 mode by non-maskable interr upt request signal or unmasked maskable interrupt request signal the idle2 mode is released by a non-maskable interr upt request signal or an unmasked maskable interrupt request signal, regardless of the priority of the interrupt request signal. if the idle2 mode is set in an interrupt servicing routine, however, an interrupt request si gnal that is issued later is processed as follows. (a) if an interrupt request signal with a priority lower than that of the interrupt requ est currently being serviced is issued, the idle2 mode is rel eased, but that interrupt request si gnal is not acknowledged. the interrupt request signal itself is retained. (b) if an interrupt request signal with a priority higher than that of the interrupt request currently being serviced is issued (including a non-maskable interrupt request signal), the idle2 mode is released and that interrupt request signal is acknowledged. caution the interrupt request si gnal that is disabled by setting the psc.nmi1m, psc.nmi0m, and psc.intm bits to 1 becomes invalid and idle2 mode is not released. table 26-6. operation after releasing id le2 mode by interrupt request signal release source interrupt enabled (ei) status interrupt disabled (di) status non-maskable interrupt request signal execution branches to the handler address after securing the prescribed setup time. maskable interrupt request signal execution branches to the handler address or the next instruction is executed after securing the prescribed setup time. the next instruction is executed after securing the prescribed setup time. (2) releasing idle2 mode by reset the same operation as the normal reset operation is performed.
chapter 26 standby function user?s manual u19201ej3v0ud 1341 table 26-7. operating status in idle2 mode operating status setting of idle2 mode item when subclock is not used when subclock is used main clock oscillator oscillation enabled subclock oscillator ? oscillation enabled internal oscillator oscillation enabled pll stops operation sscg stops operation cpu stops operation dma stops operation interrupt controller stops operation (but standby mode release is possible) rom correction stops operation timer p (tmp0 to tmp8) stops operation timer q (tmq0) stops operation tmm0 operable when intwt (when watch timer is operating) or f r /8 is selected as the count clock operable when intwt (when watch timer is operating), f r /8, or f xt is selected as the count clock tmm1 operable when f brg , f r /8, or inttm0eq0 (when tmm0 is operating) is selected as the count clock. timer m tmm2 operable when f brg , f r /8, or inttm1eq0 (when tmm1 is operating) is selected as the count clock. watch timer operable when f brg is selected as the count clock operable real-time counter (rtc) operable when f brg is selected as the count clock operable watchdog timer 2 operable when f r /8 is selected as the count clock operable when f r /8 or f xt is selected as the count clock csib0 to csib5 operable when the sckbn input clock is selected as the transfer clock (n = 0 to 5) csie0 note 1 , csie1 note 1 stops operation i 2 c00 to i 2 c03, i 2 c04 note 1 , i 2 c05 note 1 stops operation uarta0 to uarta5 stops operation (but uarta0 is operable when the ascka0 input clock is selected) serial interface uartb0, uartb1 stops operation can controller note 2 stops operation iebus controller stops operation a/d converter holds operation (conversion result held) note 3 d/a converter holds operation (output held note 3 ) real-time output function (rto) stops operation (output held) key interrupt function (kr) operable crc arithmetic circuit stops operation external bus interface see 2.3 pin states . port function retains status before idle2 mode was set internal data the cpu registers, statuses, data, and all other internal data such as the contents of the internal ram or expanded internal ram are retained as they were before the idle2 mode was set. notes 1. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v 850e/sj3-h), and 70f3933 (v850e/sj3-h) 2. can controller versions only 3. to realize low power consumption, stop the a/d converter and d/a converter before shifting to the idle2 mode.
chapter 26 standby function user?s manual u19201ej3v0ud 1342 26.5.3 securing setup time when releasing idle2 mode secure the setup time after releasing the idle2 mode because the operation of the pll, sscg, and flash memory stops after the idle2 mode is set. cautions 1. in clock mode 1, if the system shifts to idle2 mode while the pll is operating, be sure to set a setup time of at least 800 s to be inserted after idle2 mode is released. if the pll is stopped, set a setup time of at least 350 s to be inserted after id le2 mode is released. 2. in clock modes 2, 3, and 4, if the system shi fts to idle2 mode while th e sscg is operating, be sure to set a setup time of at least 1 ms to be inserted after idle2 mode is released. if the sscg is stopped, set a setup time of at least 800 s to be inserted after idle2 mode is released. (1) releasing idle2 mode by non-maskable interr upt request signal or unmasked maskable interrupt request signal secure the specified setup time by setting the osts register. when the releasing source is generated, the dedicated in ternal timer starts counting according to the osts register setting. when it overflows, the normal operation mode is restored. oscillated waveform rom circuit stopped setup time count main clock idle mode status interrupt request (2) release by reset this operation is the same as that of a normal reset. the oscillation stabilization time is the initial value of the osts register, 2 16 /f x .
chapter 26 standby function user?s manual u19201ej3v0ud 1343 26.6 stop mode 26.6.1 setting and operation status the stop mode is set by setting the psmr.psm1 and psmr .psm0 bits to 01 or 11 and setting the psc.stp bit to 1 in the normal operation mode. in the stop mode, the subclock oscillator and internal o scillator continue operating but the main clock oscillator stops. clock supply to the cpu and the on-c hip peripheral functions is stopped. as a result, program execution stops , and the contents of the internal ra m and expanded internal ram before the stop mode was set are retained. other on-chip peripheral functions stop operating. ho wever, on-chip peripheral functions that can oper ate with the subclock (f xt ), internal oscillation clock (f r ), or an external clock continue operating. table 26-9 shows the operating status in the stop mode. because the stop mode stops operation of the main clock oscillator, it reduc es the power consumption to a level lower than the idle2 mode. if the subclock oscillator, inte rnal oscillator, and external clock are not used, the power consumption can be minimized with only leakage current flowing. cautions 1. insert five or more nop instructions after the instruction th at stores data in the psc register to set the stop mode. 2. if the stop mode is set while an unmasked interrupt request signal is being held pending, the stop mode is released immediatel y by the pending interrupt request. 26.6.2 releasing stop mode the stop mode is released by a non-maskable interr upt request signal (nmi pin input, intwdt2 signal), unmasked external interrupt request signal (intp0 to intp 9 pin input), unmasked internal interrupt request signal from the peripheral functions operable in the stop mode, or reset signal (reset pin input, reset signal generation by overflow of watchdog timer 2 (wdt2res), or reset signa l generation by low voltage detector (lvi) (lvires)). after the stop mode has been released, the normal operation mode is restor ed after the oscillation stabilization time has been secured. (1) releasing stop mode by non-maskable interr upt request signal or unmasked maskable interrupt request signal the stop mode is released by a non-maskable interru pt request signal or an unmasked maskable interrupt request signal, regardless of the priority of the interrupt request signal. if the stop mode is set in an interrupt servicing routine, however, an interrupt request si gnal that is issued later is serviced as follows. (a) if an interrupt request signal with a priority lower than that of the interrupt requ est currently being serviced is issued, the stop mode is released, but that interrupt request signal is not acknowledged. the interrupt request signal itself is retained. (b) if an interrupt request signal with a priority higher than that of the interrupt requ est currently being serviced is issued (including a non-maskable interrupt reques t signal), the stop mode is released and that interrupt request signal is acknowledged. caution the interrupt request that is disabled by setting the psc.nmi1m, psc.nmi0m, and psc.intm bits to 1 becomes invalid and stop mode is not released.
chapter 26 standby function user?s manual u19201ej3v0ud 1344 table 26-8. operation after releasing st op mode by interrupt request signal release source interrupt enabled (ei) status interrupt disabled (di) status non-maskable interrupt request signal execution branches to the handler address after securing the oscillation stabilization time. maskable interrupt request signal execution branches to the handler address or the next instruction is executed after securing the oscillation stabilization time. the next instruction is executed after securing the oscillation stabilization time. (2) releasing stop mode by reset the same operation as the normal reset operation is performed.
chapter 26 standby function user?s manual u19201ej3v0ud 1345 table 26-9. operating status in stop mode operating status setting of stop mode item when subclock is not used when subclock is used main clock oscillator stops oscillation subclock oscillator ? oscillation enabled internal oscillator oscillation enabled pll stops operation sscg stops operation cpu stops operation dma stops operation interrupt controller stops operation (but standby mode release is possible) rom correction stops operation timer p (tmp0 to tmp8) stops operation timer q (tmq0) stops operation tmm0 operable when f r /8 is selected as the count clock operable when intwt (when watch timer is operating), f r /8, or f xt is selected as the count clock tmm1 operable when f r /8 or inttm0eq0 (when tmm0 is operating) is selected as the count clock. timer m tmm2 operable when f r /8 or inttm1eq0 (when tmm1 is operating) is selected as the count clock. watch timer stops operation operable when f xt is selected as the count clock real-time counter (rtc) stops operation operable when f xt is selected as the count clock watchdog timer 2 operable when f r /8 is selected as the count clock operable when f r /8 or f xt is selected as the count clock csib0 to csib5 operable when the sckbn input clock is selected as the transfer clock (n = 0 to 5) csie0 note 1 , csie1 note 1 stops operation i 2 c00 to i 2 c03, i 2 c04 note 1 , i 2 c05 note 1 stops operation uarta0 to uarta5 stops operation (but uarta0 is operable when the ascka0 input clock is selected) serial interface uartb0, uartb1 stops operation can controller note 2 stops operation iebus controller stops operation a/d converter stops operation (conversion result undefined) notes 3, 4 d/a converter stops operation notes 5, 6 (high impedance is output) real-time output function (rto) stops operation (output held) key interrupt function (kr) operable crc arithmetic circuit stops operation external bus interface see 2.3 pin states . port function retains status before stop mode was set internal data the cpu registers, statuses, data, and all other internal data such as the contents of the internal ram or expanded internal ram are retained as they were before the stop mode was set. notes 1. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v85 0e/sj3-h), and 70f3933 (v850e/sj3- h) 2. can controller versions only
chapter 26 standby function user?s manual u19201ej3v0ud 1346 notes 3. if the stop mode is set while the a/d converter is operating, the a/d converte r is automatically stopped and starts operating again after the stop mode is rel eased. however, in that case, the a/d conversion results after the stop mode is released are invalid. all the a/d conversion results before the stop mode is set are invalid. 4. even if the stop mode is set while the a/d converte r is operating, the power consumption is reduced equivalently to when the a/d converter is stopped before the stop mode is set. 5. if the stop mode is set while the d/a converter is operating, the d/a converte r is automatically stopped and the pin status becomes high impedance. after the stop mode is released, d/a conversion resumes, the setting time elapses, and the status re turns to the output level before the stop mode was set. 6. even if the stop mode is set while the d/a converte r is operating, the power consumption is reduced equivalently to when the d/a converter is stopped before the stop mode is set. 26.6.3 securing oscillation stabilizati on time when releasing stop mode secure the oscillation stabilization time for the main clo ck oscillator after releasing the stop mode because the operation of the main clock oscillator stops after stop mode is set. cautions 1. in clock mode 1, if the system shifts to stop mode while the pll is operating, be sure to set an oscillation stabilization time of at least 1 ms to be insert ed after stop mode is released. 2. in clock modes 2, 3, and 4, if the system sh ifts to stop mode while the sscg is operating, be sure to set an oscillation stabiliz ation time of at least 2 ms to be inserted after stop mode is released. (1) releasing stop mode by non-maskable inte rrupt request signal or unmasked maskable interrupt request signal secure the oscillation stabilization time by setting the osts register. when the releasing source is generated, the dedicated in ternal timer starts counting according to the osts register setting. when it overflows, the normal operation mode is restored. oscillated waveform rom circuit stopped setup time count main clock stop status interrupt request (2) releasing stop mode by reset this operation is the same as that of a normal reset. the oscillation stabilization time is the initial value of the osts register, 2 16 /f x .
chapter 26 standby function user?s manual u19201ej3v0ud 1347 26.7 subclock operation mode 26.7.1 setting and operation status the subclock operation mode is set by setting the pcc.ck3 bit to 1 in the normal operation mode. when the subclock operation mode is set, t he internal system clock is changed from the main clock to the subclock. check whether the clock has been s witched by using the pcc.cls bit. when the pcc.mck bit is set to 1, the operation of the main clock oscillator is stopped. as a result, the system operates only on the subclock. in the subclock operation mode, the power consumption can be reduced to a level lower than in the normal operation mode because the subclock is us ed as the internal system clock. in addition, the power consumption can be further reduced to the level of the stop mode by st opping the operation of t he main clock oscillator. table 26-10 shows the operating st atus in subclock operation mode. cautions 1. secure the oscillation st abilization time of the subclock osc illator before shifting to subclock operation mode. the subclock oscillator star ts oscillation after po wer is applied. 2. before setting subclock operation mode, be sure to stop operation of the sscg (sscgctl.sscgon bit = 0). note that th e sscg cannot be used in clock mode 1. 3. when manipulating the ck3 bit, do not change the set values of the pcc.ck2 to pcc.ck0 bits (using a bit manipulation instruction to manipul ate the bit is recommended). for details of the pcc register, see 6.3 (1) pro cessor clock control register (pcc). 4. if the following conditions are not satisfied, ch ange the ck2 to ck0 bits so that the conditions are satisfied and set the subclock operation mode. internal system clock (f clk ) > subclock (f xt = 32.768 khz) 4 5. when stopping operation of the main clock oscillator, be sure to also stop operation of the on-chip peripheral functions operati ng on the main oscillation clock (f x ) and peripheral clock (f xp ). 6. in clock modes 2, 3 and 4, do not clear (0 ) the pllctl.pllon bit by software (i.e., do not stop the pll). when the main cl ock oscillator stops operati ng (pcc.mck bit = 1), the pll automatically stops operating at the same time, with the pllctl.pllon bit still set to 1 (pll operation enabled). similarly, when the main cl ock oscillator is set to operation enabled again (pcc.mck bit = 0), the pll also starts opera ting, and enters a locked state until the oscillation stabilization time secured by software elapses (at least 1 ms). remark internal system clock (f clk ): clock generated from main clock (f xx ) in accordance with the settings of the ck2 to ck0 bits 26.7.2 releasing subc lock operation mode the subclock operation mode is released by a reset signal (reset pin input, reset signal (wdt2res) generation by overflow of watchdog timer 2, reset signal (lvires) gen eration by low voltage detector (lvi), or reset signal (clmres) generation by clock monitor (clm)) when the ck3 bit is cleared to 0. if the main clock oscillator is stopped (mck bit = 1), set the mc k bit to 0, secure the oscillation stabilization time of the main clock oscillator by software, and set the ck3 bit to 0. the normal operation mode is restored when the subclock operation mode is released. caution when manipulating the ck3 bit, do not change the set values of the ck2 to ck0 bits (using a bit manipulation instruction to manipulate the bit is recommended). for details of the pcc register, see 6.3 (1 ) processor clock control register (pcc).
chapter 26 standby function user?s manual u19201ej3v0ud 1348 table 26-10. operating status in subclock operation mode operating status setting of subclock operation mode item when main clock is oscillating when main clock is stopped subclock oscillator oscillation enabled internal oscillator oscillation enabled pll operable stops operation note 5 sscg disables operation note 4 cpu operable dma operable interrupt controller operable rom correction operable timer p (tmp0 to tmp8) note 1 operable disables operation timer q (tmq0) note 1 operable disables operation tmm0 note 1 operable operable when intwt (when watch timer is operating), f r /8 or f xt is selected as the count clock tmm1 note 1 operable operable when f r /8 or inttm0eq0 (when tmm0 is operating) is selected as the count clock. timer m tmm2 note 1 operable operable when f r /8 or inttm1eq0 (when tmm1 is operating) is selected as the count clock. watch timer note 1 operable operable when f xt is selected as the count clock real-time counter (rtc) note 1 operable operable when f xt is selected as the count clock watchdog timer 2 operable operable when f r /8 or f xt is selected as the count clock csib0 to csib5 note 1 operable operable when the sckbn input clock is selected as the transfer clock (n = 0 to 5) csie0 notes 1, 2 , csie1 notes 1, 2 operable disables operation i 2 c00 to i 2 c03 note 1 , i 2 c04 notes 1, 2 , i 2 c05 notes 1, 2 operable disables operation uarta0 to uarta5 note 1 operable disables operation (but uarta0 is operable when the ascka0 input clock is selected) serial interface uartb0 note 1 , uartb1 note 1 operable disables operation can controller notes 1, 3 operable disables operation iebus controller note 1 operable disables operation a/d converter note 1 operable disables operation d/a converter operable real-time output function (rto) oper able stops operation (output held) key interrupt function (kr) operable crc arithmetic circuit operable external bus interface operable port function settable internal data settable
chapter 26 standby function user?s manual u19201ej3v0ud 1349 notes 1. when stopping the main clock oscillator, be sure to disable the on-chip peripheral functions that are operating on the main oscillation clock (f x ) or peripheral clock (f xp , f ie , f can ). 2. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v85 0e/sj3-h), and 70f3933 (v850e/sj3- h) 3. can controller versions only. 4. before shifting to subclock operation m ode, be sure to stop operation of the sscg (sscgctl.sscgon bit = 0). note that the sscg cannot be used in clock mode 1. 5. when the main clock oscillator stops operating, the p ll automatically stops. in clock modes 2, 3, and 4, do not stop the pll by software (i.e., do not clear (0) the pllctl.pllon bit). caution when the cpu is operati ng on the subclock and main cloc k oscillation is stopped, accessing a register in which a wait occurs is disabled. if a wait is generated, it can be released only by reset (see 3.4.9 (2)).
chapter 26 standby function user?s manual u19201ej3v0ud 1350 26.8 sub-idle mode 26.8.1 setting and operation status the sub-idle mode is set by setting the psmr.psm1 a nd psmr.psm0 bits to 00 or 10 and setting the psc.stp bit to 1 in the subclock operation mode. in this mode, the clock oscillator c ontinues operating but clock supply to the cpu, flash memory, and the other on- chip peripheral functions is stopped. as a result, program execution stops and the contents of the internal ra m and expanded internal ram before the sub-idle mode was set are retained. the cpu and the other on-chip peripheral functions are stopped. however, the on-chip peripheral functions that can operate with the main oscillation clock (f x ), subclock (f xt ), or internal oscillation clock (f r ) continue operating. because the sub-idle mode stops oper ation of the cpu, flash memory, and ot her on-chip peripheral functions, it can reduce the power consumption more than the subclock operation mode. if the sub-idle mode is set after the main clock has been stopped, the current consumption can be reduced to a level as low as that in the stop mode. table 26-12 shows the operating status in the sub-idle mode. cautions 1. following the store instruction to the psc register for setting the sub-idle mode, insert the five or more nop instructions. 2. if the sub-idle mode is set while an unmasked interrupt request signal is being held pending, the sub-idle mode is then released immediately by the pending interrupt request. 3. when stopping operation of the main clock oscillator, be sure to also stop operation of the on-chip peripheral functions operati ng on the main oscillation clock (f x ) and peripheral clock (f xp ). 4. in clock modes 2, 3, and 4, do not clear (0) the pllctl.pllon bit by software (i.e., do not stop the pll). when the main clock oscilla tor stops operating (pcc.mck bit = 1), the pll automatically stops operating at the same time, with the pllctl.pllon bit still set to 1 (pll operation enabled). similarly, when the main cl ock oscillator is set to operation enabled again (pcc.mck bit = 0), the pll also starts opera ting, and enters a locked state until the oscillation stabilization time secured by software elapses (at least 1 ms).
chapter 26 standby function user?s manual u19201ej3v0ud 1351 26.8.2 releasing sub-idle mode the sub-idle mode is released by a non-maskable inte rrupt request signal (nmi pin input, intwdt2 signal), unmasked external interrupt request signal (intp0 to intp 9 pin input), unmasked internal interrupt request signal from the peripheral functions operabl e in the sub-idle mode, or reset signal (reset pin input, reset signal (wdt2res) generation by overflow of watchdog timer 2, re set signal (lvires) generation by low voltage detector (lvi), or reset signal (clmres) generation by clock monitor (c lm)). the pll returns to the operating status it was in before the sub-idle mode was set. when the sub-idle mode is released by an interrupt request signal, the subclock operation mode is set. (1) releasing sub-idle m ode by non-maskable interrupt request signal or unmasked maskable interrupt request signal the sub-idle mode is released by a non-maskable interrupt request signal or an unmasked maskable interrupt request signal, regardless of the pr iority of the interrupt request signal. if the sub-idle mode is set in an inte rrupt servicing routine, however, an in terrupt request signal that is issued later is serviced as follows. (a) if an interrupt request signal with a priority lower than that of the interrupt requ est currently being serviced is issued, the sub-idle mode is released, but that interrupt request signal is not acknowledged. the interrupt request signal itself is retained. (b) if an interrupt request signal with a priority higher than that of the interrupt requ est currently being serviced is issued (including a non-maskable interrupt reques t signal), the sub-idle mode is released and that interrupt request signal is acknowledged. cautions 1. the interrupt request signal that is disabled by setting the psc.nmi1m, psc.nmi0m, and psc.intm bits to 1 becomes invalid and sub-idle mode is not released. 2. when the sub-idle mode is relea sed, 12 cycles of the subclock (about 366 s) elapse from when the interrupt request signal that releases the sub-idle mode is generated to when the mode is released. table 26-11. operation after releasing sub- idle mode by interrupt request signal release source interrupt enabled (ei) status interrupt disabled (di) status non-maskable interrupt request signal execution branches to the handler address. maskable interrupt request signal execution branches to the handler address or the next instruction is executed. the next instruction is executed. (2) releasing sub-idle mode by reset the same operation as the normal reset operation is performed.
chapter 26 standby function user?s manual u19201ej3v0ud 1352 table 26-12. operating status in sub-idle mode operating status setting of sub-idle mode item when main clock is oscillating when main clock is stopped subclock oscillator oscillation enabled internal oscillator oscillation enabled pll operable stops operation note 5 sscg disables operation note 4 cpu stops operation dma stops operation interrupt controller stops operation (but standby mode release is possible) rom correction stops operation timer p (tmp0 to tmp8) note 1 stops operation disables operation timer q (tmq0) note 1 stops operation disables operation tmm0 note 1 operable when intwt (when watch timer is operating), f r /8, or f xt is selected as the count clock tmm1 note 1 operable when f brg , f r /8, or inttm0eq0 (when tmm0 is operating) is selected as the count clock. operable when f r /8 or inttm0eq0 (when tmm0 is operating) is selected as the count clock. timer m tmm2 note 1 operable when f brg , f r /8, or inttm1eq0 (when tmm1 is operating) is selected as the count clock. operable when f r /8 or inttm1eq0 (when tmm1 is operating) is selected as the count clock. watch timer note 1 operable operable when f xt is selected as the count clock real-time counter (rtc) note 1 operable operable when f xt is selected as the count clock watchdog timer 2 operable when f r /8 or f xt is selected as the count clock csib0 to csib5 note 1 operable when the sckbn input clock is selected as the count clock (n = 0 to 5) csie0 notes 1, 2 , csie1 notes 1, 2 stops operation disables operation i 2 c00 to i 2 c03 note 1 , i 2 c04 notes 1, 2 , i 2 c05 notes 1, 2 stops operation disables operation uarta0 to uarta5 note 1 stops operation (but uarta0 is operable when the ascka0 input clock is selected) disables operation (but uarta0 is operable when the ascka0 input clock is selected) serial interface uartb0 note 1 , uartb1 note 1 stops operation disables operation can controller notes 1, 3 stops operation disables operation iebus controller note 1 stops operation disables operation a/d converter note 1 holds operation (conversion result held) note 6 disables operation d/a converter holds operation (output held note 6 ) real-time output function (rto) stops operation (output held) key interrupt function (kr) operable crc arithmetic circuit stops operation external bus interface see 2.3 pin states (same operation status as idle1, idle2 mode). port function retains status before sub-idle mode was set internal data the cpu registers, statuses, data, and all other internal data such as the contents of the internal ram or expanded internal ram are retained as they were before the sub-idle mode was set. note 1. when stopping the main clock oscillator, disable the on-chip peripheral functions operating on the main oscillation clock (f x ) and peripheral clock (f xp , f ie , f can ).
chapter 26 standby function user?s manual u19201ej3v0ud 1353 notes 2. not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v85 0e/sj3-h), and 70f3933 (v850e/sj3- h) 3. can controller versions only. 4. stop the sscg (sscgctl.sscgon bit = 0) before shifting to subclock operation mode. note that the sscg cannot be used in clock mode 1. 5. when the main clock oscillator st ops, the pll stops automatically. in clock modes 2, 3, and 4, do not stop the pll by software (i.e., do not clear (0) the pllctl.pllon bit). 6. to realize low power consumpti on, stop the a/d and d/a converters before shifting to the sub-idle mode.
chapter 26 standby function user?s manual u19201ej3v0ud 1354 26.9 status transition diagram (1) status transition diagram for using clock mode 1 figure 26-1. status transition di agram for using clock mode 1 (1/2) reset wait for oscillation stabilization wdt2 overflow wait for oscillation stabilization note 8 wait for pll lockup time sub-idle mode f x : operating pll: operating halt mode f x : operating pll: operating idle1 mode f x : operating pll: operating subclock operation mode f x : operating pll: operating subclock operation mode f x : stopped pll: stopped sub-idle mode f x : stopped pll: stopped wait for oscillation stabilization note 8 idle2 mode f x : operating pll: stopped wait for oscillation stabilization note 8 stop mode f x : stopped pll: stopped idle1 mode f x : operating pll: stopped halt mode f x : operating pll: stopped subclock operation main clock operation clock-through mode pll: operating pll mode pll: operating clock-through mode pll: stopped note 1 note 4 note 4 note 4 notes 6, 7 note 5 note 1 notes 2, 3 on-chip oscillator operation (emergency operation mode) notes 1. in order to reduce power consumption, be sure to stop the a/d and d/a converters before shifting to sub-idle mode. 2. when stopping the main clock oscillator, set the on- chip peripheral functions operating on the main oscillation clock (f x ) and peripheral clock (f xp , f ie , f can ) to operation stopped. 3. when the main clock oscillator stops, the pll stops automatically. 4. in order to reduce power consumption, be sure to stop the a/d and d/a converters before shifting to idle1 mode or idle2 mode. 5. if the system shifts to idle2 mode while the pll is operating, be sure to set a setup time of at least 800 s to be inserted after idle2 mode is released. if the pll is stopped, set a setup time of at least 350 s to be inserted after idle2 mode is released.
chapter 26 standby function user?s manual u19201ej3v0ud 1355 figure 26-1. status transition di agram for using clock mode 1 (2/2) notes 6. if the system shifts to stop mode while the a/d converter is operating, the a/d converter will automatically stop while stop mode is in effect, and will resume operating after stop mode is released. in this case, however, the a/d conversion results after stop mode is released will be invalid. in addition, all the a/d conversion result s before the system shifted to stop mode will also be invalid. 7. if the system shifts to stop mode while the d/a converter is operating, the d/a converter will automatically stop while stop mode is in effec t, and the status of its pins will be high impedance. the d/a converter will resume operating after stop mode is released, and, after the settling time has elapsed, its pins will output the level they we re outputting before the system shifted to stop mode. 8. if a wdt2 overflow occurs during the oscillati on stabilization time, the syst em will switch from the internal system clock (f clk ) to the internal oscillation clock (f r ) and continue operating. remark f x : main oscillation clock frequency
chapter 26 standby function user?s manual u19201ej3v0ud 1356 (2) status transition diagram for using clock modes 2, 3, and 4 figure 26-2. status transition diagram for using clock modes 2, 3, and 4 (1/2) oscillation stabilization time: at least 1 ms note 5 halt mode f x : operating pll: operating sscg: operating idle1 mode f x : operating pll: operating sscg: operating idle2 mode f x : operating pll: stopped sscg: stopped stop mode f x : stopped pll: stopped sscg: stopped wdt2 overflow note 1 note 8 note 9 notes 1, 11 note 1 note 1 note 1 note 1 note 1 notes 3, 4 notes 3, 4 notes 3, 4 initialization settings (initialization of sscg operation, ckc register) reset wait for stabilization of main clock oscillator oscillation clock-through mode pll: operating sscg: stopped subclock operation mode main clock oscillator: operating pll: operating sscg: stopped subclock operation mode main clock oscillator: stopped pll: stopped note 10 sscg: stopped clock-through mode pll: operating sscg: operating sub-idle mode main clock oscillator: operating pll: operating sscg: stopped sub-idle mode main clock oscillator: stopped pll: stopped sscg: stopped sscg operation mode pll: operating sscg: operating halt mode f x : operating pll: operating sscg: operating idle1 mode f x : operating pll: operating sscg: operating idle2 mode f x : operating pll: stopped sscg: stopped stop mode f x : stopped pll: stopped sscg: stopped halt mode f x : operating pll: operating sscg: stopped idle1 mode f x : operating pll: operating sscg: stopped idle2 mode f x : operating pll: stopped sscg: stopped stop mode f x : stopped pll: stopped sscg: stopped oscillation stabilization time: at least 2 ms notes 5, 7 oscillation stabilization time: at least 2 ms notes 5, 7 setup time: at least 800 s note 2 setup time: at least 1 ms note 6 setup time: at least 1 ms note 6 main clock operation subclock operation sscg lockup time wait: at least 1 ms 1/f xt 12 1/f xt 12 wait for stabilization of main clock oscillator oscillation note 1 on-chip oscillator operation (emergency operation mode) notes 1 . in order to reduce power consumption, be sure to stop the a/d and d/a converters before shifting to idle1, idle2, or sub-idle mode. 2. if the system shifts to idle2 mode while the sscg is stopped and the pll is operating, be sure to set a setup time of at least 800 s to be inserted after idle2 mode is released. 3. if the system shifts to stop mode while the a/d converter is operating, the a/d converter will automatically stop while stop mode is in effec t, and will resume operating after stop mode is released. in this case, however, the a/d conversion results after stop mode is released will be invalid. in addition, all the a/d conversion result s before the system shifted to stop mode will also be invalid.
chapter 26 standby function user?s manual u19201ej3v0ud 1357 figure 26-2. status transition diagram for using clock modes 2, 3, and 4 (2/2) notes 4. if the system shifts to stop mode while the d/a converter is operating, the d/a converter will automatically stop while stop mode is in effect, and the status of its pins will be high impedance. the d/a converter will resume operat ing after stop mode is released, and, after the settling time has elapsed, its pins will output the level they were outputting before the system shifted to stop mode. 5. if a wdt2 overflow occurs during the oscillati on stabilization time, the system will switch from the internal system clock (f clk ) to the on-chip oscillation clock (f r ) and continue operating. 6. if the system shifts to idle2 mode while the sscg is operating, be sure to set a setup time of at least 1 ms to be inserted after idle2 mode is released. 7. if the system shifts to stop mode while the sscg is operating, be sure to set an oscillation stabilization time of at least 2 ms to be inserted after stop mode is released. 8. before shifting to subclock operation mode, set clock-through mode and stop operation of the sscg (sscgctl.sscgon bit = 0). 9. when stopping the main clock oscillator, set the on- chip peripheral functions operating on the main oscillation clock (f x ) and peripheral clock (f xp , f ie , f can ) to operation stopped. 10. when the main clock oscillator stops, the pll stops automatically. 11. in order to reduce power consumption, be sure to stop the a/d and d/a converters before shifting to sub-idle mode. caution in clock modes 2, 3, and 4, do not clear (0) the pllctl.pllon bit by software (i.e., do not stop the pll). remark f x : main oscillation clock frequency
user?s manual u19201ej3v0ud 1358 chapter 27 reset functions 27.1 overview the following reset functions are available. (1) four kinds of reset sources ? external reset input via the reset pin ? reset via the watchdog timer 2 (wdt2) overflow (wdt2res) ? system reset via the comparison of the low-volta ge detector (lvi) supply voltage and detected voltage (lvires) ? system reset via the detecting clock monitor (clm) oscillation stop (clmres) after a reset is released, the source of the reset can be confirmed with the reset source flag register (resf). (2) emergency operation mode if the wdt2 overflows during the main clock oscillation st abilization time inserted a fter a reset is released or stop mode is released, a main clock oscillation a nomaly is judged and the cpu starts operating on the internal oscillation clock. caution in emergency operation mode, do not access on-chip peripheral i/o registers other than registers used for interrupts, ports, wdt2, or tmm0, each of which can operate on the internal oscillation clock. in addition, csib0 to csib5, csie0 note , csie1 note , and uarta0 cannot opera te on an externally input clock in this mode. note not available in the pd70f3931 (v850e/sj3-h), 70f39 32 (v850e/sj3-h), and 70f3933 (v850e/sj3-h)
chapter 27 reset functions user?s manual u19201ej3v0ud 1359 figure 27-1. block di agram of reset function clmrf lvirf wdt2rf reset source flag register (resf) internal bus wdt2 reset signal clm reset signal reset lvi reset signal reset signal reset signal reset signal to lvim/lvis register clear set set clear clear set caution an lvi circuit internal r eset does not reset the lvi circuit. remarks 1. lvim: low-voltage detection register 2. lvis: low-voltage detection level selection register
chapter 27 reset functions user?s manual u19201ej3v0ud 1360 27.2 registers to check reset source the v850e/sj3-h and v850e/sk3-h have four kinds of re set sources. after a reset has been released, the source of the reset that occurred can be check ed with the reset source flag register (resf). (1) reset source flag register (resf) the resf register is a special regist er that can be written only by a comb ination of specific sequences (see 3.4.8 special registers ). the resf register indicates the source from which a reset signal is generated. this register is read or written in 8-bit or 1-bit units. reset pin input clears this register to 00h. the defaul t value differs if the source of reset is other than the reset pin signal. 0 wdt2rf 0 1 not generated generated resf 0 0 wdt2rf 0 0 clmrf lvirf after reset: 00h note r/w address: fffff888h reset signal from wdt2 lvirf 0 1 not generated generated reset signal from lvi clmrf 0 1 not generated generated reset signal from clm note the value of the resf register is cleared to 00h when a reset is executed via the reset pin. when a reset is executed by the watchdog timer 2 (wdt2), cl ock monitor (clm), or low-voltage detector (lvi), the reset flags of this register (wdt2rf bit, clmrf bi t, and lvirf bit) are set. however, other sources are retained. cautions 1. only ?0? can be written to each bit of th is register. if writing ?0? conflicts with setting the flag (occurrence of reset), se tting the flag takes precedence. 2. be sure to set bits 2, 3, and 5 to 7 to ?0?.
chapter 27 reset functions user?s manual u19201ej3v0ud 1361 27.3 operation 27.3.1 reset operation via reset pin when a low level is input to the reset pin, the syst em is reset, and each hardware unit is initialized. when the level of the reset pin is changed from low to high, the reset status is released. table 27-1. hardware status on reset pin input item during reset after reset main clock oscillator (f x ) oscillation stops oscillation starts subclock oscillator (f xt ) oscillation continues internal oscillator oscillation stops oscillation starts peripheral clock (f xp to f xp /1,024) operation stops operation starts after securing oscillation stabilization time internal system clock (f clk ), cpu clock (f cpu ) operation stops operation starts after securing oscillation stabilization time (initialized to f xx /8) cpu initialized program execution starts after securing oscillation stabilization time watchdog timer 2 operation stops (initialized to 0) counts up from 0 with internal oscillation clock as source clock. internal ram, expanded internal ram undefined if power-on reset or cpu access and reset input conflict (data is damaged). otherwise value imm ediately after reset input is retained. the value immediately before the reset is reta ined if a reset signal is input in idle1, idle2, stop, or sub-idle mode. i/o lines (ports/alternate-function pins) high impedance note on-chip peripheral i/o registers initialized to sp ecified status, ocdm register is set (01h). other on-chip peripheral functions operation st ops operation can be started after securing oscillation stabilization time note when the power is turned on, the following pins may momentarily output an undefined level. ? p53/sib2/kr3/tiq00/toq00/rtp03/ddo pin caution the ocdm register is initialized by the reset pin input. therefore, note with caution that, if a high level is input to the p05/drst pin after a reset release before the ocdm.ocdm0 bit is cleared, the v850e/sj3-h or v850e/sk3-h may ente r on-chip debug mode. for details, refer to chapter 4 port functions.
chapter 27 reset functions user?s manual u19201ej3v0ud 1362 figure 27-2. timing of reset operation by reset pin input counting of oscillation stabilization time initialized to f xx /8 operation oscillation stabilization timer overflows internal system reset signal analog delay (eliminated as noise) analog delay analog delay (eliminated as noise) reset f x f clk analog delay figure 27-3. timing of power-on reset operation oscillation stabilization time count must be on-chip regulator stabilization time (1 ms (max.)) or longer. initialized to f xx /8 operation overflow of timer for oscillation stabilization internal system reset signal reset f x v dd f clk analog delay
chapter 27 reset functions user?s manual u19201ej3v0ud 1363 27.3.2 reset operation by watchdog timer 2 (wdt2res) when watchdog timer 2 is set to the reset operation mode due to overflow, upon watchdog timer 2 overflow (wdt2res signal generati on), a system reset is executed and the hardware is initialized to the initial status. following watchdog timer 2 overflow, the reset status is entered and lasts the predetermined time (analog delay), and the reset status is then automatically released. the main clock oscillator is stopped during the reset period. table 27-2. hardware status during watchdog timer 2 reset operation item during reset after reset main clock oscillator (f x ) oscillation stops oscillation starts subclock oscillator (f xt ) oscillation continues internal oscillator oscillation stops oscillation starts peripheral clock (f xp to f xp /1,024) operation stops operation starts after securing oscillation stabilization time internal system clock (f clk ), cpu clock (f cpu ) operation stops operation starts after securing oscillation stabilization time (initialized to f xx /8) cpu initialized program execution after securing oscillation stabilization time watchdog timer 2 operation stops (initialized to 0) counts up from 0 with internal oscillation clock as source clock. internal ram, expanded internal ram undefined if power-on reset or cpu access a nd reset input conflict (data is damaged). otherwise value imm ediately after reset input is retained. the value immediately before the reset is reta ined if a reset signal is input in idle1, idle2, stop, or sub-idle mode. i/o lines (ports/alternate-function pins) high impedance on-chip peripheral i/o register initialized to spec ified status, ocdm register retains its value. on-chip peripheral functions other than above operation stops operation can be started after securing oscillation stabilization time.
chapter 27 reset functions user?s manual u19201ej3v0ud 1364 figure 27-4. timing of reset oper ation by wdt2res signal generation counting of oscillation stabilization time initialized to f xx /8 operation oscillation stabilization timer overflow internal system reset signal wdt2res f x f clk analog delay
chapter 27 reset functions user?s manual u19201ej3v0ud 1365 27.3.3 reset operation by low-voltage detector (lvires) if the supply voltage falls below the vo ltage detected by the low-voltage dete ctor when lvi operation is enabled, a system reset is executed (when the lvim.lvimd bit is set to 1), and the hardware is initia lized to the initial status. the reset status lasts from when a supply voltage drop has been detected until the su pply voltage rises above the lvi detection voltage. the main clock oscillator is stopped during the reset period. when the lvimd bit = 0, an interrupt request signal (i ntlvi) is generated if a low voltage is detected. table 27-3. hardware status during reset operation by low-voltage detector item during reset after reset main clock oscillator (f x ) oscillation stops oscillation starts subclock oscillator (f xt ) oscillation continues internal oscillator oscillation stops oscillation starts peripheral clock (f xp to f xp /1,024) operation stops operation starts after securing oscillation stabilization time internal system clock (f clk ), cpu clock (f cpu ) operation stops operation starts after securing oscillation stabilization time (initialized to f xx /8) cpu initialized program execution starts after securing oscillation stabilization time wdt2 operation stops (initialized to 0) counts up from 0 with internal oscillation clock as source clock. internal ram, expanded internal ram undefined if power-on reset or cpu access a nd reset input conflict (data is damaged). otherwise value imm ediately after reset input is retained. the value immediately before the reset input is re tained if a reset signal is input in idle1, idle2, stop, or sub-idle mode. i/o lines (ports/alternate-function pins) high impedance on-chip peripheral i/o register initialized to spec ified status, ocdm register retains its value. lvi operation continues on-chip peripheral functions other than above operation stops operation can be started after securing oscillation stabilization time. remark the reset timing of the low-voltage detector, refer to chapter 29 low-voltage detector .
chapter 27 reset functions user?s manual u19201ej3v0ud 1366 27.3.4 reset operation by clock monitor (clmres) when the clock monitor operation is enabled, the main cloc k is monitored by using the sampling clock (internally oscillated clock: f r ). if it is detected that the main clock is st opped, the system is reset and each hardware unit is initialized to a specific status. after it has been detected that the main clock is stopped, the cpu is placed in the reset status for a specific time (of analog delay), and then it is automatically released from t he reset status. after the re set status has been released, the timer for oscillation stabilization does not perform its co unting operation, because the ma in clock is stopped. when watchdog timer 2 that is started by default overflows, t he cpu starts program execution on an internally oscillated clock (f r ). the status of each hardware unit during the reset period executed by the reset signal (clmres) of the clock monitor operation and after the reset status is released is shown below. for the reset timing by the clock monitor operation, refer to figure 27-5 . table 27-4. hardware status during reset operation by clock monitor item during reset after reset main clock oscillator (f x ) oscillation stops oscillation starts note subclock oscillator (f xt ) oscillation continues internal oscillator oscillation stops oscillation starts peripheral clock (f xp to f xp /1,024) operation stops operation starts after securing oscillation stabilization time note . internal system clock (f clk ), cpu clock (f cpu ) operation stops operation starts after securing oscillation stabilization time (initialized to f xx /8). however, if watchdog timer 2 overflows before the cpu execution, operation starts with the internal oscillation clock (f r ). cpu initialized program execution starts after securing oscillation stabilization time. however, if watchdog timer 2 overflows before the cpu execution, operation starts with the internal oscillation clock (f r ). wdt2 operation stops (initialized to 0) operation starts. wdt2res is not generated, however, if only watchdog timer 2 overflows before cpu execution. internal ram, expanded internal ram undefined i/o lines (ports/alternate- function pins) high impedance on-chip peripheral i/o register initialized to spec ified status, ocdm register retains its value. on-chip peripheral functions other than above operation stops operation can be started after securing oscillation stabilization time note . note when the main clock starts oscillation after the reset operation by the clock monitor. remark for details of the clock monitor, refer to chapter 28 clock monitor .
chapter 27 reset functions user?s manual u19201ej3v0ud 1367 figure 27-5. reset timing by clock monitor count operation or count stop f x f clk f r clmres wdt2 count clm.clme bit resf.clmrf bit count operation continue stop count operation f r operation keep oscillation stabilization time (count operation stop) main clock operation stop watchdog timer 2 overflow (wdt2res not occur) watchdog timer 2 count operation start main clock stop detection program fetch start remark the mode cannot be restored by software to th e normal operation mode from the internally oscillated clock operation mode. the normal oper ation mode can be restored only when the main oscillation clock (f x ) operates normally after reset (generation of reset, wdt2res, or lvires signals).
chapter 27 reset functions user?s manual u19201ej3v0ud 1368 27.3.5 operation after reset release after the reset is released, the main clock starts oscillati on and oscillation stabilization time (osts register initial value: 2 16 /f x ) is secured, and the cpu st arts program execution. wdt2 immediately begins to operate after a reset has been released using the internal oscillation clock as a source clock. figure 27-6. operation after reset release main clock reset counting of oscillation stabilization time normal operation (f cpu = main clock) operation stops operation in progress operation stops operation in progress clock monitor internal oscillation clock v850e/sj3-h, v850e/sk3-h wdt2 (1) emergent operation mode if an anomaly occurs in the main clock before oscillation stabilization time is secured, wdt2 overflows before executing the cpu program. at this time, the cpu star ts program execution by using the internal oscillation clock as the source clock. figure 27-7. operation after reset release main clock reset counting of oscillation stabilization time wdt overflows emergency mode (f cpu = internal oscillation clock) operation stops operation in progress operation in progress (re-count) operation stops clock monitor internal oscillation clock v850e/sj3-h, v850e/sk3-h wdt2 the cpu operation clock states c an be checked with the cpu operation clock status register (ccls).
chapter 27 reset functions user?s manual u19201ej3v0ud 1369 27.3.6 reset function operation flow start (reset source occurs) main clock oscillation stabilization time secured? no ccls.cclsf bit = 1? yes no (in normal operation mode) no (in emergent operation mode) reset source generated? yes no yes (in normal operation mode) wdt2 overflow? no yes (in emergent operation mode) set resf register note 1 reset occurs reset release emergent operation software processing normal operation cpu operation starts from reset address (f cpu = f x /8, f r ) f cpu = f x f cpu = f r note 2 ccls.cclsf bit 1 wdt2 restart internal oscillation and main clock oscillation start, wdt2 count up starts (reset mode) notes 1. bit to be set differs depending on the reset source. reset source wdt2rf bit clmrf bit lvirf bit reset pin 0 0 0 wdt2 1 value before reset is retained. value before reset is retained. clm value before reset is retained. 1 value before reset is retained. lvi value before reset is retained. value before reset is retained. 1 2. the internal oscillator cannot be stopped.
user?s manual u19201ej3v0ud 1370 chapter 28 clock monitor 28.1 functions the clock monitor samples the main clock by using the internal oscillation clock and generates a reset request signal (clmres) when oscillation of the main clock is stopped. once the operation of the clock monitor has been enabled by an operation enable flag, it cannot be cleared to 0 by any means other than reset. when a reset (clmres) by the clock monitor occurs, the resf .clmrf bit is set. for details on the resf register, refer to 27.2 registers to check reset source . the clock monitor automatically stops under the following conditions. ? during oscillation stabilization time after stop mode is released ? when the main clock is stopped (from when the pcc.mck bit = 1 during subclock operation, until the pcc.cls bit = 0 during main clock operation) ? when the sampling clock (internal oscillation clock) is stopped ? when the cpu operates with the internal oscillation clock 28.2 configuration the clock monitor consists of the following hardware. table 28-1. configuration of clock monitor item configuration control register clock monitor mode register (clm) figure 28-1. timing of reset via clock monitor main clock internal oscillation clock internal reset signal (clmres) enable/disable clme clock monitor mode register (clm)
chapter 28 clock monitor user?s manual u19201ej3v0ud 1371 28.3 register the clock monitor is controlled by the clock monitor mode register (clm). (1) clock monitor mode register (clm) the clm register is a special register. this can be wri tten only in a special combination of sequences (refer to 3.4.8 special register ). this register is used to set the operation mode of the clock monitor. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. after reset: 00h r/w address: fffff870h 7 6 5 4 3 2 1 <0> clm 0 0 0 0 0 0 0 clme clme clock monitor operation enable or disable 0 disable clock monitor operation. 1 enable clock monitor operation. cautions 1. once the clme bit h as been set to 1, it cannot be cleared to 0 by any means other than reset. 2. when a reset by the clock monitor occu rs, the clme bit is cleared to 0 and the resf.clmrf bit is set to 1. 3. be sure to set bits 1 to 7 to ?0?.
chapter 28 clock monitor user?s manual u19201ej3v0ud 1372 28.4 operation this section explains the functions of the clock m onitor. the start and stop conditions are as follows. enabling operation by setting the clm.clme bit to 1 ? while oscillation stabilization time is being counted after stop mode is released ? when the main clock is stopped (from when pcc.mck bit = 1 during subclock operation to when pcc.cls bit = 0 during main clock operation) ? when the sampling clock (internal oscillation clock) is stopped ? when the cpu operates using the internal oscillation clock table 28-2. operation status of clock monitor (when clm.clme bit = 1, during internal oscillation clock operation) cpu operating clock operation mode status of main clock status of internal oscillation clock status of clock monitor halt mode oscillates oscillates note 1 operates note 2 idle1, idle2 modes oscillates oscillates note 1 operates note 2 main clock stop mode stops oscillates note 1 stops subclock (mck bit of pcc register = 0) sub-idle mode oscillates oscillates note 1 operates note 2 subclock (mck bit of pcc register = 1) sub-idle mode stops oscillates note 1 stops internal oscillation clock ? stops oscillates note 3 stops during reset ? stops stops stops notes 1. the internal oscillator can be stopped by setting the rcm.rstop bit to 1. 2. the clock monitor is stopped while t he internal oscillator is stopped. 3. the internal oscillator cannot be stopped by software.
chapter 28 clock monitor user?s manual u19201ej3v0ud 1373 (1) operation when main clock osc illation is stopped (clme bit = 1) if oscillation of the main clock is stopped when the clme bit = 1, an internal reset signal (clmres) is generated as shown in figure 28-2. figure 28-2. reset period due to that oscillation of main clock is stopped four internal oscillation clocks main clock internal oscillation clock clmres clm.clme bit resf.clmrf bit (2) clock monitor status after reset input reset input clears the clm.clme bit to 0 and stops the cl ock monitor operation. when clme bit is set to 1 by software at the end of the oscillation stabilization time of the main clock, monitoring is started. figure 28-3. clock monitor status after reset input (clm.clme bit = 1 is set after reset input and at the end of main clock oscillation stabilization time) cpu operation clock monitor status clme bit reset internal oscillation clock main clock reset oscillation stabilization time normal operation clock supply stopped normal operation monitoring monitoring stopped monitoring set to 1 by software
chapter 28 clock monitor user?s manual u19201ej3v0ud 1374 (3) operation in stop mode or after stop mode is released if the stop mode is set with the clm.clme bit = 1, t he monitor operation is st opped in the stop mode and while the oscillation stabilization ti me is being counted. after the osc illation stabilization time, the monitor operation is automatically started. figure 28-4. operation in stop mode or after stop mode is released clock monitor status during monitor monitor stops during monitor clme bit internal oscillation clock main clock cpu operation normal operation stop oscillation stabilization time normal operation oscillation stops oscillation stabilization time (set by osts register) (4) operation when main clock is stopped (arbitrary) during subclock operation (pcc.cls bit = 1) or when the main clock is stopped by setting the pcc.mck bit to 1, the monitor operation is stopped until the main cloc k operation is started (pcc.cls bit = 0). the monitor operation is automatically started when the main clock operation is started. figure 28-5. operation when main clock is stopped (arbitrary) clock monitor status during monitor monitor stops monitor stops during monitor clme bit internal oscillation clock main clock cpu operation oscillation stops subclock operation main clock operation oscillation stabilization time (set by osts register) oscillation stabilization time count by software pcc.mck bit = 1 (5) operation while cpu is operating on inte rnal oscillation clock (ccls.cclsf bit = 1) the monitor operation is not stopped when the cclsf bi t is 1, even if the clme bit is set to 1.
user?s manual u19201ej3v0ud 1375 chapter 29 low-voltage detector 29.1 functions the low-voltage detector (lvi) has the following functions. ? if the interrupt occurrence at low voltage detection is selected, the low-voltage detector compares the supply voltage (v dd ) and the detected voltage (v lv i ), and generates an internal interrupt signal (intlvi) when the supply voltage drops or rises across the detected voltage. ? if the reset occurrence at low voltage detection is sele cted, the low-voltage detector generates an interrupt reset signal (lvires) when the supply voltage (v dd ) drops across the detected voltage (v lv i ) ? interrupt or reset signal c an be selected by software. if the low-voltage detector is used to generate a reset sign al, the resf.lvirf bit is set to 1 when lvires signal is generated. for details of resf register, refer to chapter 27 reset function . 29.2 configuration figure 29-1 shows the block diagram of the low-voltage detector. figure 29-1. block diagram of low-voltage detector lvis0 lvion detected voltage source (v lvi ) v dd v dd intlvi internal bus n-ch low voltage detection level selection register (lvis) low voltage detection register (lvim) lvimd lvif internal reset signal (lvires) selector low voltage detection level selector ? +
chapter 29 low-voltage detector user?s manual u19201ej3v0ud 1376 29.3 registers the low-voltage detector is contro lled by the following registers. ? low voltage detection register (lvim) ? low voltage detection level selection register (lvis) (1) low voltage detection register (lvim) the lvim register is a special register. this can be written only in the special combination of the sequences (refer to 3.4.8 special register ). the lvim register is used to enable or disable low volt age detection, and to set the operation mode of the low- voltage detector. this register can be read or written in 8-bit or 1- bit units. however, the lvif bit is read-only. after reset: note 1 r/w address: fffff890h <7> 6 5 4 3 2 <1> <0> lvim lvion 0 0 0 0 0 lvimd lvif lv i o n note 2 low voltage detection operation enable or disable 0 disable operation. 1 enable operation. lvimd selection of operation mode of low voltage detection 0 generates interrupt request signal (intlvi) when the supply voltage drops or rises across the detection voltage value. 1 generate internal reset signal (lvires) when supply voltage < detected voltage. lv i f note 3 low voltage detection flag 0 when supply voltage > detected voltage, or when operation is disabled 1 supply voltage of connected power supply < detected voltage notes 1. reset by low-voltage detection: 82h reset due to other source: 00h 2. do not change the lvim.lvion bit from 1 to 0 while the supply voltage (v dd ) is lower than the detection voltage value (v lv i ) (lvion.lvif bit = 1). 3. after the lvi operation has started (lvion bi t = 1) or when intlvi has occurred, confirm the supply voltage state using the lvif bit. cautions 1. when the lvion and lvimd bits to 1, the low-voltage detector cannot be stopped until the reset request due to other than th e low-voltage detection is generated. 2. when the lvion bit is set to 1, the comparator in the lvi circuit starts operating. wait 0.2 ms or longer by software before checking the voltage at the lvif bit after the lvion bit is set. 3. be sure to clear bits 6 to 2 to ?0?.
chapter 29 low-voltage detector user?s manual u19201ej3v0ud 1377 (2) low voltage detection level selection register (lvis) the lvis register is used to select t he level of low voltage to be detected. this register can be read or written in 8-bit units. after reset: note r/w address: fffff891h 7 6 5 4 3 2 1 0 lvis 0 0 0 0 0 0 0 lvis0 lvis0 detection level 0 2.95 v (typ.) 1 reserved (setting prohibited) note reset by low-voltage detection: retained reset due to other source: 00h cautions 1. this register cannot be written until a reset request due to something other than low-voltage detection is generated after the lvim.lvion and lvim.lvimd bits are set to 1. 2. be sure to clear bits 7 to 1 to ?0?. (3) internal ram data status register (rams) the rams register is a special register. this can be written only in a special combination of sequences (refer to 3.4.8 special registers ). this register is a flag register that indicates whether the supply voltage drops below the ram retention voltage of internal ram and expanded internal ram. this register can be read or written in 8-bit or 1-bit units. the set/clear conditions for the ramf bit are shown below. ? setting conditions: detection of voltage lower than specified level set by instruction ? clearing condition: writing of 0 in specific sequence after reset: 01h note r/w address: fffff892h 7 6 5 4 3 2 1 <0> rams 0 0 0 0 0 0 0 ramf ramf ram retention voltage of internal ram and expanded internal ram detection 0 voltage lower than ram retention voltage is not detected 1 voltage lower than ram retention voltage is detected note this register is reset only when a voltage dr op below the ram retention voltage is detected.
chapter 29 low-voltage detector user?s manual u19201ej3v0ud 1378 29.4 operation depending on the setting of the lvim.vimd bit, an interrupt si gnal (intlvi) or an internal reset signal (lvires) is generated. how to specify each operation is described below, together with timing charts. 29.4.1 to use for internal reset signal (lvires) <1> mask the interrupt of lvi. <2> select the voltage to be detected by using the lvis.lvis0 bit. <3> set the lvim.lvion bit to 1 (to enable operation). <4> insert a wait cycle of 0.2 ms (max.) or more by software. <5> by using the lvim.lvif bit, check if the supply voltage > detected voltage. <6> set the lvimd bit to 1 (to generate an internal reset signal (lvires)). caution if lvimd bit is set to 1, the contents of the lvim and lvis registers cannot be changed until a reset request other than lvi is generated. figure 29-2. operation timing of low- voltage detector (lvimd bit = 1) supply voltage (v dd ) lvi detected voltage (2.95 v (typ.)) lvion bit lvi detected signal internal reset signal (active low) lvi reset request signal delay clear delay time
chapter 29 low-voltage detector user?s manual u19201ej3v0ud 1379 29.4.2 to use for interrupt (intlvi) <1> mask the interrupt of lvi. <2> select the voltage to be detected by using the lvis.lvis0 bit. <3> set the lvim.lvion bit to 1 (to enable operation). <4> insert a wait cycle of 0.2 ms (max.) or more by software. <5> by using the lvim.lvif bit, check if the supply voltage > detected voltage. <6> clear the interrupt request flag of lvi. <7> unmask the interrupt of lvi. <1> by using the lvim.lvif bit, check if the supply voltage > detected voltage. <2> clear the lvion bit to 0. figure 29-3. operation timing of low- voltage detector (lvimd bit = 0) external reset ic detected voltage reset pin intlvi signal supply voltage (v dd ) lvi detected voltage (2.95 v (typ.)) lvion bit lvi detected signal internal reset signal (active low) delay clear delay time delay note note since the lvion bit is the initial value (operation disabled) due to the external reset input, no intlvi interrupts occur. caution when the intlvi signal is generated, confirm, using the lvim/lvif bit, whether the intlvi signal is generated due to a supply voltage drop or rise across the detected voltage.
chapter 29 low-voltage detector user?s manual u19201ej3v0ud 1380 29.5 ram retention voltage detection operation the supply voltage and detected voltage are compared. w hen the supply voltage drops below the detected voltage (including on power application), the rams.ramf bit is set to 1. figure 29-4. operation timing of ram retention voltage detection function supply voltage (v dd ) 2.0 v (minimum ram retention voltage) reset pin rams.ramf bit initialize ram (ramf bit is also cleared) when power application, ramf bit is set ram data is not retained ramf bit = 0 is retained regardless of reset pin if v dd > 2.0 v initialize ram (ramf bit is also cleared) v dd < 2.0 v detected set ramf bit ram data is not retained remarks 1. the ramf bit is set to 1 if the supply volt age drops under the minimum ram retention voltage (2.0 v (typ.)). 2. the ramf bit operates regardl ess of the reset pin status.
chapter 29 low-voltage detector user?s manual u19201ej3v0ud 1381 29.6 emulation function when an in-circuit emulator is used, the operation of the ram retention flag (rams.ramf bit) can be pseudo- controlled and emulated by manipulating the pemu1 register on the debugger. this register is valid only in the emulation mode. it is invalid in the normal mode. (1) peripheral emulation register 1 (pemu1) after reset: 00h r/w address: fffff9feh 7 6 5 4 3 2 1 0 pemu1 0 0 0 0 0 evaramin 0 0 evaramin pseudo specification of ram retention voltage detection signal 0 do not detect voltage lower than ram retention voltage. 1 detect voltage lower than ram retention voltage (set ramf flag). caution this bit is not automatically cleared. [usage] when an in-circuit emulator is used, pseudo emulation of ramf is realized by rewriting this register on the debugger. <1> cpu break (cpu operation stops.) <2> set the evaramin bit to 1 by using a register write command. by setting the evaramin bit to 1, the ramf bit is se t to 1 on hardware (the internal ram data is invalid). <3> clear the evaramin bit to 0 by using a register write command again. unless this operation is performed (clearing the evaram in bit to 0), the ramf bit cannot be cleared to 0 by a cpu operation instruction. <4> run the cpu and resume emulation.
user?s manual u19201ej3v0ud 1382 chapter 30 regulator 30.1 overview the v850e/sj3-h and v850e/sk3-h include a regu lator to reduce power consumption and noise. this regulator supplies a stepped-down v dd power supply voltage to the oscillator block and internal logic circuits (except the a/d converter, d/a converte r, and output buffers). the regulator output voltage is set to 2.5 v (typ.). figure 30-1. regulator bv dd av ref0 av ref1 flmd0 v dd ev dd regc ev dd i/o buffer bidirectional level shifter bv dd i/o buffer regulator a/d converter d/a converter flash memory main oscillator internal digital circuits 2.5 v (typ.) sub-oscillator ev dd note bv dd note note v850e/sk3-h only caution use the regulator with a setting of v dd = ev dd = av ref0 = av ref1 bv dd .
chapter 30 regulator user?s manual u19201ej3v0ud 1383 30.2 operation the regulator of this product always operates in any mode (normal oper ation mode, halt mode, idle1 mode, idle2 mode, stop mode, subclock operation mode, sub-idle mode, or during reset). be sure to connect a capacitor (4.7 f) to the regc pin to stabilize the regulator output. a diagram of the regulator pin connection method is shown below. figure 30-2. regc pin connection reg v dd v ss regc input voltage voltage supply to main oscillator/internal logic = 2.5 v (typ.) 4.7 f voltage supply to sub-oscillator
user?s manual u19201ej3v0ud 1384 chapter 31 rom correction function 31.1 overview the rom correction function is used to replace part of t he program in the internal rom with the program of an external memory, internal ram, or expanded internal ram. by using this function, program bugs found in the internal rom can be corrected. up to eight addresses can be specified for correction. figure 31-1. block diagram of rom correction instruction address bus block replaced by dbtrap instruction instruction data bus rom dbtrap instruction generation block correction address register n (coradn) correction control register (corenn bit) comparator remark n = 0 to 7
chapter 31 rom correction function user?s manual u19201ej3v0ud 1385 31.2 registers (1) correction address registers 0 to 7 (corad0 to corad7) the corad0 to corad3 registers set the first addr ess of the program to be corrected in the rom. the program can be corrected at up to eight places bec ause eight coradn registers are provided (n = 0 to 7). the coradn register can be read or written in 32-bit units. if the higher 16 bits of the coradn register are used as the coradnh register, and the lower 16 bits as the coradnl register, these registers can be read or written in 16-bit units. reset sets these registers to 00000000h. because the rom capacity differs from one product to another, set the correction addresses in the following ranges. (a) v850e/sj3-h ? pd70f3931, 70f3932, 70f3933 (512 kb): 000000 0h to 007ffffh ? pd70f3934, 70f3935, 70f3936 (768 kb): 0000000h to 00bffffh ? pd70f3937, 70f3938, 70f3939 (1024 kb): 000 0000h to 00fffffh ? pd70f3474, 70f3475, 70f3476 (1280 kb) : 0000000h to 013ffffh ? pd70f3477, 70f3478, 70f3479 (1536 kb) : 0000000h to 017ffffh (b) v850e/sk3-h ? pd70f3925, 70f3926, 70f3927 (1024 kb): 000 0000h to 00fffffh ? pd70f3486, 70f3487, 70f3488 (1280 kb) : 0000000h to 013ffffh ? pd70f3480, 70f3481, 70f3482 (1536 kb) : 0000000h to 017ffffh
chapter 31 rom correction function user?s manual u19201ej3v0ud 1386 20 corad0 fffff840h, corad0l fffff840h, corad0h fffff842h, corad1 fffff844h, corad1l fffff844h, corad1h fffff846h, corad2 fffff848h, corad2l fffff848h, corad2h fffff84ah, corad3 fffff84ch, corad3l fffff84ch, corad3h fffff84eh, corad4 fffff850h, corad4l fffff850h, corad4h fffff852h, corad5 fffff854h, corad5l fffff854h, corad5h fffff856h, corad6 fffff858h, corad6l fffff858h, corad6h fffff85ah, corad7 fffff85ch, corad7l fffff85ch, corad7h fffff85eh correction address fixed to 0 0 coradn (n = 0 to 7) 31 20 21 1 0 correction address fixed to 0 0 coradn (n = 0 to 7) 31 21 1 0 (b) 768 kb, 1024 kb correction address fixed to 0 0 coradn (n = 0 to 7) 31 21 20 1 0 (a) 512 kb (c) 1280 kb, 1536 kb after reset: 00000000h r/w address: note note note be sure to set this bit to ?0?.
chapter 31 rom correction function user?s manual u19201ej3v0ud 1387 (2) correction control register (corcn) the corcn register disables or enables the correction op eration at the addresses set in the coradn register (n = 0 to 7). each channel can be enabled or disabled by this register. this register can be read or written in 8-bit or 1-bit units. reset sets this register to 00h. disabled enabled corenn 0 1 enables/disables correction operation corcn coren3 coren7 coren6 coren5 coren4 coren2 coren1 coren0 after reset: 00h r/w address: fffff880h 0 1 2 3 4 5 6 7 remark n = 0 to 7 table 31-1. correspondence between corcn register bits and coradn registers corcn register bit corresponding coradn register coren7 corad7 coren6 corad6 coren5 corad5 coren4 corad4 coren3 corad3 coren2 corad2 coren1 corad1 coren0 corad0
chapter 31 rom correction function user?s manual u19201ej3v0ud 1388 31.3 rom correction operation and program flow <1> if the address to be corrected and the fetch address of t he internal rom match, the fetch code is replaced by the dbtrap instruction. <2> when the dbtrap instruction is executed , execution branches to address 00000060h. <3> software processing after branching causes the resu lt of rom correction to be judged (the fetch address and rom correction operation are confirmed) and exec ution to branch to the correction software. <4> after the correction software has been executed, the re turn address is set, and return processing is started by the dbret instruction. caution the software that performs <3> and <4> must be executed in the inte rnal rom, internal ram, external memory, or expanded internal ram.
chapter 31 rom correction function user?s manual u19201ej3v0ud 1389 figure 31-2. rom correction operation and program flow reset & start fetch address = coradn? coradn = dbpc-2? corenn bit = 1? perform initial settings of microcontroller set coradn register change fetch code to dbtrap instruction branch to rom correction judgment address branch to correction code address of corresponding channel n execute fetch code read data for setting rom correction from external memory execute dbtrap instruction jump to address 00000060h execute correction code execute dbret instruction write return address to dbpc. write value of psw to dbpsw as necessary. set corcn register yes yes yes no no remarks 1. : processing by user program (software) 2. n = 0 to 7 : processing by rom correction (hardware) load program for judgment of rom correction and correction codes execute fetch code ilgop processing no
chapter 31 rom correction function user?s manual u19201ej3v0ud 1390 31.4 cautions (1) when setting an address to be corrected in the coradn re gister, clear the higher bits to 0 in accordance with the capacity of the internal rom. (2) the rom correction function cannot be used to correct data in the internal rom. it can only be used to correct instruction codes. if rom correction is us ed to correct data, that dat a is replaced with a dbtrap instruction code. (3) rom correction is not performed in regards to the ro m code before writing in the corcnn register ends. (4) after executing a dbtrap instruction, the psw.np, ep , and di bits are set to 111, and interrupt/exception cannot be acknowledged. after executing a dbtrap inst ruction, change the psw register value as required. (5) the dbpc and dbpsw registers can be accessed while dbtrap instructions are being executed. (6) if the addresses of the instructions executed immediately after the corcn n register setting (enabled) are set as the correction addresses, normal operation may not be obtained (dbtrap is not generated).
user?s manual u19201ej3v0ud 1391 chapter 32 flash memory the v850e/sj3-h and v850e/sk3-h incorporate flash memory. (1) v850e/sj3-h ? pd70f3931, 70f3932, 70f3933: 512 kb flash memory ? pd70f3934, 70f3935, 70f3936: 768 kb flash memory ? pd70f3937, 70f3938, 70f3939: 1024 kb flash memory ? pd70f3474, 70f3475, 70f3476: 1280 kb flash memory ? pd70f3477, 70f3478, 70f3479: 1536 kb flash memory (2) v850e/sk3-h ? pd70f3925, 70f3926, 70f3927: 1024 kb flash memory ? pd70f3486, 70f3487, 70f3488: 1280 kb flash memory ? pd70f3480, 70f3481, 70f3482: 1536 kb flash memory flash memory versions offer the following advantages for development environments and mass production applications. for altering software after the v850e/sj3-h or v850e/sk3-h is soldered onto the target system. for data adjustment when starting mass production. for differentiating software according to the specif ication in small scale production of various models. for facilitating inventory management. for updating software after shipment. 32.1 features 4-byte/1-clock access (when instruction is fetched) capacity: 1536/1280/1024/768/512 kb write voltage: erase/write with a single power supply rewriting method ? rewriting by communication with dedicated flash memory programmer via serial interface (on-board/off-board programming) ? rewriting flash memory by user program (self programming) flash memory write prohibit f unction supported (security function) safe rewriting of entire flash memory area by self programming using boot swap function interrupts can be acknowledged during self programming.
chapter 32 flash memory user?s manual u19201ej3v0ud 1392 32.2 memory configuration the internal flash memory areas of the v850e/sj3-h and v850e/sk3-h are divided into 4 kb blocks and can be programmed/erased in block units. all or so me of the blocks can also be erased at once. when the boot swap function is used, the boot swap cluster selected by the setting value of a boot block cluster is replaced by another boot swap cluster of the same size loca ted at the addresses higher than those of the cluster. for details of the boot swap function, see 32.5 rewriting by self programming . figure 32-1. flash memory mapping (1/2) (a) 512 kb/768 kb/1024 kb 1024 kb block 0 (4 kb) block 1 (4 kb) : block 127 (4 kb) block 128 (4 kb) : block 191 (4 kb) block 192 (4 kb) : block 255 (4 kb) : block 191 (4 kb) 768 kb block 0 (4 kb) block 1 (4 kb) block 127 (4 kb) block 128 (4 kb) : : 512 kb block 0 (4 kb) block 1 (4 kb) block 127 (4 kb) boot block cluster setting enabled area (512 kb) 000fffffh 000ff000h 000fefffh 000c1000h 000c0fffh 000c0000h 000bffffh 000bf000h 000befffh 00081000h 00080fffh 00080000h 0007ffffh 0007f000h 0007efffh 00002000h 00001fffh 00001000h 00000fffh 00000000h
chapter 32 flash memory user?s manual u19201ej3v0ud 1393 figure 32-1. flash memory mapping (2/2) (b) 1280 kb/1536 kb 1536 kb 1280 kb : : : : block 0 (4 kb) block 1 (4 kb) block 127 (4 kb) block 128 (4 kb) block 191 (4 kb) block 192 (4 kb) block 256 (4 kb) block 255 (4 kb) block 319 (4 kb) : : : : : : : block 0 (4 kb) block 1 (4 kb) block 127 (4 kb) block 128 (4 kb) block 191 (4 kb) block 192 (4 kb) block 256 (4 kb) block 255 (4 kb) block 319 (4 kb) block 320 (4 kb) block 383 (4 kb) boot block cluster setting enabled area (512 kb) 0017ffffh 0017f000h 0017efffh 00141000h 00140fffh 00140000h 0013ffffh 0013f000h 0013efffh 00101000h 00100fffh 00100000h 000fffffh 000ff000h 000fefffh 000c1000h 000c0fffh 000c0000h 000bffffh 000bf000h 000befffh 00081000h 00080fffh 00080000h 0007ffffh 0007f000h 0007efffh 00002000h 00001fffh 00001000h 00000fffh 00000000h
chapter 32 flash memory user?s manual u19201ej3v0ud 1394 32.3 functional outline the internal flash memories of the v850e/sj3-h and v850 e/sk3-h can be rewritten by using the rewrite function of the dedicated flash memory programmer, regardless of whether the v850e/sj3-h or v850e/sk3-h has already been mounted on the target system or not (off-board/on-board programming). in addition, a security function that prohi bits rewriting the user program written to the internal flash memory is also supported, so that the program c annot be changed by an unauthorized person. the rewrite function using the user program (self programmi ng) is ideal for an application where it is assumed that the program is changed after production/sh ipment of the target syst em. a boot swap function t hat rewrites the entire flash memory area safely is also supported. in addition, interrupt servicing is supported during self programming, so that the flash memory can be rewritten und er various conditions, such as while communicating with an external device. table 32-1. rewrite method rewrite method functional outline operation mode on-board programming flash memory can be rewritten after the device is mounted on the target system, by using a dedicated flash memory programmer. off-board programming flash memory can be rewritten before the device is mounted on the target system, by using a dedicated flash memory programmer and a dedicated program adapter board (fa series). flash memory programming mode self programming flash memory can be rewritten by executing a user program that has been written to the flash memory in advance by means of off-board/on- board programming. (during self-programming, instructions cannot be fetched from or data access cannot be made to the internal flash memory area. therefore, the rewrite program must be transferred to the internal ram or external memory in advance.) normal operation mode remark the fa series is a product of na ito densei machida mfg. co., ltd.
chapter 32 flash memory user?s manual u19201ej3v0ud 1395 table 32-2. basic functions support ( : supported, : not supported) function functional outline on-board/off-board programming self programming blank check the erasure status of the entire memory is checked. chip erasure the contents of the entire memory area are erased all at once. note block erasure the contents of specified memory blocks are erased. program writing to specified addresses, and a verify check to see if write level is secured are performed. verify/checksum data read from the flash memory is compared with data transferred from the flash memory programmer. (can be read by user program) read data written to the flash memory is read. security setting use of the chip erase command, block erase command, program command, and read command can be prohibited, and rewriting of the boot block cluster can be prohibited. (supported only when setting is changed from enable to disable) note this is possible by selecting the entire memory area for the block erase function. the following table lists the security functions. the ch ip erase command prohibit, block erase command prohibit, program command prohibit, read command prohibit, and rewritin g boot block cluster prohibit functions are enabled by default after shipment, and security can be set by rewr iting via on-board/off-board programming. each security function can be used in combination with the others at the same time. table 32-3. security functions function functional outline chip erase command prohibit execution of chip erase and block erase commands on all of the blocks is prohibited. once prohibition is set, all of the settings of prohi bition cannot be initialized because the chip erase command cannot be executed. block erase command prohibit execution of a block erase command on all of the blocks is prohi bited. setting of prohibition can be initialized by execution of a chip erase command. program command prohibit execution of program and block erase commands on all of the blocks is prohibited. setting of prohibition can be initialized by execution of the chip erase command. read command prohibit execution of a read command on all of t he blocks is prohibited. setting of the prohibition can be initialized by execution of the chip erase command. rewriting boot block cluster prohibit boot block clusters in block 0 to the specified block can be protected. rewriting (erasing and writing) the protected boot block clusters is disabled. even if the chip erase command is executed, setting of prohibition cannot be initialized. the maximum number of specifiable blocks is 127.
chapter 32 flash memory user?s manual u19201ej3v0ud 1396 table 32-4. security setting erase, write, read operations when each security is set ( : executable, : not executable, ? : not supported) notes on security setting function on-board/ off-board programming self programming on-board/ off-board programming self programming chip erase command prohibit chip erase command: block erase command: program command: note 1 read command: chip erasure: ? block erasure (flashblockerase): write (flashwordwrite): read (flashwordread): setting of prohibition cannot be initialized. block erase command prohibit chip erase command: block erase command: program command: read command: chip erasure: ? block erasure (flashblockerase): write (flashwordwrite): read (flashwordread): setting of prohibition can be initialized by chip erase command. program command prohibit chip erase command: block erase command: program command: read command: chip erasure: ? block erasure (flashblockerase): write (flashwordwrite): read (flashwordread): setting of prohibition can be initialized by chip erase command. read command prohibit chip erase command: block erase command: program command: read command: chip erasure: ? block erasure (flashblockerase): write (flashwordwrite): read (flashwordread): setting of prohibition can be initialized by chip erase command. supported only when setting is changed from enable to disable boot block cluster rewrite prohibit chip erase command: block erase command: note 2 program command: note 2 read command: chip erasure: ? block erasure (flashblockerase): note 2 write (flashwordwrite): note 2 read (flashwordread): setting of prohibition cannot be initialized. supported only when setting is changed from enable to disable note 3 notes 1. in this case, since the erase command is invalid, data different from the data already written in the flash memory cannot be written. 2. executable except in boot block cluster. 3. the boot block cluster rewrite prohibit functi on becomes effective after the reset input.
chapter 32 flash memory user?s manual u19201ej3v0ud 1397 32.4 rewriting by dedicated flash memory programmer the flash memory can be rewritten by using a dedicate d flash memory programmer after the v850e/sj3-h or v850e/sk3-h is mounted on the target system (on-board programming). the fl ash memory can also be rewritten before the device is mounted on the ta rget system (off-board programming) by using a dedicated program adapter (fa series). 32.4.1 programming environment the following shows the environment required for writing pr ograms to the flash memories of the v850e/sj3-h and v850e/sk3-h. figure 32-2. environment required for writing programs to flash memory host machine rs-232c dedicated flash memory programmer v850e/sj3-h, v850e/sk3-h flmd1 note v dd v ss reset uarta0/csib0/csib3 flmd0 usb note connect the flmd1 pin to the flash memory programmer or connect to a gnd via a pull-down resistor on the board. a host machine is required for controlling the dedicated flash memory programmer. uarta0, csib0, or csib3 is used for the interfac e between the dedicated flash memory programmer and the v850e/sj3-h and v850e/sk3-h to perform writing, erasing, etc. a dedicated program adapter (fa series) required for off-board writing. remark the fa series is a product of naito densei machida mfg. co., ltd.
chapter 32 flash memory user?s manual u19201ej3v0ud 1398 32.4.2 communication mode communication between the dedicated flash memory programmer and the v850e/sj3-h/v850e/sk3-h is performed by serial communication using the uarta0, csib0, or csib3 interfaces of the v850e/sj3-h/v850e/sk3- h. (1) uarta0 ? transfer rate: 9,600 to 500,000 bps figure 32-3. communication with dedica ted flash memory programmer (uarta0) dedicated flash memory programmer v850e/sj3-h, v850e/sk3-h v dd v ss reset txda0 rxda0 flmd1 flmd1 note v dd gnd reset rxd txd flmd0 flmd0 note connect the flmd1 pin to the flash memory programme r or connect to gnd via a pull-down resistor on the board. (2) csib0, csib3 ? serial clock: 2.4 khz to 5 mhz (msb first) figure 32-4. communication with dedicated flash memory programmer (csib0, csib3) dedicated flash memory programmer v850e/sj3-h, v850e/sk3-h flmd1 note v dd v ss reset sob0, sob3 sib0, sib3 sckb0, sckb3 flmd1 v dd gnd reset si so sck flmd0 flmd0 note connect the flmd1 pin to the flash memory programme r or connect to gnd via a pull-down resistor on the board.
chapter 32 flash memory user?s manual u19201ej3v0ud 1399 (3) csib0 + hs, csib3 + hs ? serial clock: 2.4 khz to 5 mhz (msb first) figure 32-5. communication with dedicated flash memory programmer (csib0 + hs, csib3 + hs) dedicated flash memory programmer v850e/sj3-h, v850e/sk3-h v dd v ss reset sob0, sob3 sib0, sib3 sckb0, sckb3 pcm0 v dd flmd1 flmd1 note gnd reset si so sck hs flmd0 flmd0 note connect the flmd1 pin to the flash memory programme r or connect to a gnd via a pull-down resistor on the board. the dedicated flash memory programmer outputs the tran sfer clock, and the v850e/sj3-h and v850e/sk3-h operates as a slave. when the pg-fp5 is used as the dedicated flash memory programmer, it generates the following signals to the v850e/sj3-h and v850e/sk3-h. for details, refer to the pg-fp5 user?s manual (u18865e) . table 32-5. signal connections of dedicated flash memory programmer (pg-fp5) pg-fp5 v850e/sj3-h, v850e/sk3-h processing for connection signal name i/o pin function pin name uarta0 csib0, csib3 csib0 + hs, csib3 + hs flmd0 output write enable/disable flmd0 flmd1 output write enable/disable flmd1 note 1 note 1 note 1 vdd ? v dd voltage generation/voltage monitor v dd gnd ? ground v ss clk output clock output to v850e/sj3-h, v850e/sk3-h x1, x2 note 2 note 2 note 2 reset output reset signal reset si/rxd input receive signal sob0, sob3/txda0 so/txd output transmit signal sib0, sib3/rxda0 sck output transfer clock sckb0, sckb3 hs input handshake signal for csib0 + hs, csib3 + hs communication pcm0 notes 1. wire these pins as shown in figures 32-6 and 32-7, or connect them to gnd via pull-down resistor on board. 2. clock cannot be supplied via the clk pin of the fl ash memory programmer. create an oscillator on board and supply the clock. remark : must be connected. : does not have to be connected.
chapter 32 flash memory user?s manual u19201ej3v0ud 1400 table 32-6. wiring of v850e/sj3-h, v8 50e/sk3-h flash writing adapters (fa-144gj-gae-b, fa-176gm-gar-b) (1/2) flash memory programmer (pg-fp5) connection pin csib0 + hs used csib0 used uarta0 used pin no. pin no. pin no. sj3-h sk3-h sj3-h sk3-h sj3-h sk3-h signal name i/o pin function name of fa board pin pin name gj gm pin name gj gm pin name gj gm si/rxd input receive signal si p41/sob0/ scl01 23 25 p41/sob0/ scl01 23 25 p30/txda0/ sob4 25 30 so/txd output transmit signal so p40/sib0/ sda01 22 24 p40/sib0/ sda01 22 24 p31/rxda0 /intp7/sib4 26 31 sck output transfer clock sck p42/sckb0/ intp2 24 26 p42/sckb0/ intp2 24 26 not needed ? ? x1 not needed ? ? not needed ? ? not needed ? ? clk output clock to v850e/sj3-h, v850e/sk3-h x2 not needed ? ? not needed ? ? not needed ? ? /reset output reset signal /reset reset 14 16 reset 14 16 reset 14 16 flmd0 output write voltage flmd0 flmd0 8 10 flmd0 8 10 flmd0 8 10 flmd1 output write voltage flmd1 pld5/ad5/ flmd1 110 134 pld5/ad5/ flmd1 110 134 pld5/ad5/ flmd1 110 134 hs input handshake signal for csi0 + hs communication reserve/ hs pcm0/wait 85 105 not needed ? ? not needed ? ? v dd 9 11 v dd 9 11 v dd 9 11 bv dd 104 124, 153 bv dd 104 124, 153 bv dd 104 124, 153 ev dd 34 39, 69 ev dd 34 39, 69 ev dd 34 39, 69 av ref0 1 1 av ref0 1 1 av ref0 1 1 vdd ? vdd voltage generation/volt age monitor vdd av ref1 5 5 av ref1 5 5 av ref1 5 5 v ss 11 13 v ss 11 13 v ss 11 13 av ss 2 2 av ss 2 2 av ss 2 2 bv ss 103 123, 154 bv ss 103 123, 154 bv ss 103 123, 154 gnd ? ground gnd ev ss 33 38, 70 ev ss 33 38, 70 ev ss 33 38, 70 cautions 1. be sure to connect the regc pin to gnd via 4.7 f capacitor. 2. clock cannot be supplied from the cl k pin of the flash memory programmer. create an oscillator on the board and supply clock. remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 32 flash memory user?s manual u19201ej3v0ud 1401 table 32-6. wiring of v850e/sj3-h, v850e/sk3-h flash writing adapters (fa-144gj-gae-b, fa-176gm-gar-b) (2/2) flash memory programmer (pg-fp5) connection pin csib0 + hs used csib3 used pin no. pin no. sj3-h sk3-h sj3-h sk3-h signal name i/o pin function name of fa board pin pin name gj gm pin name gj gm si/rxd input receive signal si p911/a11/sob3 72 88 p911/a11/sob3 72 88 so/txd output transmit signal so p910/a10/sib3 71 87 p910/a10/sib3 71 87 sck output transfer clock sck p912/a12/sckb3 73 89 p912/a12/sckb3 73 89 x1 not needed ? ? not needed ? ? clk output clock to v850e/sj3-h, v850e/sk3-h x2 not needed ? ? not needed ? ? /reset output reset signal /reset reset 14 16 reset 14 16 flmd0 output write voltage flmd0 flmd0 8 10 flmd0 8 10 flmd1 output write voltage flmd1 pld5/ad5/flmd1 110 134 pld5/ad5/flmd1 110 134 hs input handshake signal for csi0 + hs communication reserve/hs pcm0/wait 85 105 not needed ? ? v dd 9 11 v dd 9 9 bv dd 104 124, 153 bv dd 104 124, 153 ev dd 34 39, 69 ev dd 34 39, 69 av ref0 1 1 av ref0 1 1 vdd ? vdd voltage generation/voltage monitor vdd av ref1 5 5 av ref1 5 5 v ss 11 13 v ss 11 13 av ss 2 2 av ss 2 2 bv ss 103 123, 154 bv ss 103 123, 154 gnd ? ground gnd ev ss 33 38, 70 ev ss 33 38, 70 cautions 1. be sure to connect the regc pin to gnd via 4.7 f capacitor. 2. clock cannot be supplied from the cl k pin of the flash memory programmer. create an oscillator on the board and supply clock. remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 32 flash memory user?s manual u19201ej3v0ud 1402 figure 32-6. example of wiring of v850e/sj3- h flash writing adapte r (fa-144gj-gae-b) (in csib0 + hs mode) (1/2) v850e/sj3-h vdd gnd gnd vdd gnd vdd vdd gnd connect to vdd connect to gnd 25 30 20 15 75 80 85 90 95 100 105 35 40 45 50 55 60 65 70 110 115 120 125 130 135 140 1 5 10 rfu-3 rfu-2 vde flmd1 flmd0 rfu-1 si so sck /reset v pp reserve/hs x1 x2 note 4 note 1 note 2 note 2 note 3 4.7 f
chapter 32 flash memory user?s manual u19201ej3v0ud 1403 figure 32-6. example of wiring of v850e/sj3- h flash writing adapte r (fa-144gj-gae-b) (in csib0 + hs mode) (2/2) notes 1. wire the flmd1 pin as shown below, or connect it to gnd on board via a pull-down resistor. 2. pins used when csib3 is used 3. supply a clock by creating an oscillator on the fl ash writing adapter (enclos ed by the broken lines). here is an example of the oscillator. example x1 x2 4. pins used when uarta0 is used. caution do not input a high level to the drst pin. remarks 1. process the pins not shown in accord ance with processing of unused pins (see 2.4 pin i/o circuit types, i/o buffer power supplies and handling of unused pins ). 2. this adapter is for the 144-pin plastic lqfp package.
chapter 32 flash memory user?s manual u19201ej3v0ud 1404 figure 32-7. example of wiring of v850e/sk3 -h flash writing adapter (fa-176gm-gar-b) (in csib0 + hs mode) (1/2) 135 140 145 150 155 160 165 170 175 vdd gnd gnd vdd gnd vdd vdd gnd 1 5 10 15 20 25 30 35 40 90 95 100 105 110 115 120 125 130 45 50 55 60 65 70 75 80 85 v850e/sk3-h rfu-3 rfu-2 vde flmd1 flmd0 rfu-1 si so sck /reset v pp reserve/hs x1 x2 note 4 note 3 note 1 note 2 note 2 connect to vdd connect to gnd 4.7 f
chapter 32 flash memory user?s manual u19201ej3v0ud 1405 figure 32-7. example of wiring of v850e/sk3 -h flash writing adapter (fa-176gm-gar-b) (in csib0 + hs mode) (2/2) notes 1. wire the flmd1 pin as shown below, or connect it to gnd on board via a pull-down resistor. 2. pins used when csib3 is used 3. supply a clock by creating an oscillator on the fl ash writing adapter (enclos ed by the broken lines). here is an example of the oscillator. example x1 x2 4. pins used when uarta0 is used. caution do not input a high level to the drst pin. remarks 1. process the pins not shown in accord ance with processing of unused pins (see 2.4 pin i/o circuit types, i/o buffer power supplies and handling of unused pins ). 2. this adapter is for the 176-pin plastic lqfp package.
chapter 32 flash memory user?s manual u19201ej3v0ud 1406 32.4.3 flash memory control the following shows the procedure for manipulating the flash memory. figure 32-8. procedure for manipulating flash memory start select communication system manipulate flash memory end? yes supplies flmd0 pulse no end switch to flash memory programming mode
chapter 32 flash memory user?s manual u19201ej3v0ud 1407 32.4.4 selection of communication mode in the v850e/sj3-h and v850e/sk3-h, the communication m ode is selected by inputting pulses (12 pulses max.) to the flmd0 pin after switching to the flash memory programming mode. t he flmd0 pulse is generated by the dedicated flash memory programmer. the following shows the relationship between the number of pulses and the communication mode. figure 32-9. selection of communication mode v dd v dd reset (input) flmd1 (input) flmd0 (input) rxda0 (input) txda0 (output) v ss v dd v ss v dd v ss v dd v ss v dd v ss v dd v ss (note) power on oscillation stabilized communication mode selected flash control command communication (erasure, write, etc.) reset released note the number of clocks is as follows depending on the communication mode. flmd0 pulse communication mode remarks 0 uarta0 communication rate: 9,600 bps (after reset), lsb first 8 csib0 v850e/sj3-h and v850e/sk3-h perform slave operation, msb first 9 csib3 v850e/sj3-h and v850e/sk3-h perform slave operation, msb first 11 csib0 + hs v850e/sj3-h and v850e/sk3-h perform slave operation, msb first 12 csib3 + hs v850e/sj3-h and v850e/sk3-h perform slave operation, msb first other rfu setting prohibited caution when uarta0 is selected , the receive clock is calculate d based on the reset command sent from the dedicated flash memory progr ammer after receiving the flmd0 pulse.
chapter 32 flash memory user?s manual u19201ej3v0ud 1408 32.4.5 communication commands the v850e/sj3-h and v850e/sk3-h communicate with t he dedicated flash memory programmer by means of commands. the signals sent from the dedicated flash me mory programmer to the v850e/sj3-h and v850e/sk3-h are called ?commands?. the response signals sent from the v850e/sj3-h and v850e/sk3-h to the dedicated flash memory programmer are called ?response commands?. figure 32-10. communication commands dedicated flash memory programmer v850e/sj3-h, v850e/sk3-h command response command the following shows the commands for flash memory contro l in the v850e/sj3-h and v850e/sk3-h. all of these commands are issued from the dedicated flash memo ry programmer, and the v850e/sj3-h and v850e/sk3-h perform the processing corresponding to the commands. table 32-7. flash memory control commands support classification command name csib0, csib3 csib0 + hs, csib3 + hs uarta0 function blank check block blank check command checks if the contents of the memory in the specified block have been correctly erased. chip erase command erases the contents of the entire memory. erase block erase command erases the contents of the memory of the specified block. program program command writes the specified address range, and executes a contents verify check. verify command compares the contents of memory in the specified address range with data transferred from the flash memory programmer. verify checksum command reads the checksum in the specified address range. read read command reads the data written to the flash memory. silicon signature command reads silicon signature information. system setting, control security setting command disables the chip erase command, block erase command, program command, read command, and boot block cluster rewrite.
chapter 32 flash memory user?s manual u19201ej3v0ud 1409 32.4.6 pin connection when performing on-board writing, mount a connector on t he target system to conne ct to the dedicated flash memory programmer. also, incorporate a function on-board to switch from the normal operation mode to the flash memory programming mode. in the flash memory programming mode, all the pins not used for flash memory programming become the same status as that immediately after rese t. therefore, pin handling is required when the external device does not acknowledge the status immediately after a reset. (1) flmd0 pin in the normal operation mode, input a voltage of v ss level to the flmd0 pin. in the flash memory programming mode, supply a write voltage of v dd level to the flmd0 pin. because the flmd0 pin serves as a write protection pin in the self programming mode, a voltage of v dd level must be supplied to the flmd0 pin via port control, etc., before writing to the flash memory. for details, see 32.5.5 (1) flmd0 pin . figure 32-11. flmd0 pin connection example v850e/sj3-h, v850e/sk3-h flmd0 dedicated flash memory programmer connection pin pull-down resistor (r flmd0 )
chapter 32 flash memory user?s manual u19201ej3v0ud 1410 (2) flmd1 pin when 0 v is input to the flmd0 pin, t he flmd1 pin does not function. when v dd is supplied to the flmd0 pin, the flash memory programming mode is entered, so 0 v must be input to the flmd1 pin. the following shows an example of the connection of the flmd1 pin. figure 32-12. flmd1 pin connection example flmd1 pull-down resistor (r flmd1 ) other device v850e/sj3-h, v850e/sk3-h caution if the v dd signal is input to the flmd1 pin from another device during on-board writing and immediately after reset, isolate this signal. table 32-8. relationship between flmd0 and flmd1 pi ns and operation mode wh en reset is released flmd0 flmd1 operation mode 0 don?t care normal operation mode v dd 0 flash memory programming mode v dd v dd setting prohibited
chapter 32 flash memory user?s manual u19201ej3v0ud 1411 (3) serial interface pin the following shows the pins used by each serial interface. table 32-9. pins used by serial interfaces serial interface pins used uarta0 txda0, rxda0 csib0 sob0, sib0, sckb0 csib3 sob3, sib3, sckb3 csib0 + hs sob0, sib0, sckb0, pcm0 csib3 + hs sob3, sib3, sckb3, pcm0 when connecting a dedicated flash memory programmer to a serial interface pin that is connected to another device on-board, care should be taken to avoid conflic t of signals and malfunction of the other device. (a) conflict of signals when the dedicated flash memory progra mmer (output) is connected to a se rial interface pin (input) that is connected to another device (output), a conflict of signals occurs. to avoid the conflict of signals, isolate the connection to the other device or set the other device to the output high-impedance status. figure 32-13. conflict of signals (serial interface input pin) v850e/sj3-h, v850e/sk3-h input pin conflict of signals dedicated flash programmer connection pins other device output pin in the flash memory programming mode, the signal that the dedicated flash memory programmer sends out conflicts with signals another device outputs. therefore, isolate the signals on the other device side.
chapter 32 flash memory user?s manual u19201ej3v0ud 1412 (b) malfunction of other device when the dedicated flash memory programmer (output or input) is connected to a serial interface pin (input or output) that is connect ed to another device (input), the si gnal is output to the other device, causing the device to malfunction. to avoid th is, isolate the connection to the other device. figure 32-14. malfunction of other device v850e/sj3-h, v850e/sk3-h pin dedicated flash memory programmer connection pin other device input pin in the flash memory programming mode, if the signal output from the v850e/sj3-h or v850e/sk3-h affects another device, isolate the signal on the other device side. v850e/sj3-h, v850e/sk3-h pin dedicated flash memory programmer connection pin other device input pin in the flash memory programming mode, if the signal output from the dedicated flash memory programmer affects another device, isolate the signal on the other device side.
chapter 32 flash memory user?s manual u19201ej3v0ud 1413 (4) reset pin when the reset signals of the dedicated flash memory pr ogrammer are connected to the reset pin that is connected to the reset signal generator on-board, a conflict of signals occurs. to avoid the conflict of signals, isolate the connection to the reset signal generator. when a reset signal is input from the user system in the flash memory programming mode, the programming operation will not be performed correctly. therefore, do not input signals other than the reset signals from the dedicated flash memory programmer. figure 32-15. conflict of signals (reset pin) v850e/sj3-h, v850e/sk3-h reset dedicated flash memory programmer connection pin reset signal generator conflict of signals output pin in the flash memory programming mode, the signal that the reset signal generator outputs conflicts with the signal that the dedicated flash memory programmer outputs. therefore, isolate the signals on the reset signal generator side. (5) port pins (including nmi) when the system shifts to the flash memory programmi ng mode, all the pins that are not used for flash memory programming are in the same st atus as that immediately after rese t. if the external device connected to each port does not recognize the st atus of the port immediately after reset, pins require appropriate processing, such as connecting to v dd via a resistor or connecting to v ss via a resistor. (6) other signal pins connect x1, x2, xt1, xt2, and regc in the same status as that in t he normal operation mode. during flash memory programming, input a low level to the drst pin or leave it open. do not input a high level. (7) power supply supply the same power (v dd , v ss , ev dd , ev ss , bv dd , bv ss , av ref0 , av ref1 , av ss ) as in normal operation mode.
chapter 32 flash memory user?s manual u19201ej3v0ud 1414 32.5 rewriting by self programming 32.5.1 overview the v850e/sj3-h and v850e/sk3-h support a flash macro se rvice that allows the user program to rewrite the internal flash memory by itself. by using this interface a nd a self programming library that is used to rewrite the flash memory with a user application program, the flash memory can be rewritten by a user application transferred in advance to the internal ram, external memory or expand ed internal ram. consequently, the user program can be upgraded and constant data note can be rewritten in the field. note make sure that constant data of rewriting target is situated in a di fferent block than program code. see 32.2 memory configuration for the block configuration. figure 32-16. concept of self programming application program self programming library flash macro service flash memory flash function execution flash information erase, write
chapter 32 flash memory user?s manual u19201ej3v0ud 1415 32.5.2 features (1) function of self programming library flash memory self programming by the user program c an be performed by using a self programming library. this library has a set for calling c functi ons that execute the following features. ? blank check, erase, write, and verify of flash memory ? setting boot block cluster and boot swap ? security information setting ? obtaining information on flash memory (2) secure self programming (boot swap function) the v850e/sj3-h and v850e/sk3-h support a function to swap the blocks (clusters) of a flash memory block that starts from address 00000000h with a different clus ter of the same size which is located at the addresses higher than those of the cluster. boot swap cluster is a block that is swapped during boot swapping. the boot swap cluster is a boot area of the application program and an area can be selected. security setting to prohibit rewriting of the boot block cluster can be made. the size of the boot block cluster can be selected fr om 16, 32, 64, and 128 kb, depending on the setting of the boot block cluster. the boot swap function can be executed in that area. for details, refer to table 32-10 relationship between boot block cluster and boot swap cluster . in addition, which of the two clusters is active (to be booted) can be controlled by using a boot flag. the boot flag is stored in an area for flash information. the relationship between setting of an area of the boot block cluster and the boot swap cluster that is determined by it is shown below.
chapter 32 flash memory user?s manual u19201ej3v0ud 1416 table 32-10. relationship between boot block cluster and boot swap cluster boot block cluster set value note boot block cluster boot swap cluster 00h 00000000h to 00000fffh (4 kb) : : 03h 00000000h to 00003fffh (16 kb) 00000000h to 00003fffh (16 kb) 04h 00000000h to 00004fffh (20 kb) : : 07h 00000000h to 00007fffh (32 kb) 00000000h to 00007fffh (32 kb) 08h 00000000h to 00008fffh (36 kb) : : 0fh 00000000h to 0000ffffh (64 kb) 00000000h to 0000ffffh (64 kb) 10h 00000000h to 00010fffh (68 kb) : : 1fh 00000000h to 0001ffffh (128 kb) 20h 00000000h to 00020fffh (132 kb) : : 7fh 00000000h to 0007ffffh (512 kb) 00000000h to 0001ffffh (128 kb) 80h : ffh setting prohibited note settable by gui of the flash programmer or by flash self programming figure 32-17 shows an example of the boot swap function of a cluster consisting of flash memory blocks (set value of boot block cluster = 04h (boot swap cluster: 32 kb, boot block cluster: 20 kb)). after boot_flag is reversed, not (boot_flag) is assumed, and blocks 8 to 15 become active boot clusters. therefore, the user program is started by a new boot swap cluster after the next time reset is released.
chapter 32 flash memory user?s manual u19201ej3v0ud 1417 figure 32-17. example of boot swap function (set value of boot block cluster = 04h (boot swap cluster: 32 kb, boot block cluster: 20 kb)) 00000000h not (boot_flag) boot_flag swap last block : : : : block 16 block 15 block 14 block 9 block 8 block 7 block 4 block 0 last block : : : : block 16 block 15 block 14 block 9 block 8 block 7 block 4 block 0 boot swap cluster (inactive) boot swap cluster (active) boot swap cluster (active) boot swap cluster (inactive) boot block cluster (20 kb) remark the boot swap function realizes secure self programming. to rewrit e the boot code, boot_flag remains in the original status (cluster of bloc ks 0 to 7 is active) and a new code is written to a cluster (of blocks 8 to 15) that is not active. after writing the cluster that is not active (cluster of blocks 8 to 15) has been completed, change boot_flag (boot swap) and make a new boot code (cluster of blocks 8 to 15) active. for example, if rewriting a new boot code has fa iled because of a power failure or inadvertent reset, the original boot code remains active and rewriting can be resumed. (3) interrupt support instructions cannot be fetched from the flash memory dur ing self programming. conventionally, a user handler written to the flash memory could not be used even if an interrupt occurred. therefore, in the v850e/sj3-h and v850e/sk3-h, to use an interrupt during self programming, processing transits to the specific address note in the internal ram. allocate the ju mp instruction that transits processing to the user interrupt servicing at the specific address note in the internal ram. note nmi interrupt: start address of internal ram maskable interrupt: start address of internal ram + 4 addresses
chapter 32 flash memory user?s manual u19201ej3v0ud 1418 32.5.3 standard self programming flow the entire processing to rewrite the flash memory by flash self programming is illustrated below. figure 32-18. standard self programming flow flash environment initialization processing erase processing write processing internal verify processing flash memory manipulation flash environment end processing end of processing all blocks end? ? disable accessing flash area ? disable stopping clock ? disable setting of standby mode other than the halt mode ? disable dma transfer yes no
chapter 32 flash memory user?s manual u19201ej3v0ud 1419 32.5.4 flash functions table 32-11. flash function list function name outline support flashinit self-programming library initialization flashenv flash environment start/end flashflmdcheck flmd pin check flashstatuscheck hardware proc essing execution status check flashblockerase block erase flashwordwrite data write flashblockiverify internal verification of block flashblockblankcheck blank check of block flashsetinfo flash information setting flashgetinfo flash information acquisition flashbootswap boot swap execution 32.5.5 pin processing (1) flmd0 pin the flmd0 pin is used to set the operation mode when re set is released and to protect the flash memory from being written during self rewriting. it is therefore necessary to keep the voltage applied to the flmd0 pin at 0 v when reset is released and a normal operation is exec uted. it is also necessary to apply a voltage of v dd level to the flmd0 pin during the self programming m ode period via port control before the memory is rewritten. when self programming has been completed, the volt age on the flmd0 pin must be returned to 0 v. figure 32-19. mode change timing reset signal flmd0 pin v dd 0 v v dd 0 v self programming mode normal operation mode normal operation mode caution make sure that the flmd0 pin is at 0 v when reset is released.
chapter 32 flash memory user?s manual u19201ej3v0ud 1420 32.5.6 internal resources used the following table lists the internal resources used for se lf programming. these internal resources can also be used freely for purposes ot her than self programming. table 32-12. internal resources used resource name description stack area note an extension of the stack used by the user is used by the library (can be used in both the internal ram and external ram). library code note program entity of library (can be used anywhere other than the flash memory block to be manipulated). application program executed as a user application. calls flash functions. maskable interrupt can be used in user application execut ion status or self programming status. to use this interrupt in the self-programming status, since the processing transits to the address of the internal ram start address + 4 addresses, allocate the jump instruction that transits the processing to the user interrupt servicing at the address of the internal ram start address + 4 addresses in advance. nmi interrupt can be used in user application execution status or self programming status. to use this interrupt in the self-programming status, since the processing transits to the address of the internal ram start address, allocate the jump instruction that transits the processing to the user interrupt servicing at the internal ram start address in advance. note about resources used, refer to the flash memory self-programming library user?s manual.
user?s manual u19201ej3v0ud 1421 chapter 33 option byte function the flash memory of the v850e/sj3-h and v850e/sk3-h includes an option byte area for setting the option byte function. when writing a program to the flash memory, be sure to set the option byte area corresponding to the following options. the option byte functions determined by the option bytes are as follows. ? selection of dma transfer start fact or table set by the dtfr register ? selection of whether to enable or disable use of the intiic0 and intiic2 signals as dma transfer start factors in dtfr register setting ? specification of watchdog timer 2 input clock ? specification of watchdog timer 2 operating mode ? selection of whether the on-chip osci llator can be stopped by software or not ? selection of clock mode ? selection of pll input clock (f plli ) division ratio the option bytes are stored as 16-bit data in fl ash memory addresses 0000007ah and 0000007bh.
chapter 33 option byte function user?s manual u19201ej3v0ud 1422 33.1 option byte (0000007ah) 0 0 dtfrob0dtfrob1 0 0 wdtmd1 rmopin address: 0000007ah rmopim 0 1 can be stopped cannot be stopped internal oscillator can/cannot be stopped by software wdtmd1 0 1 input clock and operating mode can be selected by wdtm2 register. input clock: selectable from peripheral clock (f xp ), on-chip oscillation clock (f r ), or subclock (f xt ) operating mode: selectable from non-maskable interrupt request mode (intwdt2 signal generated) or reset mode (wdt2res signal generated) input clock and operating mode cannot be selected by wdtm2 register. input clock: fixed to internal oscillation clock (f r ) operating mode: fixed to reset mode (wdt2res signal generated) setting of watchdog timer 2 mode dtfrob1 0 1 dma transfer start factor when dtfr.ifcn5 to dtfr.ifcn0 bits = 28h: intua1r/intiic2 (shared) dma transfer start factor when dtfr.ifcn5 to dtfr.ifcn0 bits = 2ah: intua2r/intiic0 (shared) dma transfer start factor when dtfr.ifcn5 to dtfr.ifcn0 bits = 28h: intua1r (intiic2 is not a dma transfer start factor) dma transfer start factor when dtfr.ifcn5 to dtfr.ifcn0 bits = 2ah: intua2r (intiic0 is not a dma transfer start factor) selection of whether to enable or disable use of intiic0 and intiic2 as dma transfer start factors in dtfr register setting cautions 1. see table 22-1 dma tran sfer start factors for details of the dtfrob0 bit. 2. be sure to set bits 2, 3, 6 and 7 to ?0?.
chapter 33 option byte function user?s manual u19201ej3v0ud 1423 33.2 option byte (0000007bh) 0 0 0 0 selcm2 selcm1 selcm0 plli0 address: 0000007bh selcm2 0 1 1 1 selcm1 0 1 0 1 selcm0 0 1 0 0 clock mode selection clock mode 1 clock mode 2 clock mode 3 clock mode 4 setting prohibited other than above plli0 0 1 f plli = f x (no division) f plli = f x /2 (division by 2) pll input clock (f plli ) selection cautions 1. be sure to set the plli 0 bit to ?0? (no di vision) in clock mode 4. 2. be sure to set bits 4 to 7 to ?0?.
chapter 33 option byte function user?s manual u19201ej3v0ud 1424 an example of the program when using the ca850 is shown below. [program example] #-------------------------------------------------------------- # option_bytes #-------------------------------------------------------------- .section "option_bytes" .byte 0b00000001 -- 0x7a .byte 0b00000000 -- 0x7b .byte 0b00000000 -- 0x7c .byte 0b00000000 -- 0x7d .byte 0b00000000 -- 0x7e .byte 0b00000000 -- 0x7f caution be sure to write 6 bytes of data to this section. if fewer than 6 bytes are writte n, an error will occur at linking. error message: f4112: illega l "option_bytes" section size. remark set addresses 007ch to 007fh to 0x00.
user?s manual u19201ej3v0ud 1425 chapter 34 on-chip debug function the on-chip debug function of the v850e/sj3-h and v850e/sk3-h can be implemented by the following two methods. ? using the dcu (debug control unit) on-chip debug function is implemen ted by the on-chip dcu in the v 850e/sj3-h and v850e/sk3-h, with using the drst, dck, dms, ddi, and ddo pi ns as the debug interface pins. ? not using the dcu on-chip debug function is implemented by minicube2 or t he like, using the user res ources, instead of the dcu. the following table shows the features of the two on-chip debug functions. table 34-1. on-chip debug function features debugging using dcu debugging without using dcu debug interface pins drst, dck, dms, ddi, ddo ? when uarta0 is used rxda0, txda0 ? when csib0 is used sib0, sob0, sckb0, hs (pcm0) ? when csib3 is used sib3, sob3, sckb3, hs (pcm0) securement of user resources not required required hardware break function 2 points 2 points internal rom area 8 points 8 points software break function internal ram area 2000 points 2000 points real-time ram monitor function note 1 available available dynamic memory modification (dmm) function note 2 available available mask function reset, nmi, hldrq, wait reset pin rom security function 10-byte id code aut hentication 10-byte id code authentication hardware used ie-v850e1-cd-nw and ninicube ? , etc. ninicube2, etc. trace function not supported. not supported. event function not supported. not supported. debug interrupt interface function (dbint) not supported. not supported. notes 1. this is a function which reads out memo ry contents during program execution. 2. this is a function which rewrites ra m contents during program execution.
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1426 34.1 debugging with dcu programs can be debugged using the debug interface pi ns (drst, dck, dms, ddi, and ddo) to connect the on- chip debug emulator (ie-v850e1-cd-nw and minicube ? ). 34.1.1 connection circuit example figure 34-1. circuit connection example when debu g interface pins are used for communication interface ie-v850e1-cd-nw qb-v850mini v850e/sj3-h, v850e/sk3-h vdd dck dms ddi ddo drst reset flmd0 gnd v dd , ev dd dck dms ddi ddo drst note 2 reset flmd0 note 3 flmd1/pdl5 ev ss note 1 note 4 status targ et pow er notes 1. example of pin processing when the on- chip debug emulator is not connected 2. a pull-down resistor is provided on chip. 3. for flash memory rewriting 4. pin processing necessary when connecting a flash memory programmer to rewr ite the internal flash memory.
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1427 34.1.2 interface signals the interface signals are described below. (1) drst this is a reset input signal for the on-chip debug un it. it is a negative-logic signal that asynchronously initializes the debug control unit. the on-chip debug emulator raises the drst signal when it detects v dd of the target system after the integrated debugger is star ted, and starts the on-chip debug unit of the device. when the drst signal goes high, a reset signal is also generated in the cpu. when starting debugging by starti ng the integrated debugger, a cpu reset is always generated. (2) dck this is a clock input signal. it supplies a 20 mhz or 10 mhz clock from the on-chip debug emulator. in the on- chip debug unit, the dms and ddi signals are sampled at the rising edge of the dck signal, and the data ddo is output at its falling edge. (3) dms this is a transfer mode select signal. the transfer st atus in the debug unit changes depending on the level of the dms signal. (4) ddi this is a data input signal. it is sampled in the on-chip debug unit at the rising edge of dck. (5) ddo this is a data output signal. it is output from the on- chip debug unit at the falling edge of the dck signal. (6) v dd , ev dd this signal is used to detect vdd of the target system. if vdd from t he target system is not detected, the signals output from the on-chip debug emulator (drs t, dck, dms, ddi, flmd0, and reset) go into a high- impedance state.
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1428 (7) flmd0 the flash self programming function is used for the function to download data to the flash memory via the integrated debugger. during flash self programming, the flmd0 pin must be kept high. in addition, connect a pull-down resistor to the flmd0 pin. the flmd0 pin can be controlled in either of the following two ways. <1> to control from on-chip debug emulator connect the flmd0 signal of the on-ch ip debug emulator to the flmd0 pin. in the normal mode, nothing is driven by th e on-chip debug emulator (high impedance). during a break, the on-chip d ebug emulator raises t he flmd0 pin to the hi gh level when the download function of the integrated debugger is executed. <2> to control from port connect any port of the device to the flmd0 pin. the same port as the one used by the user program to realize the fl ash self programming function may be used. on the console of the integrated debugger, make a setting to raise the port pin to high level before executing the download function, or lower the port pin after executing the download function. for details, refer to the id850qb (integrated debugger) operation user?s manual . (8) reset this is a system reset input pin. if the drst pin is made invalid by the value of the ocdm.ocdm0 bit set by the user program, on-chip debugging cannot be executed. ther efore, reset is effected by the on-chip debug emulator, using the reset pin, to make the drst pin valid (initialization).
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1429 34.1.3 maskable functions reset, nmi, wait, and hldrq signals can be masked. the maskable functions with the debu gger (id850qb) and the correspondi ng v850e/sj3-h and v850e/sk3-h functions are listed below. table 34-2. maskable functions maskable functions with id850qb correspondi ng v850e/sj3-h and v850e/sk3-h functions nmi0 nmi pin input nmi2 ? stop ? hold hldrq pin input reset reset signal (wdt2res) generation by reset pin input and watchdog timer overflow, reset signal (lvires) generation by low-voltage detector (lvi), reset signal (clmres) generation by clock monitor (clm) wait wait pin input 34.1.4 register (1) on-chip debug m ode register (ocdm) the ocdm register is used to sele ct the normal operation mode or on-chip debug mode. this register is a special register and can be written only in a combination of specific sequences (see 3.4.8 special registers ). this register is also used to specify whether a pi n provided with an on-chip debug function is used as an on- chip debug pin or as an ordinary port/peripheral function pin. it also is used to disconnect the internal pull- down resistor of the p05/intp2/drst pin. the ocdm register can be written only while a low level is input to the drst pin. this register can be read or written in 8-bit or 1-bit units.
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1430 0 ocdm0 0 1 operation mode ocdm 0 0 0 0 0 0 ocdm0 after reset: 01h note r/w address: fffff9fch when drst pin is low: normal operation mode (in which a pin that functions alternately as an on-chip debug function pin is used as a port/peripheral function pin) when drst pin is high: on-chip debug mode (in which a pin that functions alternately as an on-chip debug function pin is used as an on-chip debug mode pin) selects normal operation mode (in which a pin that functions alternately as on-chip debug function pin is used as a port/peripheral function pin) and disconnects the on-chip pull-down resistor of the p05/intp2/drst pin. < > note reset by the reset pin sets this register to 01h . after reset by the ov erflow of watchdog timer (wdt2res), reset (lvires) by the low-voltage detect or (lvi), or reset (clm) by the clock monitor (clmres), however, the value of the ocdm register is retained. cautions 1. when using the ddi, ddo, dck, and dms pins not as on-chip debug pins but as port pins after external reset, any of the following actions must be taken. ? input a low level to the p05/intp2/drst pin. ? set the ocdm0 bit. in this case, take the following actions. <1> clear the ocdm0 bit to 0. <2> fix the p05/intp2/drst pin to the low level until <1> is completed. 2. the drst pin has an on-chip pull-down resist or. this resistor is disconnected when the ocdm0 flag is cleared to 0. ocdm0 flag (1: pull-down on, 0: pull-down off) 10 to 100 k (30 k (typ.)) drst
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1431 34.1.5 operation the on-chip debug function is made invalid under the conditions shown in the table below. when this function is not used, keep the drst pin low until the ocdm.ocdm0 flag is cleared to 0. ocdm0 flag drst pin 0 1 l invalid invalid h invalid valid remark l: low-level input h: high-level input figure 34-2. timing when on-chip debug function is not used low-level input after ocdm0 bit is cleared, high level can be input/output. clearing ocdm0 bit releasing reset reset ocdm0 p05/intp2/drst
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1432 34.1.6 cautions (1) if a reset signal is input (from the target system or a reset signal from an internal reset source) during run (program execution), the br eak function may malfunction. (2) even if the reset signal is masked by the mask function, the i/o buffer (port pin) ma y be reset if a reset signal is input from a pin. (3) pin reset during a break is masked and the cpu and per ipheral i/o are not reset. if pi n reset or internal reset is generated as soon as the flash memo ry is rewritten by dmm or read by the ram monitor function while the user program is being executed, the cpu and peripheral i/o may not be correctly reset. (4) emulation of rom corre ction cannot be executed. (5) in the on-chip debug mode, the ddo pin is forcibly set to the high-level output. (6) initialize the asid register to 00h during on-chip debugging.
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1433 34.2 debugging without using dcu the following describes how to implement an on-chip de bug function using minicube2 with pins for uarta0 (rxda0 and txda0), pins for csib0 (sib0, sob0, sckb0, and hs (pcm0)), or pins for csib3 (sib3, sob3, sckb3, and hs (pcm0)) as debug interfaces, without using the dcu. 34.2.1 circuit connection examples figure 34-3. circuit connection example when uart a0/csib0/csib3 is used for communication interface qb-mini2 v850e/sj3-h, v850e/sk3-h gnd v dd v dd reset_out rxd/si note 1 vdd txd/so note 1 sck hs clk note 2 flmd1 note 3 flmd0 note 3 reset_in note 4 v ss txda0/sob0/sob3 v dd rxda0/sib0/sib3 sckb0/sckb3 flmd1 reset circuit flmd0 port x 100 10 k 1 to 10 k 1 k reset signal 10 k 1 to 10 k 1 to 10 k 3 to 10 k 1 to 10 k v dd note 5 v dd v dd hs (pcm0) reset m in ic u b e2 m inic u b e 2 notes 1. connect txda0/sob0/sob3 (transmit side) of the v850e/sj3-h or v850e/sk3-h to rxd/si (receive side) of the target connector, and txd/so (transmit side) of the target connector to rxda0/sib0/sib3 (receive side) of the v850e/sj3-h or v850e/sk3-h. 2. this pin may be used to supply a clock from minicube2 during flash memory programming. for details, refer to chapter 32 flash memory . 3. during debugging, this pin is used as an input (unused) pin and can be used for its alternate functions. a pull-down resistor of 100 k is connected to this pin in minicube2. 4. this connection is designed assuming that the reset signal is output from the n-ch open-drain buffer (output resistance: 100 or less). 5. the circuit enclosed by a dashed line is designed for flash self programming, which controls the flmd0 pin via ports. use the port for inputting or outputting the high level. when flash self programming is not performed, a pull-down resistanc e for the flmd0 pin can be within 1 to 10 k . remark refer to table 34-3 for pins used when uarta0, csib0, or csib3 is used for communication interface.
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1434 table 34-3. wiring between v850e/sj3-h, v850e/sk3-h, and minicube2 pin configuration of minicube2 (qb-mini2) wi th csib0-hs with csib3-hs with uarta0 pin no. pin no. pin no. sj3-h sk3-h sj3-h sk3-h sj3-h sk3-h signal name i/o pin function pin name gj gm pin name gj gm pin name gj gm si/rxd input pin to receive commands and data from v850e/sj3-h and v850e/sk3-h p41/sob0 23 25 p911/sob3 72 88 p30/txda0 25 30 so/txd output pin to transmit commands and data to v850e/sj3-h and v850e/sk3-h p40/sib0 22 24 p910/sib3 71 87 p31/rxda0 26 31 sck output clock output pin for 3- wire serial communication p42/sckb0 24 26 p912/sckb3 73 89 not needed ? ? clk note output clock output pin to v850e/sj3-h and v850e/sk3-h not needed note ? ? not needed note ? ? not needed note ? ? reset_out output reset output pin to v850e/sj3-h and v850e/sk3-h reset 14 16 reset 14 16 reset 14 16 flmd0 output output pin to set v850e/sj3-h and v850e/sk3-h to debug mode or programming mode flmd0 8 10 flmd0 8 10 flmd0 8 10 flmd1 output output pin to set programming mode pld5/flmd1 110 134 pld5/flmd1 110 134 pld5/flmd1 110 134 hs input handshake signal for csi0 + hs communication pcm0 85 105 pcm0 85 105 not needed ? ? gnd ? ground v ss 11 13 v ss 11 13 v ss 11 13 reset_in input reset input pin on the target system note it is used as the clock output of the flash pr ogrammer for minicube2. for details, refer to chapter 32 flash memory . remark sj3-h: v850e/sj3-h sk3-h: v850e/sk3-h gj (v850e/sj3-h): 144-pin plastic lqfp (fine pitch) (20 20) gm (v850e/sk3-h): 176-pin plastic lqfp (fine pitch) (24 24)
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1435 34.2.2 maskable functions only reset signals can be masked. the functions that can be masked with the debugger (id850qb) and the corresponding functions of the v850e/sj3-h and v850e/sk3-h are listed below. table 34-4. maskable functions maskable functions with id850qb correspondi ng v850e/sj3-h and v850e/sk3-h functions nmi0 ? nmi1 ? nmi2 ? stop ? hold ? reset reset signal generation by reset pin input wait ?
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1436 34.2.3 securement of user resources the user must prepare the following to perform communi cation between minicube2 and the target device and implement each debug function. these it ems need to be set in the user program or using the compiler options. (1) securement of memory space the shaded portions in figure 34-4 are the areas rese rved for placing the debug monitor program, so user programs and data cannot be allocated in these spaces. these spaces must be secured so as not to be used by the user program. (2) security id setting the id code must be embedded in the area between 0000 070h and 0000079h in figure 34-4, to prevent the memory from being read by an unauthorized person. for details, refer to 34.3 rom security function .
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1437 figure 34-4. memory spaces where de bug monitor programs are allocated csi/uart receive interrupt vector (4 bytes) reset vector (4 bytes) interrupt vector for debugging (4 bytes) (2 kb) security id area (10 bytes) : debugging area note 1 internal rom (16 bytes) access-prohibited area internal ram internal rom area note 2 internal ram area 0000070h 0000060h 0000000h 3ff0000h 3ffeff0h 3ffefffh notes 1. address values vary depending on the product. internal rom size address value pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), 70f3933 (v850e/sj3-h) 512 kb 007f800h to 007ffffh pd70f3934 (v850e/sj3-h), 70f3935 (v850e/sj3-h), 70f3936 (v850e/sj3-h) 768 kb 00bf800h to 00bffffh pd70f3925 (v850e/sk3-h), 70f3926 (v850e/sk3-h), 70f3927 (v850e/sk3-h), 70f3937 (v850e/sj3-h), 70f3938 (v850e/sj3-h), 70f3939 (v850e/sj3-h) 1024 kb 00ff800h to 00fffffh pd70f3474 (v850e/sj3-h), 70f3475 (v850e/sj3-h), 70f3476 (v850e/sj3-h), 70f3486 (v850e/sk3-h), 70f3487 (v850e/sk3-h), 70f3488 (v850e/sk3-h) 1280 kb 013f800h to 013ffffh pd70f3477 (v850e/sj3-h), 70f3478 (v850e/sj3-h), 70f3479 (v850e/sj3-h), 70f3480 (v850e/sk3-h), 70f3481 (v850e/sk3-h), 70f3482 (v850e/sk3-h) 1536 kb 017f800h to 017ffffh 2. when uarta0 is used, when csib0 is used, and when csib3 is us ed, the start address value is as follows: target serial interface inte rnal ram size address value uarta0 intua0r 0000310h csib0 intcb0r 0000290h csib3 intcb3r 00002f0h
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1438 (3) reset vector a reset vector includes the jump in struction for the debug monitor program. [how to secure areas] it is not necessary to secure this area intentionally. when downloading a program, however, the debugger rewrites the reset vector in accordance with the followin g cases. if the rewritt en pattern does not match the following cases, the debugger generates an error (f0c34 when using the id850qb). (a) when two nop instructions ar e placed in succession from address 0 before rewriting after rewriting 0x0 nop jumps to debug monitor program at 0x0 0x2 nop 0x4 xxxx 0x4 xxxx (b) when two 0xffff are successi vely placed from address 0 (already era sed device) before rewriting after rewriting 0x0 0xffff jumps to debug monitor program at 0x0 0x2 0xffff 0x4 xxxx 0x4 xxxx (c) the jr instruction is placed at address 0 (when using ca850) before rewriting after rewriting 0x0 jr disp22 jumps to debug monitor program at 0x0 0x4 jr disp22 - 4 (d) mov32 and jmp are placed in succession from address 0 (when using iar compiler iccv850) before rewriting after rewriting 0x0 mov imm32,reg1 jumps to debug monitor program at 0x0 0x6 jmp [reg1] 0x4 mov imm32,reg1 0xa jmp [reg1] (e) the jump instruction for the debug monitor program is placed at address 0 before rewriting after rewriting jumps to debug monitor program at 0x0 no change
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1439 (4) securement of area for debug monitor program the shaded portions in figure 34-4 are the areas where the debug monitor program is allocated. the monitor program performs initialization processing for debug commu nication interface and run or break processing for the cpu. the internal rom area mu st be filled with 0xff. this area mu st not be rewritten by the user program. [how to secure areas] it is not necessarily required to secure this area if the user program does not use this area. to avoid problems that may occur during the debugger st artup, however, it is recommended to secure this area in advance, using the compiler. the following shows examples for securing the area, using the nec electronics compiler ca850. add the assemble source file and link directive code, as shown below. ? assemble source (add the following code as an assemble source file.) -- secures 2 kb space for monitor rom section .section "monitorrom", const .space 0x800, 0xff -- secures interrupt vector for debugging .section "dbg0" .space 4, 0xff -- secures interrupt vector for serial communication -- change the section name according to the serial communication mode used .section "intcb0r" .space 4, 0xff -- secures 16-byte space for monitor ram section .section "monitorram", bss .lcomm monitorramsym, 16, 4 -- defines symbol monitorramsym ? link directive (add the following code to the link directive file.) the following shows an example when the intern al rom has 512 kb (end address is 007ffffh) and internal ram has 60 kb (end address is 3ffefffh). mromseg : !load ?r v0x07f800{ monitorrom = $progbits ?a monitorrom; }; mramseg : !load ?rw v0x03ffeff0{ monitorram = $nobits ?aw monitorram; };
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1440 (5) securement of communication serial interface uarta0, csib0, or csib3 is used for communicati on between minicube2 and the target system. the settings related to the serial interface modes are perfo rmed by the debug monitor prog ram, but if the setting is changed by the user program, a communication error may occur. to prevent such a problem from occurring, communica tion serial interface must be secured in the user program. [how to secure communica tion serial interface] ? on-chip debug mode register (ocdm) for the on-chip debug function using the uarta0, csib0, or csib3, set the ocdm register functions to normal mode. be sure to set as follows. ? input low level to the p05/intp2/drst pin. ? set the ocdm0 bit as shown below. <1> clear the ocdm0 bit to 0. <2> fix the p05/intp2/drst pin input to low level until the processing of <1> is complete. ? serial interface registers do not set the registers related to csib0, csib3, or uarta0 in the user program. ? interrupt mask register when csib0 is used, do not mask the reception comple tion interrupt (intcb0r). when csib3 is used, do not mask the reception completion interrupt (intcb3r). when uarta0 is used, do not mask the reception completion interrupt (intua0r). (a) when csib0 is used cb0ric 0 6543210 7 (b) when csib3 is used cb3ric 0 6543210 7 (c) when uarta0 is used ua0ric 0 6543210 7 remark : don?t care
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1441 ? port registers when uarta0 is used when uarta0 is used, port registers are set to make the txda0 and rxda0 pins valid by the debug monitor program. do not change the following regist er settings with the user program during debugging. (the same value can be overwritten.) pfc3 00 6543210 7 pfce3 00 6543210 7 pmc3 11 6543210 7 remark : don?t care ? port registers when csib0 is used when csib0 is used, port registers are set to make the sib0, sob0, sckb0, and hs (pcm0) pins valid by the debug monitor program. do not change the following register setti ngs with the user program during debugging. (the same value can be overwritten.) (a) sib0, sob0, and sckb0 settings pmc4 111 6543210 7 pfc4 0 00 6543210 7 (b) hs (pcm0 pin) settings 0 pmccm 000 0 6543210 7 1 pmcm 1 0 6543210 7 0 pcm 0 note 6543210 7 note writing to this bit is prohibited. the port values corresponding to the hs pin ar e changed by the monitor program according to the debugger status. to perform port register settings in 8-bit units, the user program can usually use read-modify-write. if an interrupt for debugging occurs before writing, however, an unexpected operation may be performed. remark : don?t care
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1442 ? port registers when csib3 is used when csib3 is used for communication, port register s are set to make the sib3, sob3, sckb3, and hs (pcm0) pins valid by the debug monitor program. do not change the following register settings with the user program during debugging. (the same value can be overwritten.) (a) sib3, sob3, and sckb3 settings pmc9h 111 14 13 12 11 10 9 8 15 pfc9h 111 14 13 12 11 10 9 8 15 pfce9h 000000 14 13 12 11 10 9 8 15 (b) hs (pcm0 pin) settings 0 pmccm 000 0 6543210 7 1 pmcm 1 0 6543210 7 0 pcm 0 note 6543210 7 note writing to this bit is prohibited. the port values corresponding to the hs pin ar e changed by the monitor program according to the debugger status. to perform port register settings in 8-bit units, the user program can usually use read-modify-write. if an interrupt for debugging occurs before writing, however, an unexpected operation may be performed. remark : don?t care
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1443 32.2.4 cautions (1) handling of device that was used for debugging do not mount a device that was used for debugging on a mass-produced product, because the flash memory was rewritten during debugging and the number of rewr ites of the flash memory cannot be guaranteed. moreover, do not embed the debug monitor program into mass-produced products. (2) when breaks cannot be executed forced breaks cannot be executed if one of the following conditions is satisfied. ? interrupts are disabled (di) ? interrupts issued for the serial interface, whic h is used for communication between minicube2 and the target device, are masked ? standby mode is entered while standby releas e by a maskable interrupt is prohibited ? mode for communication between minicube2 and the tar get device is uarta0, and the main clock has been stopped (3) when pseudo real-ti me ram monitor (rrm) function and dmm function do not operate the pseudo rrm function and dmm function do not operat e if one of the following conditions is satisfied. ? interrupts are disabled (di) ? interrupts issued for the serial interface, whic h is used for communication between minicube2 and the target device, are masked ? standby mode is entered while standby releas e by a maskable interrupt is prohibited ? mode for communication between minicube2 and the tar get device is uarta0, and the main clock has been stopped ? mode for communication between minicube2 and the tar get device is uarta0, and a clock different from the one specified in the debugger is used for communication (4) standby release with pseudo rrm and dmm functions enabled the standby mode is released by the pseudo rrm function and dmm function if one of the following conditions is satisfied. ? mode for communication between minicube2 and the target device is csib0 or csib3 ? mode for communication between minicube2 and the tar get device is uarta0, and the main clock has been supplied. (5) rewriting to peripheral i/o registers that re quires a specific sequence, using dmm function peripheral i/o registers that requires a specific sequence cannot be rewritt en with the dmm function. (6) flash self programming if a space where the debug monitor program is allocated is rewritten by flash self programming, the debugger can no longer operate normally.
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1444 34.3 rom security function 34.3.1 security id the flash memory versions of the v850e/sj3-h and v850 e/sk3-h perform authentication using a 10-byte id code to prevent the contents of the flash memory from being read by an unauthorized person during on-chip debugging by the on-chip debug emulator. set the id code in the 10-byte on-chip flash memory area from 0000070h to 0000079h to allow the debugger perform id authentication. if the ids match, the security is released and reading fl ash memory and using the on-chip debug emulator are enabled. ? set the 10-byte id code to 0000070h to 0000079h. ? bit 7 of 0000079h is the on-chip debug emul ator enable flag (0: disable, 1: enable). ? when the on-chip debug emulator is started, the debugger requests id input. when the id code input on the debugger and the id code set in 0000070h to 0000079h match, the debugger starts. ? debugging cannot be performed if the on-chip debug emul ator enable flag is 0, even if the id codes match. figure 34-5. security id area 0000079h 0000070h 0000000h security id (10 bytes) caution when the data in the flash memory has been erased, all the bits are set to 1.
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1445 34.3.2 setting the following shows how to set the id code as shown in table 34-5. when the id code is set as shown in table 34-5, the id code input in the configuration dialog box of the id850qb is ?123456789abcdef123d4? (the id code is case-insensitive). table 34-5. id code address value 0x70 0x12 0x71 0x34 0x72 0x56 0x73 0x78 0x74 0x9a 0x75 0xbc 0x76 0xde 0x77 0xf1 0x78 0x23 0x79 0xd4 the id code can be specified for the device file that suppor ts ca850 ver. 3.10 or later and the security id using the pm+ compiler common option setting.
chapter 34 on-chip debug function user?s manual u19201ej3v0ud 1446 [program example (when usi ng ca850 ver. 3.10 or later)] #-------------------------------------- # securityid #-------------------------------------- .section "security_id" --interrupt handler address 0x70 .word 0x78563412 --0-3 byte code .word 0xf1debc9a --4-7 byte code .hword 0xd423 --8-9 byte code remark add the above program exam ple to the startup files.
user?s manual u19201ej3v0ud 1447 chapter 35 electrical specifications 35.1 absolute maximum ratings (t a = 25 c) (1/2) parameter symbol conditions ratings unit v dd v dd = ev dd = av ref0 = av ref1 ? 0.5 to +4.6 v bv dd ? 0.5 to +4.6 v ev dd v dd = ev dd = av ref0 = av ref1 ? 0.5 to +4.6 v av ref0 v dd = ev dd = av ref0 = av ref1 ? 0.5 to +4.6 v av ref1 v dd = ev dd = av ref0 = av ref1 ? 0.5 to +4.6 v v ss v ss = ev ss = bv ss = av ss ? 0.5 to +0.5 v av ss v ss = ev ss = bv ss = av ss ? 0.5 to +0.5 v bv ss v ss = ev ss = bv ss = av ss ? 0.5 to +0.5 v supply voltage ev ss v ss = ev ss = bv ss = av ss ? 0.5 to +0.5 v v i1 reset, flmd0 ? 0.5 to ev dd + 0.5 note 1 v v i2 note 3 ? 0.5 to bv dd + 0.5 note 1 v v i3 p10, p11 ? 0.5 to av ref1 + 0.5 note 1 v v i4 x1, x2 ? 0.5 to v ro note 2 + 0.5 note 1 v v i5 note 4 ? 0.5 to +6.0 v input voltage v i6 xt1, xt2 ? 0.5 to v dd + 0.5 note 1 v analog input voltage v ian p70 to p715 ? 0.5 to av ref0 + 0.5 note 1 v notes 1. be sure not to exceed the absolute maximum ratings (max. value) of each supply voltage. 2. on-chip regulator output voltage (2.5 v (typ.)) 3. v850e/sj3-h: pcd0 to pcd3, pcm0 to pcm5, pcs0 to pcs7, pct0 to pct7, pdl0 to pdl15, pdh0 to pdh7 v850e/sk3-h: p130 to p133, p140 to p145, pcd0 to pcd3, pcm0 to pcm5, pc s0 to pcs7, pct0 to pct7, pdl0 to pdl15, pdh0 to pdh7 4. v850e/sj3-h: p00 to p06, p30 to p39, p40 to p42, p50 to p55, p60 to p615, p80, p81, p90 to p915 v850e/sk3-h: p00 to p06, p20, p 21, p30 to p312, p40 to p45, p50 to p57, p60 to p615, p80 to p85, p90 to p915, p150 to p153
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1448 (t a = 25 c) (2/2) parameter symbol conditions ratings unit per pin 4 ma note 1 total of all pins 50 ma per pin 4 ma note 2 total of all pins 50 ma per pin 4 ma p10, p11 total of all pins 8 ma per pin 4 ma output current, low i ol p70 to p715 total of all pins 20 ma per pin ? 4 ma note 1 total of all pins ? 50 ma per pin ? 4 ma note 2 total of all pins ? 50 ma per pin ? 4 ma p10, p11 total of all pins ? 8 ma per pin ? 4 ma output current, high i oh p70 to p715 total of all pins ? 20 ma operating ambient temperature t a ? 40 to +85 c storage temperature t stg ? 40 to +125 c notes 1. v850e/sj3-h: p00 to p06, p30 to p39, p40 to p42, p50 to p55, p60 to p615, p80, p81, p90 to p915 v850e/sk3-h: p00 to p06, p20, p21, p30 to p312, p40 to p45, p50 to p57, p60 to p615, p80 to p85, p90 to p915, p150 to p153 2. v850e/sj3-h: pcd0 to pcd3, pcm0 to pcm5, pcs0 to pcs7, pct0 to pct7, pdl0 to pdl15, pdh0 to pdh7 v850e/sk3-h: p130 to p133, p140 to p145, pcd0 to pcd3, pcm0 to pcm5, pc s0 to pcs7, pct0 to pct7, pdl0 to pdl15, pdh0 to pdh7 cautions 1. do not directly connect the output (or i /o) pins of ic products to each other, or to v dd , v cc , and gnd. open-drain pins or open-collector pins, however, can be directly connected to each other. direct connection of the output pins between an ic product and an external circuit is possible, if the output pins can be set to th e high-impedance state and the ou tput timing of the external circuit is designed to avoid output conflict. 2. product quality may suffer if the absolute m aximum rating is exceeded even momentarily for any parameter. that is, the absolute maximum rati ngs are rated values at which the product is on the verge of suffering physical damage, and therefore the product must be used under conditions that ensure that the absolute maxi mum ratings are not exceeded. the ratings and conditions indicated for dc characteristics and ac characteristics represent the quality assurance range during normal operation. remark unless specified otherwise, the characte ristics of alternate-function pins are the same as those of port pins.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1449 35.2 capacitance (t a = 25 c, v dd = ev dd = bv dd = av ref0 = av ref1 = v ss = ev ss = bv ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit i/o capacitance c io f x = 1 mhz unmeasured pins returned to 0 v 10 pf 35.3 operating conditions (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v) supply voltage internal system clo ck frequency conditions v dd ev dd bv dd av ref0 , av ref1 unit c = 4.7 f, a/d converter stopped, d/a converter stopped 2.85 to 3.6 2.85 to 3.6 2.7 to 3.6 2.85 to 3.6 v f xx = 3.0 to 48 mhz c = 4.7 f, a/d converter operating, d/a converter operating 3.0 to 3.6 3.0 to 3.6 2.7 to 3.6 3.0 to 3.6 v f xt = 32.768 khz c = 4.7 f, a/d converter stopped, d/a converter stopped 2.85 to 3.6 2.85 to 3.6 2.7 to 3.6 2.85 to 3.6 v
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1450 35.4 oscillator characteristics 35.4.1 main clock osc illator characteristics (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v) resonator circuit example parameter conditions min. typ. max. unit oscillation frequency (f x ) note 1 3.0 10 mhz after reset is released 2 16 /f x s after stop mode is released 1 note 4 note 3 ms ceramic resonator/ crystal resonator x2 x1 oscillation stabilization time note 2 after idle2 mode is released 350 note 4 note 3 s notes 1. the oscillation frequency shown above indicates only oscillator characteristics. use the v850e/sj3-h and v850e/sk3-h so that the inte rnal operation conditions do not exceed the ratings shown in ac characteristics and dc characteristics . 2. time required from start of oscillation until the resonator stabilizes. 3. the value varies depending on the setting of the osts register. 4. time required to set up the flash memory. se cure the setup time using the osts register. cautions 1. when using the main clock oscillator, wire as follows in the area enclo sed by the broken lines in the above figure to avoid an adver se effect from wiring capacitance. ? keep the wiring length as short as possible. ? do not cross the wiring with the other signal lines. ? do not route the wiring near a signal line through which a high fluctuating current flows. ? always make the ground point of the oscillator capacitor the same potential as v ss . ? do not ground the capacitor to a ground pattern through which a high current flows. ? do not fetch signals from the oscillator. 2. when the main clock is stopped and the devi ce is operating on the subclock, wait until the oscillation stabilization time has been secured by the program before switching back to the main clock. 3. for the resonator selection a nd oscillator constant, customers ar e requested to either evaluate the oscillation themselves or apply to th e resonator manufacturer for evaluation.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1451 (i) kyocera kinseki corporation: crystal resonator (t a = ? 40 to +85 c) recommended circuit constant oscillation voltage range manufacturer (part number) circuit example oscillation frequency f x (khz) c1 (pf) c2 (pf) rd (k ) min. (v) max. (v) 4,000 8 8 ? 2.85 3.6 5,000 8 8 ? 2.85 3.6 8,000 8 8 ? 2.85 3.6 10,000 8 8 ? 2.85 3.6 3,145.72 8 8 ? 2.85 3.6 4,718.592 8 8 ? 2.85 3.6 kyocera kinseki corporation - cx-5fd (capacitance : 8 pf) - cx-49g (capacitance : 8 pf) - hc-49/u-s (capacitance : 8 pf) about other resonator?s type name, refer to the resonator manufacturer. x2 x1 c1 c2 rd 6,291.456 8 8 ? 2.85 3.6 caution this oscillator constant is a reference value based on evalua tion under a specific environment by the resonator manufacturer. if optimization of oscillator ch aracteristics is necessary in the actual application, apply to the resonator manufacturer for evaluati on on the implementation circuit. the oscillation voltage and oscilla tion frequency indicate only oscill ator characteristics. use the v850e/sj3-h and v850e/sk3-h so that the in ternal operating condit ions are within the specifications of the dc and ac characteristics. remark contact: kyocera electronic components & devices http ://global.kyocera.com/prdct/electro/index.html resonator vs. ic matching search http://www3 .kyocera.co.jp/electro/app/en/searchtopshow.do
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1452 (ii) toyama murata mfg. co. ltd.: ceramic resonator (t a = ? 40 to +125 c) recommended circuit constant oscillation voltage range manufacturer circuit example oscillation frequency f x (mhz) part number c1 (pf) c2 (pf) rd (k ) min. (v) max. (v) 3.000 cstcc3m00g56a-r0 on-chip (47) on-chip (47) 1 2.7 3.6 4.000 cstcr4m00g55b-r0 on-chip (39) on-chip (39) 0.33 2.7 3.6 5.000 cstcr5m00g55b-r0 on-chip (39) on-chip (39) 0 2.7 3.6 6.000 cstcr6m00g55b-r0 on-chip (39) on-chip (39) 0 2.7 3.6 8.000 cstce8m00g55a-r0 on-chip (33) on-chip (33) 0 2.7 3.6 toyama murata mfg. co. ltd. x2 x1 c2 c1 rd 10.000 cstce10m0g55a-r0 on-chip (33) on-chip (33) 0 2.7 3.6 caution this oscillator constant is a reference value based on evalua tion under a specific environment by the resonator manufacturer. if optimization of oscillator ch aracteristics is necessary in the actual application, apply to the resonator manufacturer for evaluati on on the implementation circuit. the oscillation voltage and oscilla tion frequency indicate only oscill ator characteristics. use the v850e/sj3-h and v850e/sk3-h so that the in ternal operating condit ions are within the specifications of the dc and ac characteristics. remark contact: engineering section iv piezoelectric components department i toyama murata mfg. co., ltd. tel: +81-76-429-1995 e-mail: piezo@murata.co.jp ic part number -> ceramic resonator search : http://search.murata.co.jp/ceramy/cemenu_en.do
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1453 35.4.2 subclock oscilla tor characteristics (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v) resonator circuit example parameter conditions min. typ. max. unit oscillation frequency (f xt ) note 1 32 32.768 35 khz crystal resonator xt2 xt1 oscillation stabilization time note 2 10 s notes 1. the oscillation frequency shown above indicates only osc illator characteristics. use the v850e/sj3-h and v850e/sk3-h so that the inte rnal operation conditions do not exceed the ratings shown in ac characteristics and dc characteristics . 2. time required from when v dd reaches the oscillation voltage range (2.85 v (min.)) to when the crystal oscillator stabilizes. cautions 1. when using the subclock oscillator, wire as follows in the ar ea enclosed by the broken lines in the above figures to avoid an adver se effect from wiring capacitance. ? keep the wiring length as short as possible. ? do not cross the wiring with the other signal lines. ? do not route the wiring near a signal line through which a high fluctuating current flows. ? always make the ground point of the oscillator capacitor the same potential as v ss . ? do not ground the capacitor to a ground pattern through which a high current flows. ? do not fetch signals from the oscillator. 2. the subclock oscillator is designed as a low-am plitude circuit for reducing power consumption, and is more prone to malf unction due to noise than the main clock oscillator. particular care is theref ore required with the wiring method when the subclock is used. 3. for the resonator selection a nd oscillator constant, customers ar e requested to either evaluate the oscillation themselves or apply to th e resonator manufacturer for evaluation.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1454 35.4.3 pll characteristics (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit note 1 3.0 5 mhz clock mode 1, ckc.ckdiv0 bit = 0 note 2 6.0 10 mhz note 1 3.0 4 mhz input frequency f x clock mode 1, ckc.ckdiv0 bit = 1 note 2 6.0 8 mhz note 1 12 20 mhz clock mode 1, ckc.ckdiv0 bit = 0 note 2 12 20 mhz note 1 24 32 mhz output frequency f xx clock mode 1, ckc.ckdiv0 bit = 1 note 2 24 32 mhz lock time t pll after v dd reaches 2.85 v (min.) 800 s notes 1. plli0 bit of option byte 0000007bh = 0 2. plli0 bit of option byte 0000007bh = 1 remark see chapter 6 clock generation function for details of clock mode 1. 35.4.4 sscg characteristics (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit note 1 3.66 4 mhz clock mode 2, 3, ckc.ckdiv0 bit = 1 note 2 7.32 8 mhz input frequency f x clock mode 4, ckc.ckdiv0 bit = 1 note 1 5.22 6 mhz note 1 43.92 48 mhz clock mode 2, ckc.ckdiv0 bit = 1 note 2 43.92 48 mhz note 1 29.28 32 mhz clock mode , ckc.ckdiv0 bit = 1, sfc0 register = 2ah note 2 29.28 32 mhz note 1 43.92 48 mhz clock mode 3, ckc.ckdiv0 bit = 1, sfc0 register = 34h note 2 43.92 48 mhz output frequency f xx clock mode 4, ckc.ckdiv0 bit = 1 note 1 41.76 48 mhz lock time t sscg after v dd reaches 2.85 v (min.) 1000 s notes 1. plli0 bit of option byte 0000007bh = 0 2. plli0 bit of option byte 0000007bh = 1 remark see chapter 6 clock generation function for details of clock modes 2 to 4. 35.4.5 internal oscill ator characteristics (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit output frequency f r 100 220 400 khz
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1455 35.5 regulator characteristics (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit input voltage v dd f xx = 48 mhz (max.) 2.85 3.6 v output voltage v ro 2.3 2.5 2.7 v regulator output stabilization time t reg after v dd reaches 2.85 v (min.), stabilization capacitance c = 4.7 f connected to regc pin 1 ms v dd v ro t reg reset
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1456 35.6 dc characteristics 35.6.1 i/o level (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit v ih1 reset, flmd0 0.8ev dd ev dd v v ih2 note 1 0.8ev dd 5.5 v v ih3 note 2 0.7ev dd 5.5 v v ih4 pcm0 to pcm5, pcs0 to pcs7, pct0 to pct7, pdh0 to pdh7, pdl0 to pdl15 0.7bv dd bv dd v v il5 note 3 0.8bv dd bv dd v v ih6 p70 to p715 0.7av ref0 av ref0 v input voltage, high v ih7 p10, p11 0.7av ref1 av ref1 v v il1 reset, flmd0 ev ss 0.2ev dd v v il2 note 1 ev ss 0.2ev dd v v il3 note 2 ev ss 0.3ev dd v v il4 pcm0 to pcm5, pcs0 to pcs7, pct0 to pct7, pdh0 to pdh7, pdl0 to pdl15 bv ss 0.3bv dd v v il5 note 3 bv ss 0.2bv dd v v il6 p70 to p715 av ss 0.3av ref0 v input voltage, low v il7 p10, p11 av ss 0.3av ref1 v p70 to p715 2 a input leakage current, high i lih other v i = v dd = ev dd = bv dd = av ref0 = av ref1 5 a p70 to p715 ? 2 a input leakage current, low i lil other v i = 0 v ? 5 a p70 to p715 2 a output leakage current, high i loh other v o = v dd = ev dd = bv dd = av ref0 = av ref1 5 a p70 to p715 ? 2 a output leakage current, low i lol other v o = 0 v ? 5 a notes 1. v850e/sj3-h: p02 to p06, p30 to p37, p42, p50 to p55, p60 to p66, p69 to p613, p80, p81, p92 to p915 v850e/sk3-h: p02 to p06, p30 to p37, p310 to p312, p42 to p45, p50 to p57, p60 to p66, p69 to p613, p80, p81, p84, p85, p92 to p915, p150 to p153 2. v850e/sj3-h: p00, p01, p38, p39, p40, p41, p67, p68, p614, p615, p90, p91 v850e/sk3-h: p00, p01, p20, p21, p38, p39, p40, p41, p67, p68, p614, p 615, p82, p83, p90, p91 3. v850e/sj3-h: pcd0 to pcd3 v850e/sk3-h: p130 to p133, p140 to p145, pcd0 to pcd3 remark unless specified otherwise, the characte ristics of alternate-function pins are the same as those of port pins.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1457 (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit per pin i oh = ? 1.0 ma total of all pins ? 20 ma ev dd ? 1.0 ev dd v v oh1 note 1 per pin i oh = ? 100 a total of all pins ? 6.0 ma ev dd ? 0.5 ev dd v per pin i oh = ? 1.0 ma total of all pins ? 20 ma bv dd ? 1.0 bv dd v v oh2 note 2 per pin i oh = ? 100 a total of all pins ? 5.0 ma bv dd ? 0.5 bv dd v per pin i oh = ? 0.4 ma total of all pins ? 6.4 ma av ref0 ? 1.0 av ref0 v v oh3 p70 to p715 per pin i oh = ? 100 a total of all pins ? 1.6 ma av ref0 ? 0.5 av ref0 v per pin i oh = ? 0.4 ma total of all pins ? 0.8 ma av ref1 ? 1.0 av ref1 v output voltage, high v oh4 p10, p11 per pin i oh = ? 100 a total of all pins ? 0.2 ma av ref1 ? 0.5 av ref1 v v ol1 note 3 per pin i ol = 1.0 ma 0 0.4 v v ol2 note 4 per pin i ol = 3.0 ma total of all pins 20 ma 0 0.4 v v ol3 note 5 per pin i ol = 1.0 ma total of all pins 20 ma 0 0.4 v output voltage, low v ol4 p10, p11, p70 to p715 per pin i ol = 0.4 ma total of all pins 7.2 ma 0 0.4 v software pull-down resistor r 1 p05 v i = v dd 10 20 100 k notes 1. v850e/sj3-h: p00 to p06, p30 to p39, p40 to p42, p50 to p55, p60 to p615, p80, p81, p90 to p915 v850e/sk3-h: p00 to p06, p20, p21, p30 to p312, p40 to p45, p50 to p57, p60 to p615, p80 to p85, p90 to p915, p150 to p153 2. v850e/sj3-h: pcd0 to pcd3, pcm0 to pcm5, pcs0 to pcs7, pct0 to pct7, pdl0 to pdl15, pdh0 to pdh7 v850e/sk3-h: p130 to p133, p140 to p145, pcd0 to pcd3, pcm0 to pcm5, pc s0 to pcs7, pct0 to pct7, pdl0 to pdl15, pdh0 to pdh7 3. v850e/sj3-h: p00 to p06, p30 to p37, p42, p 50 to p55, p60 to p615, p80, p81, p92 to p915 v850e/sk3-h: p02 to p06, p30 to p37, p310 to p312, p42 to p45, p50 to p57, p60 to p66, p69 to p613, p80, p81, p84, p85, p92 to p915, p150 to p153 4. v850e/sj3-h: p38, p39, p40, p41, p90, p91 v850e/sk3-h: p00, p01, p20, p21, p38, p39, p40, p41, p67, p68, p614, p 615, p82, p83, p90, p91 5. v850e/sj3-h: pcd0 to pcd3, pcm0 to pcm5, pcs0 to pcs7, pct0 to pct7, pdl0 to pdl15, pdh0 to pdh7 v850e/sk3-h: p130 to p133, p140 to p145, pcd0 to pcd3, pcm0 to pcm5, pc s0 to pcs7, pct0 to pct7, pdl0 to pdl15, pdh0 to pdh7 remarks 1. unless specified otherwise, the characteristics of alte rnate-function pins are t he same as those of port pins. 2. when the i oh and i ol conditions are not satisfied for a pin but the total value of all pins is satisfied, only that pin does not satisfy the dc characteristics.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1458 35.6.2 supply current (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit i dd1 normal operation f xx = 48 mhz (clock mode 3, sfc0 register = 34h) peripheral function operating 62 80 ma i dd2 halt mode f xx = 48 mhz (clock mode 3, sfc0 register = 34h) peripheral function operating 41 53 ma i dd3 idle1 mode f xx = 5 mhz (f x = 5 mhz), pll off 1.45 2.4 ma i dd4 idle2 mode f xx = 5 mhz (f x = 5 mhz), pll off 0.4 0.8 ma i dd5 subclock operating mode f xt = 32.768 khz, main clock, internal oscillator stopped 110 700 a i dd6 sub-idle mode f xt = 32.768 khz, main clock, internal oscillator stopped 12 150 a subclock stopped, internal oscillator stopped 9 98 a subclock operating, internal oscillator stopped 12 108 a i dd7 stop mode subclock stopped, internal oscillator operating 14 108 a supply current note i dd8 flash memory programming mode f xx = 48 mhz (f x = 6 mhz) 62 80 ma notes to t a l o f v dd , ev dd , and bv dd currents. current flowing through t he output buffers, a/d converter, d/a converter, and on-chip pull-down resistor is not included.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1459 35.7 data retention characteristics (1) in stop mode (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit data retention voltage v dddr stop mode (all functions stopped) 1.9 3.6 v data retention current i dddr stop mode (all functions stopped), v dddr = 2.0 v 9 140 a supply voltage rise time t rvd 200 s supply voltage fall time t fvd 200 s supply voltage retention time t hvd after stop mode setting 0 ms stop release signal input time t drel after v dd reaches 2.85 v (min.) 0 ms data retention input voltage, high v ihdr v dd = ev dd = bv dd = v dddr 0.9v dddr v dddr v data retention input voltage, low v ildr v dd = ev dd = bv dd = v dddr 0 0.1v dddr v caution shifting to stop mode and restoring from stop mode must be performed within the rated operating range. t drel t hvd t fvd t rvd stop release signal input stop mode setting v dddr v ihdr v ihdr v ildr v dd /ev dd /bv dd reset (input) stop mode release interrupt (nmi, etc.) (released by falling edge) stop mode release interrupt (nmi, etc.) (released by rising edge) operating voltage lower limit
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1460 35.8 ac characteristics (1) ac test input measurement points (v dd , av ref0 , av ref1 , ev dd , bv dd ) v dd 0 v v ih v il v ih v il measurement points (2) ac test output measurement points v oh v ol v oh v ol measurement points (3) load conditions dut (device under measurement) c l = 50 pf caution if the load capaci tance exceeds 50 pf due to the circ uit configuration, bring the load capacitance of the device to 50 pf or less by in serting a buffer or by some other means.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1461 35.8.1 clkout output timing (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v) parameter symbol conditions min. max. unit output cycle t cyk <1> 20.83 ns 31.25 s high-level width t wkh <2> t cyk /2 ? 6 ns low-level width t wkl <3> t cyk /2 ? 6 ns rise time t kr <4> 6 ns fall time t kf <5> 6 ns clock timing clkout (output) <1> <2> <3> <4> <5>
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1462 35.8.2 bus timing (1) in multiplexed bus mode cautions 1. when operating at f cpu > 20 mhz, be sure to insert address hold waits and address setup waits. 2. when operating at f cpu > 32 mhz, be sure to insert at least one data wait. (a) read/write cycle (clkout asynchronous) (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit address setup time (to astb ) t sast <6> (0.5 + t asw )t ? 20 ns address hold time (from astb ) t hsta <7> (0.5 + t ahw )t ? 15 ns delay time from rd to address float t frda <8> 16 ns data input setup time from address t said <9> (2 + n + t asw + t ahw )t ? 35 ns data input setup time from rd t srid <10> (1 + n)t ? 25 ns delay time from astb to rd, wrm t dstrdwr <11> (0.5 + t ahw )t ? 15 ns data input hold time (from rd ) t hrdid <12> 0 ns address output time from rd t drda <13> (1 + i)t ? 15 ns delay time from rd, wrm to astb t drdwrst <14> 0.5t ? 15 ns delay time from rd to astb t drdst <15> (1.5 + i + t asw )t ? 15 ns rd, wrm low-level width t wrdwrl <16> (1 + n)t ? 15 ns astb high-level width t wsth <17> (1 + i + t asw )t ? 15 ns data output time from wrm t dwrod <18> 15 ns data output setup time (to wrm ) t sodwr <19> (1 + n)t ? 20 ns data output hold time (from wrm ) t hwrod <20> t ? 15 ns t sawt1 <21> n 1 (1.5 + t asw + t ahw )t ? 35 ns wait setup time (to address) t sawt2 <22> (1.5 + n + t asw + t ahw )t ? 35 ns t hawt1 <23> n 1 (0.5 + n + t asw + t ahw )t ns wait hold time (from address) t hawt2 <24> (1.5 + n + t asw + t ahw )t ns t sstwt1 <25> n 1 (1 + t ahw )t ? 25 ns wait setup time (to astb ) t sstwt2 <26> (1 + n + t ahw )t ? 25 ns t hstwt1 <27> n 1 (n + t ahw )t ns wait hold time (from astb ) t hstwt2 <28> (1 + n + t ahw )t ns remarks 1. t asw : number of address setup wait clocks t ahw : number of address hold wait clocks 2. t = 1/f cpu (f cpu : cpu operating clock frequency) 3. n: number of wait clocks inserted in the bus cycle the sampling timing changes when a programmable wait is inserted. 4. m = 0, 1 5. i: number of idle states inserted after a read cycle (0 or 1) 6. the values in the above specificat ions are values for when clocks with a 1:1 duty ratio are input from x1.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1463 read cycle (clkout asynchronous ): in multiplexed bus mode clkout (output) cs1 to cs3 (output) a16 to a23 (output) ad0 to ad15 (i/o) astb (output) rd (output) wait (input) t1 t2 tw t3 data address hi-z <6> <7> <17> <9> <12> <14> <10> <11> <25> <27> <26> <28> <21> <23> <22> <24> <16> <8> <13> <15> remark wr0 and wr1 are high level.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1464 write cycle (clkout asynchronous ): in multiplexed bus mode clkout (output) ad0 to ad15 (i/o) wr0, wr1 (output) astb (output) wait (input) t1 t2 tw t3 data address <25> <27> <26> <28> <21> <23> <22> <24> <6> <17> <7> <14> <20> <19> <16> <11> <18> cs1 to cs3 (output) a16 to a23 (output) remark rd is high level.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1465 (b) read/write cycle (clkout synchronous): in multiplexed bus mode (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit delay time from clkout to address t dka <29> 0 25 ns delay time from clkout to address float t fka <30> 0 19 ns delay time from clkout to astb t dkst <31> ? 12 7 ns delay time from clkout to rd, wrm t dkrdwr <32> ? 5 14 ns data input setup time (to clkout ) t sidk <33> 15 ns data input hold time (from clkout ) t hkid <34> 5 ns data output delay time from clkout t dkod <35> 19 ns wait setup time (to clkout ) t swtk <36> 20 ns wait hold time (from clkout ) t hkwt <37> 5 ns remarks 1. m = 0, 1 2. the values in the above specifications are values for when clocks with a 1:1 duty ratio are input from x1. read cycle (clkout synchronous ): in multiplexed bus mode clkout (output) ad0 to ad15 (i/o) cs1 to cs3 (output) a16 to a23 (output) astb (output) rd (output) wait (input) t1 t2 tw t3 data address hi-z <29> <31> <32> <30> <31> <32> <36> <36> <37> <37> <33> <34> remark wr0 and wr1 are high level.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1466 write cycle (clkout synchronous ): in multiplexed bus mode clkout (output) ad0 to ad15 (i/o) astb (output) wr0, wr1 (output) wait (input) t1 t2 tw t3 data address <29> <31> <32> <32> <37> <37> <36> <36> <31> <35> cs1 to cs3 (output) a16 to a23 (output) remark rd is high level.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1467 (2) in separate bus mode cautions 1. when operating at f cpu > 20 mhz, be sure to insert address hold waits and address setup waits. 2. when operating at f cpu > 20 mhz, be sure to insert at least one data wait. (a) read cycle (clkout asynchronous): in separate bus mode (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit address setup time (to rd ) t sard <38> (0.5 + t asw )t ? 27 ns address hold time (from rd ) t hard <39> it ? 3.5 note ns rd low-level width t wrdl <40> (1.5 + n + t ahw )t ? 10 ns data setup time (to rd ) t sisd <41> 23 ns data hold time (from rd ) t hisd <42> ? 3.5 ns data setup time (to address) t said <43> (2 + n + t asw + t ahw )t ? 40 ns t srdwt1 <44> (0.5 + t ahw )t ? 27 ns wait setup time (to rd ) t srdwt2 <45> (0.5 + n + t ahw )t ? 27 ns t hrdwt1 <46> (n ? 0.5 + t ahw )t ns wait hold time (from rd ) t hrdwt2 <47> (n + 0.5 + t ahw )t ns t sawt1 <48> (1 + t asw + t ahw )t ? 45 ns wait setup time (to address) t sawt2 <49> (1 + n + t asw + t ahw )t ? 45 ns t hawt1 <50> (n + t asw + t ahw )t ns wait hold time (from address) t hawt2 <51> (1 + n + t asw + t ahw )t ns note the address may be changed during the low-level period of the rd pin. to avoid the address change, insert an address wait. remarks 1. t asw : number of address setup wait clocks t ahw : number of address hold wait clocks 2. t = 1/f cpu (f cpu : cpu operating clock frequency) 3. n: number of wait clocks inserted in the bus cycle the sampling timing changes when a programmable wait is inserted 4. i: number of idle states inserted after a read cycle (0 or 1) 5. the values in the above specifications are values for when clocks with a 1:1 duty ratio are input from x1.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1468 read cycle (clkout asynchr onous): in separate bus mode clkout (output) t1 <43> hi-z hi-z <38> <40> <47> <45> <46> <44> <48> <50> <49> <51> <42> <41> <39> tw t2 rd (output) cs1 to cs3 (output) a0 to a23 (output) ad0 to ad15 (i/o) wait (input) remark wr0 and wr1 are high level.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1469 (b) write cycle (clkout asynchronous): in separate bus mode (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit address setup time (to wrm ) t sawr <52> (1 + t asw + t ahw )t ? 27 ns address hold time (from wrm ) t hawr <53> 0.5t ? 6 ns wrm low-level width t wwrl <54> (0.5 + n)t ? 10 ns data output time from wrm t dosdw <55> ? 5 ns data setup time (to wrm ) t sosdw <56> (0.5 + n)t ? 20 ns data hold time (from wrm ) t hosdw <57> 0.5t ? 7 ns data setup time (to address) t saod <58> (1 + t asw + t ahw )t ? 25 ns t swrwt1 <59> 25 ns wait setup time (to wrm ) t swrwt2 <60> nt ? 25 ns t hwrwt1 <61> 0 ns wait hold time (from wrm ) t hwrwt2 <62> nt ns t sawt1 <63> (1 + t asw + t ahw )t ? 45 ns wait setup time (to address) t sawt2 <64> (1 + n + t asw + t ahw )t ? 45 ns t hawt1 <65> (n + t asw + t ahw )t ns wait hold time (from address) t hawt2 <66> (1 + n + t asw + t ahw )t ns remarks 1. m = 0, 1 2. t asw : number of address setup wait clocks t ahw : number of address hold wait clocks 3. t = 1/f cpu (f cpu : cpu operating clock frequency) 4. n: number of wait clocks inserted in the bus cycle the sampling timing changes when a programmable wait is inserted. 5. the values in the above specifications are values for when clocks with a 1:1 duty ratio are input from x1.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1470 write cycle (clkout asynchr onous): in separate bus mode clkout (output) t1 <58> <52> <55> <54> <62> <60> <61> <59> <63> <65> <64> <66> <57> <56> <53> tw t2 wr0, wr1 (output) cs1 to cs3 (output) a0 to a23 (output) ad0 to ad15 (i/o) wait (input) hi-z hi-z remark rd is high level.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1471 (c) read cycle (clkout synchronous): in separate bus mode (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit delay time from clkout to address, cs t dksa <67> 0 27 ns data input setup time (to clkout ) t sisdk <68> 20 ns data input hold time (from clkout ) t hkisd <69> 0 ns delay time from clkout to rd t dksr <70> ? 2 12 ns wait setup time (to clkout ) t swtk <71> 20 ns wait hold time (from clkout ) t hkwt <72> 0 ns remark the values in the above specifications are values for when clocks with a 1:1 duty ratio are input from x1. read cycle (clkout synchronous, 1 wait): in separate bus mode clkout (output) t1 <70> <71> <72> <71> <72> <67> <70> <68> <69> hi-z hi-z tw t2 rd (output) cs1 to cs3 (output) a0 to a23 (output) ad0 to ad15 (i/o) wait (input) <67> remark wr0 and wr1 are high level.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1472 (d) write cycle (clkout synchronous): in separate bus mode (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit delay time from clkout to address, cs t dksa <73> 0 27 ns delay time from clkout to data output t dksd <74> 0 18 ns delay time from clkout to wrm t dksw <75> ? 2 12 ns wait setup time (to clkout ) t swtk <76> 20 ns wait hold time (from clkout ) t hkwt <77> 0 ns remarks 1. m = 0, 1 2. the values in the above specifications are values for when clocks with a 1:1 duty ratio are input from x1. write cycle (clkout synchronous ): in separate bus mode clkout (output) t1 <74> <75> <77> <76> <75> tw t2 wr0, wr1 (output) cs1 to cs3 (output) a0 to a23 (output) ad0 to ad15 (i/o) wait (input) <73> <73> <77> <76> <74> hi-z hi-z remark rd is high level.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1473 (3) bus hold (a) clkout asynchronous (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit hldrq high-level width t whqh <78> t + 10 ns hldak low-level width t whal <79> t ? 15 ns delay time from hldak to bus output t dhac <80> ? 3 ns delay time from hldrq to hldak t dhqha1 <81> (2n + 7.5)t + 26 ns delay time from hldrq to hldak t dhqha2 <82> 0.5t 1.5t + 26 ns remarks 1. t = 1/f cpu (f cpu : cpu operating clock frequency) 2. n: number of wait clocks inserted in the bus cycle the sampling timing changes when a programmable wait is inserted. 3. the values in the above specifications are values for when clocks with a 1:1 duty ratio are input from x1. bus hold (clkout asynchronous) clkout (output) hldrq (input) hldak (output) address bus (output) data bus (i/o) th th th ti ti hi-z cs1 to cs3 (output) hi-z astb (output) rd (output), wr0, wr1 (output) hi-z hi-z <78> <82> <79> <80> <81>
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1474 (b) clkout synchronous (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit hldrq setup time (to clkout ) t shqk <83> 20 ns hldrq hold time (from clkout ) t hkhq <84> 5 ns delay time from clkout to bus float t dkf <85> 19 ns delay time from clkout to hldak t dkha <86> 19 ns remark the values in the above specifications are values for when clocks with a 1:1 duty ratio are input from x1. bus hold (clkout synchronous) clkout (output) hldrq (input) hldak (output) address bus (output) data bus (i/o) th th th t2 t3 ti ti hi-z cs1 to cs3 (output) hi-z astb (output) rd (output), wr0, wr1 (output) hi-z hi-z <83> <83> <86> <86> <84> <85>
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1475 35.9 basic operation (1) power on/power off/reset timing (t a = ? 40 to +85 c, v ss = av ss = bv ss = ev ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit ev dd v dd t rel <87> 0 ns ev dd bv dd t reb <88> 0 t rel ns ev dd av ref0 , av ref1 t rea <89> 0 t rel ns v dd reset t rer <90> 500 + t reg note ns analog noise elimination (during flash erase/ writing) 500 ns reset low-level width t wrsl <91> analog noise elimination 500 ns reset v dd t fre <92> 500 ns v dd ev dd t fel <93> 0 ns bv dd ev dd t feb <94> 0 t fel ns av ref0 , av ref1 ev dd t fea <95> 0 t fel ns note depends on the on-chip regulator characteristics. v dd ev dd bv dd v i v i v i v i av ref0 , av ref1 reset (input) <88> <87> <90> <92> <91> <89> <94> <93> <95>
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1476 (2) interrupt, flmd0 pin timing (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit nmi high-level width t wnih analog noise elimination 500 ns nmi low-level width t wnil analog noise elimination 500 ns n = 0 to 9 (analog noise elimination) 500 ns intpn note high-level width t with n = 3 (digital noise elimination) 3t smp + 20 ns n = 0 to 9 (analog noise elimination) 500 ns intpn note low-level width t witl n = 3 (digital noise elimination) 3t smp + 20 ns flmd0 high-level width t wmdh 500 ns flmd0 low-level width t wmdl 500 ns note the drst pin has the same characteristics as the intp2 pin. remark t smp : noise elimination sampling clock cycl e (specified by th e nfc register) (3) key return timing (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref 0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit krn high-level width t wkrh analog noise elimination 500 ns krn low-level width t wkrl analog noise elimination 500 ns remark n = 0 to 7 (4) timer timing (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit tin high-level width t tihn 2t + 20 ns tin low-level width t tiln n = p00, p01, p10, p11, p20, p21, p30, p31, p40, p41, p50, p51, p60, p61, p70, p71, p80, p81, q00 to q03 2t + 20 ns m = 7 and 8, sampling: 3 times 3t smp + 20 ns temcm0/temcm1 high-level width t tenchm m = 7 and 8, sampling: 2 times 2t smp + 20 ns m = 7 and 8, sampling: 3 times 3t smp + 20 ns temcm0/temcm1 low-level width t tenclm m = 7 and 8, sampling: 2 times 2t smp + 20 ns m = 7 and 8, sampling: 3 times 3t smp + 20 ns tecrm high-level width t tecrhm m = 7 and 8, sampling: 2 times 2t smp + 20 ns m = 7 and 8, sampling: 3 times 3t smp + 20 ns tecrm low-level width t tecrlm m = 7 and 8, sampling: 2 times 2t smp + 20 ns remarks 1. t = 1/f xp (f xp : peripheral clock frequency (prescaler 1 input clock frequency)) 2. tsmp: noise elimination sa mpling clock cycle (s pecified by the enanfc register)
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1477 (5) uarta timing (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit transmit rate 625 kbps asck0 cycle time 10 mhz (6) uartb timing (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit transmit rate 1.5 mbps
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1478 (7) csib timing (a) master mode (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit sckbn cycle time t kcy1 <96> 125 ns sckbn high-/low-level width t kh1 , t kl1 <97> t kcy1 /2 ? 8 ns sibn setup time (to sckbn ) t sik1 <98> 27 ns sibn hold time (from sckbn ) t ksi1 <99> 27 ns delay time from sckbn to sobn output t kso1 <100> 27 ns remark n = 0 to 5 (b) slave mode (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit sckbn cycle time t kcy2 <96> 125 ns sckbn high-/low-level width t kh2 , t kl2 <97> 54.5 ns sibn setup time (to sckbn ) t sik2 <98> 27 ns sibn hold time (from sckbn ) t ksi2 <99> 27 ns delay time from sckbn to sobn output t kso2 <100> 27 ns remark n = 0 to 5 sobn (output) input data output data sibn (input) sckbn (i/o) <96> <97> <97> <98> <99> <100> hi-z hi-z remark n = 0 to 5
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1479 (8) csie timing (other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/ sj3-h), and 70f3933 (v850e/sj3-h)) (a) master mode (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit scken cycle time t kcy1 <101> 125 ns scken high-/low-level width t kh1 , t kl1 <102> t kcy1 /2 ? 8 ns sien setup time (to scken ) t sik1 <103> 27 ns sien hold time (from scken ) t ksi1 <104> 27 ns delay time from scken to soen output t kso1 <105> 27 ns remark n = 0, 1 (b) slave mode (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit scken cycle time t kcy2 <101> 125 ns scken high-/low-level width t kh2 , t kl2 <102> 54.5 ns sien setup time (to scken ) t sik2 <103> 27 ns sien hold time (from scken ) t ksi2 <104> (1/f xp ) 1.5 + 10 ns delay time from scken to soen output t kso2 <105> 27 ns remarks 1. n = 0, 1 2. f xp : peripheral clock frequency (prescaler 1 input clock frequency) soen (output) input data output data sien (input) scken (i/o) <101> <102> <102> <103> <104> <105> hi-z hi-z remark n = 0, 1
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1480 (9) i 2 c bus mode (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) normal mode high-speed mode parameter symbol min. max. min. max. unit scl0n clock frequency f clk 0 100 0 400 khz bus free time (between start and stop conditions) t buf <106> 4.7 ? 1.3 ? s hold time note 1 t hd: sta <107> 4.0 ? 0.6 ? s scl0n clock low-level width t low <108> 4.7 ? 1.3 ? s scl0n clock high-level width t high <109> 4.0 ? 0.6 ? s setup time for start/restart conditions t su: sta <110> 4.7 ? 0.6 ? s cbus compatible master 5.0 ? ? ? s data hold time i 2 c mode t hd: dat <111> 0 note 2 ? 0 note 2 0.9 note 3 s data setup time t su: dat <112> 250 ? 100 note 4 ? ns sda0n and scl0n signal rise time t r <113> ? 1000 20 + 0.1cb note 5 300 ns sda0n and scl0n signal fall time t f <114> ? 300 20 + 0.1cb note 5 300 ns stop condition setup time t su: sto <115> 4.0 ? 0.6 ? s pulse width of spike suppressed by input filter t sp <116> ? ? 0 50 ns capacitance load of each bus line cb ? 400 ? 400 pf notes 1. at the start condition, the first clock pulse is generated after the hold time. 2. the system requires a minimum of 300 ns hold ti me internally for the sda0n signal (at v ihmin. of scl0n signal) in order to occupy the undefined area at the falling edge of scl0n. 3. if the system does not extend the scl0n signal low hold time (t low ), only the maximum data hold time (t hd : dat ) needs to be satisfied. 4. the high-speed mode i 2 c bus can be used in the normal-mode i 2 c bus system. in this case, set the high- speed mode i 2 c bus so that it meets the following conditions. ? if the system does not extend the sc l0n signal?s low state hold time: t su : dat 250 ns ? if the system extends the scl0n signal?s low state hold time: transmit the following data bit to the sda0n line prior to the scl0n line release (t rmax. + t su:dat = 1,000 + 250 = 1,250 ns: normal mode i 2 c bus specification). 5. cb: total capacitance of one bus line (unit: pf) remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h ), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3- h), and 70f3933 (v850e/sj3-h): n = 0 to 5
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1481 stop condition start condition restart condition stop condition scl0n (i/o) sda0n (i/o) <108> <114> <114> <113> <113> <111> <112> <110> <107> <106> <107> <116> <115> <109> remark only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h ), and 70f3933 (v850e/sj3-h): n = 0 to 3 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h): n = 0 to 5 (10) iebus controller (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. typ. max. unit 5.91 6.00 note 6.09 mhz iebus system clock frequency f s communication mode: modes 1, 2 6.20 6.29 note 6.38 mhz note iebus system clock frequencies 6.0 mhz and 6.29 mhz cannot be used together.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1482 (11) can timing (products with can controller only) (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref 0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. max. unit transmit rate 1 mbps internal delay time t node 100 ns can internal clock (f can ) ctxdn pin (transmit data) crxdn pin (receive data) t output t input remarks 1. can internal clock (f can ): can baud rate clock 2. n = 0, 1 internal delay time (t node ) = internal transm ission delay time (t output ) + internal reception delay time (t input ) can controller v850e/sj3-h, v850e/sk3-h internal transmission delay time (t output ) ctxdn pin crxdn pin internal reception delay time (t input ) remark n = 0, 1
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1483 (12) a/d converter (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , 3.0 v av ref0 3.6 v, v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. typ. max. unit resolution 10 bit overall error note 3.0 av ref0 3.6 v 0.6 %fsr conversion time t conv 2.6 24 s zero scale error 0.5 %fsr full scale error 0.5 %fsr non-linearity error 4.0 lsb differential linearity error 4.0 lsb analog input voltage v ian av ss av ref0 v reference voltage av ref0 3.0 3.6 v normal conversion mode 3 6.5 ma high-speed conversion mode 4 10 ma av ref0 current ai ref0 when a/d converter unused 5 a note excluding quantization error ( 0.05 %fsr). caution do not set (read/write) alternate-function por ts during a/d conversion; otherwise the conversion resolution may be degraded. remark lsb: least significant bit fsr: full scale range (13) d/a converter (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , 3.0 v av ref1 3.6 v, v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. typ. max. unit resolution 8 bit overall error note 1 r = 2 m 1.2 %fsr settling time c = 20 pf 3 s output resistor r o output data 55h 6.42 k reference voltage av ref1 3.0 3.6 v d/a conversion operating 1 2.5 ma av ref1 current note 2 ai ref1 d/a conversion stopped 5 a notes 1. excluding quantization error ( 0.5 lsb). 2. value of 1 channel of d/a converter remark r is the output pin load resistance and c is the output pin load capacitance.
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1484 (14) lvi circuit specification (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. typ. max. unit detection voltage v lvi0 2.85 2.95 3.05 v response time note t ld after v dd reaches v lvi0 (max.), or after v dd has dropped to v lvi0 (max.) 0.2 2.0 ms minimum pulse width t lw 0.2 ms reference voltage stabilization wait time t lwait after v dd reaches 2.85 v (min.) 0.1 0.2 ms note time required to detect the detection volt age and output an interrupt or reset signal. supply voltage (v dd ) time detection voltage (min.) operating voltage (min.) detection voltage (typ.) detection voltage (max.) t lwait t lw t ld t ld lvion bit = 0 1
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1485 (15) ram retention detection (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) parameter symbol conditions min. typ. max. unit detection voltage v ramh 1.9 2.0 2.1 v supply voltage rise time t ramhth v dd = 0 to 2.85 v 0.002 ms response time note t ramhd after v dd reaches 2.1 v 0.2 3.0 ms minimum pulse width t ramhw 0.2 ms note time required to detect the detection voltage and set the rams.ramf bit. supply voltage (v dd ) time detection voltage (min.) operating voltage (min.) detection voltage (typ.) detection voltage (max.) t ramhw t ramhd t ramhd t ramhth rams.ramf bit cleared by instruction
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1486 35.10 flash memory programming characteristics (t a = ? 40 to +85 c, bv dd v dd = ev dd = av ref0 = av ref1 , v ss = ev ss = bv ss = av ss = 0 v, c l = 50 pf) (1) basic characteristics parameter symbol conditions min. typ. max. unit operating frequency f cpu 3.0 48 mhz supply voltage v dd 2.85 3.6 v number of rewrites c wrt 1000 times programming temperature t prg ? 40 +85 c (2) serial write operation characteristics parameter symbol conditions min. typ. max. unit flmd0, flmd1 setup time t mdset 2 3000 ms flmd0 count start time from reset t rfcf f x = 3.0 to 10 mhz 800 s flmd0 counter high-level width/ low-level width t ch /t cl 10 100 s flmd0 counter rise time/fall time t r /t f 1 s flash write mode setup timing v dd flmd1 0 v v dd reset (input) 0 v v dd flmd0 0 v t rfcf t cl t f t r t ch t mdset
chapter 35 electrical specifications user?s manual u19201ej3v0ud 1487 (3) programming characteristics parameter symbol conditions min. typ. max. unit chip erase time f xx = 48 mhz, batch erasure 90.6 ms write time per 256 bytes f xx = 48 mhz 1.7 ms block internal verify time f xx = 48 mhz 10 ms block blank check time f xx = 48 mhz 0.5 ms flash memory information setting time f xx = 48 mhz 30 ms caution when writing initially to sh ipped products, it is c ounted as one rewrite for both ?erase to write? and ?write only?. example (p: write, e: erase) shipped product ?? p e p e p: 3 rewrites shipped product e p e p e p: 3 rewrites remark the block size is 4 kb.
user?s manual u19201ej3v0ud 1488 chapter 36 package drawings 144-pin plastic lqfp (fine pitch) (20x20) nec electronics corporation 2008 s y e s x b m l c lp hd he zd ze l1 a1 a2 a d e a3 s 0.125 (unit:mm) item dimensions d e hd he a a1 a2 a3 20.00 0.20 20.00 0.20 22.00 0.20 22.00 0.20 1.60 max. 0.10 0.05 1.40 0.05 0.25 c e x y zd ze 0.50 0.08 0.08 1.25 1.25 l lp l1 0.50 0.60 0.15 1.00 0.20 p144gj-50-gae-2 3 detail of lead end 0.20 b 36 72 1 144 37 73 108 109 + 0.07 0.03 + 0.075 0.025 + 3 4
chapter 36 package drawings user?s manual u19201ej3v0ud 1489 s y e s x b m l c lp hd he zd ze l1 a1 a2 a d e a3 s 0.125 + 0.075 ? 0.025 (unit:mm) item dimensions d e hd he a a1 a2 a3 24.00 0.20 24.00 0.20 26.00 0.20 26.00 0.20 1.60 max. 0.10 0.05 1.40 0.05 0.25 c e x y zd ze 0.50 0.08 0.08 1.25 1.25 l lp l1 0.50 0.60 0.15 1.00 0.20 p176gm-50-gar 3 + 5 ? 3 note each lead centerline is located within 0.08 mm of its true position at maximum material condition. detail of lead end 0.20 b 44 88 1 176 45 89 133 132 176-pin plastic lqfp (fine pitch) (24x24) + 0.07 ? 0.03
user?s manual u19201ej3v0ud 1490 chapter 37 recommended soldering conditions the v850e/sj3-h and v850e/sk3-h should be so ldered and mounted under the following recommended conditions. for technical information, see the following website. semiconductor device mount manual (h ttp://www.necel.com/pkg/en/mount/index.html) table 37-1. surface mounting type soldering cond itions (1/2) pd70f3474gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) pd70f3475gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) pd70f3476gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) pd70f3477gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) pd70f3478gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) pd70f3479gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) pd70f3931gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) pd70f3932gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) pd70f3933gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) pd70f3934gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) pd70f3935gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) pd70f3936gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) pd70f3937gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) pd70f3938gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) pd70f3939gja-gae-g: 144-pin plastic lqfp (fine pitch) (20 20) soldering method soldering conditions recommended condition symbol infrared reflow package peak temperature: 260c, time: 60 seconds max. (at 220c or higher), count: three times or less, exposure limit: 7 days note (after that, prebake at 125c for 20 to 72 hours) ir60-207-3 partial heating pin temperature: 350c max., time: 3 seconds max. (per pin row) ? note after opening the dry pack, store it at 25c or less and 65% rh or less for the allowable storage period. remarks 1. products with -g at the end of the part number are lead-free products. 2. for soldering methods and conditions other t han those recommended above, please contact an nec electronics sales representative.
chapter 37 recommended soldering conditions user?s manual u19201ej3v0ud 1491 table 37-1. surface mounting type soldering cond itions (2/2) pd70f3480gma-gar-g: 176-pin plastic lqfp (fine pitch) (24 24) pd70f3481gma-gar-g: 176-pin plastic lqfp (fine pitch) (24 24) pd70f3482gma-gar-g: 176-pin plastic lqfp (fine pitch) (24 24) pd70f3486gma-gar-g: 176-pin plastic lqfp (fine pitch) (24 24) pd70f3487gma-gar-g: 176-pin plastic lqfp (fine pitch) (24 24) pd70f3488gma-gar-g: 176-pin plastic lqfp (fine pitch) (24 24) pd70f3925gma-gar-g: 176-pin plastic lqfp (fine pitch) (24 24) pd70f3926gma-gar-g: 176-pin plastic lqfp (fine pitch) (24 24) pd70f3927gma-gar-g: 176-pin plastic lqfp (fine pitch) (24 24) soldering method soldering conditions recommended condition symbol infrared reflow package peak temperature: 260c, time: 60 seconds max. (at 220c or higher), count: three times or less, exposure limit: 7 days note (after that, prebake at 125c for 20 to 72 hours) ir60-207-3 partial heating pin temperature: 350c max., time: 3 seconds max. (per pin row) ? note after opening the dry pack, store it at 25c or less and 65% rh or less for the allowable storage period. remarks 1. products with -g at the end of the part number are lead-free products. 2. for soldering methods and conditions other t han those recommended above, please contact an nec electronics sales representative.
user?s manual u19201ej3v0ud 1492 appendix a development tools the following development tools are available for the devel opment of systems that employ the v850e/sj3-h and v850e/sk3-h. figure a-1 shows the developm ent tool configuration. ? support for pc98-nx series unless otherwise specified, pr oducts supported by ibm pc/at tm compatibles are compatible with pc98-nx series computers. when using pc98-nx series computer s, refer to the explanation for ibm pc/at compatibles. ? windows ? unless otherwise specified, ?windows? means the following oss. ? windows 98 ? windows 2000 ? windows me ? windows xp ? windows nt ? ver. 4.0
appendix a development tools user?s manual u19201ej3v0ud 1493 figure a-1. development tool configuration (1/4) (1) when using iecube qb-v850esx3h language processing software ? c compiler package ? device file debugging software ? integrated debugger ? system simulator host machine (pc or ews) usb interface cable in-circuit emulator (v850esx3h) note 2 conversion socket or conversion adapter target system flash memory programmer flash memory write adapter flash memory ? project manager (windows only) note 1 software package control software embedded software ? real-time os ? network library ? file system power supply unit flash memory write environment notes 1. the project manager pm+ is incl uded in the c compiler package. pm+ is only used for windows. 2. in-circuit emulator qb-v850esx3h is supplie d with integrated debugge r id850qb, qb-mini2, power supply unit, and usb interface cable. any other products are sold separately.
appendix a development tools user?s manual u19201ej3v0ud 1494 figure a-1. development tool configuration (2/4) (2) when using on-chip debug emulator ie-v850e1-cd-nw language processing software ? c compiler package ? device file debugging software ? integrated debugger ? system simulator host machine (pc or ews) interface adapter note 2 on-chip debug emulator (ie-v850e1-cd-nw) note 3 target device (n-wire interface) target connector connector conversion board target system flash memory programmer flash memory write adapter flash memory ? project manager (windows only) note 1 software package control software embedded software ? real-time os ? network library ? file system flash memory write environment notes 1. the project manager pm+ is incl uded in the c compiler package. pm+ is only used for windows. 2. the ie-v850e1-cd-nw supports only the pcmcia card interface. 3. the ie-v850e1-cd-nw is supplied with a id850qb, ie connection cable, ie connector, and connector conversion board. all ot her products are sold separately.
appendix a development tools user?s manual u19201ej3v0ud 1495 figure a-1. development tool configuration (3/4) (3) when using minicube qb-v850mini language processing software ? c compiler package ? device file debugging software ? integrated debugger ? system simulator host machine (pc or ews) usb interface cable note 2 on-chip debug emulator (qb-v850mini) note 3 ocd cable target device (n-wire interface) target connector connector conversion board target system flash memory programmer flash memory write adapter flash memory ? project manager (windows only) note 1 software package control software embedded software ? real-time os ? network library ? file system flash memory write environment notes 1. the project manager pm+ is incl uded in the c compiler package. pm+ is only used for windows. 2. the qb-v850mini supports the usb interface. 3. the qb-v850mini is supplied with a kel connecto r and kel adapter as target connectors and connector conversion board in addition to a id850q b, usb interface cable, and ocd cable. all other target connectors are sold separately.
appendix a development tools user?s manual u19201ej3v0ud 1496 figure a-1. development tool configuration (4/4) (4) when using minicube2 qb-mini2 language processing software ? c compiler package ? device file debugging software ? integrated debugger ? system simulator host machine (pc or ews) usb interface cable note 2 on-chip debug emulator (qb-mini2) note 3 target device (n-wire interface) target connector connector conversion board target system flash memory programmer flash memory write adapter flash memory ? project manager (windows only) note 1 software package control software embedded software ? real-time os ? network library ? file system flash memory write environment notes 1. the project manager pm+ is incl uded in the c compiler package. pm+ is only used for windows. 2. the qb-mini2 supports the usb interface. 3. the qb-mini2 is supplied with usb interface cable, 16-pin target cable, 10- pin target cable, and 78k0-ocd board (integrated debugger is not s upplied.). all other products are optional.
appendix a development tools user?s manual u19201ej3v0ud 1497 a.1 software package development tools (software) common to t he v850 microcontroller are combined in this package. sp850 v850 microcontroller software package part number: s sp850 remark in the part number differs depending on the host machine and os used. s sp850 host machine os supply medium ab17 windows (japanese version) bb17 pc-9800 series, ibm pc/at compatibles windows (english version) cd-rom a.2 language processing software this compiler converts programs written in c language into object codes executable with a microcontroller. this compiler is started from project manager pm+. ca850 c compiler package part number: s ca703000 df703482 device file this file contains information peculiar to the device. this device file should be used in comb ination with a tool (ca850 and id850qb). the corresponding os and host machine di ffer depending on the tool to be used. remark in the part number differs depending on the host machine and os used. s ca703000 host machine os supply medium ab17 windows (japanese version) bb17 pc-9800 series, ibm pc/at compatibles windows (english version) 3k17 sparcstation tm sunos tm (rel. 4.1.4), solaris tm (rel. 2.5.1) cd-rom a.3 control software pm+ project manager this is control software designed to enable e fficient user program development in the windows environment. all operations used in development of a user program, such as starting the editor, building, and starting the debugger, can be performed from pm+. pm+ is included in the c compiler package ca850. it can only be used in windows.
appendix a development tools user?s manual u19201ej3v0ud 1498 a.4 debugging tools (hardware) a.4.1 when using iecube qb-v850esx3h the system configuration when connec ting the qb-v850esx3h to the host machine (pc-9821 series, pc/at compatible) is shown below. even if optional prod ucts are not prepared, connection is possible. figure a-2. system configurati on (when using qb-v850esx3h) (1/2) <13> mount adapter for device mounting <14> target connector for mounting on target system <9> exchange adapter exchanges pins among different microcontroller types <10> check pin adapter (s type only) enables signal monitoring <11> space adapter each adapter can adjust height by 5.6 mm. <15> target system <7> extension probe flexible type (s and t types) <13> mount adapter for device mounting <14> target connector for mounting on target system <12> yq connector connector for connecting to emulator <9> exchange adapter exchanges pins among different microcontroller types <11> space adapter each adapter can adjust height by 3.2 mm. <6> check pin adapter (under development) enables signal monitoring (s and t types) <5> iecube <1> s-type socket configuration optional required <4> power supply <2> cd-rom <3> usb cable simple flash programmer <15> target system t-type socket configuration system configuration accessories <8> extension probe coaxial type (s and t types)
appendix a development tools user?s manual u19201ej3v0ud 1499 figure a-2. system configurati on (when using qb-v850esx3h) (2/2) <1> host machine (pc-9821 series, ibm-pc/at compatibles) <2> debugger, usb driver, manuals, etc. (id850qb disk, accessory disk note 1 ) <3> usb interface cable <4> ac adapter <5> in-circuit emulator (qb-v850esx3h) <6> check pin adapter (s and t types) (qb-144-ca-01) (optional) <7> extension probe (flexible type) (s and t types ) (qb-144-ep-02s (gj package), qb-208-ep-02s (gm package)) (optional) <8> extension probe (coaxial type) (s and t types) (qb-144-ep-01s) (optional) <9> exchange adapter note 2 (s type: qb-144gj-ea-01s (gj package), qb-176gm-ea-02s (gm package), t type: qb-144gj-ea-01t (gj package), qb-176gm-ea-02t (gm package)) <10> check pin adapter note 3 (s type only: qb-144-ca-01s (gj package), qb-176-ca-01s (gm package)) (optional) <11> space adapter note 3 (s type: qb-144-sa-01s (gj package), qb-176-sa-01s (gm package), t type: qb- 144gj-ys-01t (gj package), qb-176gm- ys-01t (gm package) (optional) <12> yq connector note 2 (t type only) (qb-144gj-yq-01t) (gj pa ckage), qb-176gm-yq-01t (gm package) <13> mount adapter (s type: qb -144gj-ma-01s (gj package), qb-176gm-ma-01s (gm package), t type: qb-144gj-hq-01t (gj package), qb-176g m-hq-01t (gm package)) (optional) <14> target connector note 2 (s type: qb-144gj-tc-01s (gj pack age), qb-176gm-tc-01s (gm package), t type: qb-144gj-nq-01t (gj packa ge), qb-176gm-nq-01t (gm package)) <15> target system notes 1. download the device file from the nec electronics website. http://www.necel.com/micro/ods/eng/ 2. supplied with the device depending on the ordering number. ? when qb-v850esx3h-zzz is ordered the exchange adapter and the ta rget connector are not supplied. ? when qb-v850esx3h-s144gj is ordered the qb-144gj-ea-01s and qb-144gj-tc-01s are supplied. ? when qb-v850esx3h-s176gm is ordered the qb-176gm-ea-02s and qb-176gm-tc-01s are supplied. ? when qb-v850esx3h-t144gj is ordered the qb-144gj-ea-01t, qb-144gj-yq- 01t, and qb-144gj-nq-01t are supplied. ? when qb-v850esx3h-t176gm is ordered the qb-176gm-ea-02t, qb-176gm-yq-01 t, and qb-176gm-nq-01t are supplied. 3. when using both <10> and <11>, the order between <10> and <11> is not cared.
appendix a development tools user?s manual u19201ej3v0ud 1500 <5> qb-v850esx3h note in-circuit emulator the in-circuit emulator serves to d ebug hardware and software when developing application systems using the v850e/sj3-h or v850e/sk3-h. it supports the integrated debugger id850qb. this emulator should be used in combination with a power supply unit and emulation probe. use t he usb interface cable to connect this emulator to the host machine. <3> usb interface cable cable to connect the host machine and the qb-v850esx3h. <4> ac adapter 100 to 240 v can be supported by replacing the ac plug. <9> qb-144gj-ea-01s qb-176gm-ea-02s qb-144gj-ea-01t qb-176gm-ea-02t exchange adapter adapter to perform pin conversion. ? qb-144gj-ea-01s: 144-pin pl astic lqfp (gj-gae type) ? qb-176gm-ea-02s: 176-pin pl astic lqfp (gm-gar type) ? qb-144gj-ea-01t: 144-pin pl astic lqfp (gj-gae type) ? qb-176gm-ea-02t: 176-pin pl astic lqfp (gm-gar type) <10> qb-144-ca-01s qb-176-ca-01s (s type only) check pin adapter adapter used in waveform monitoring using the oscilloscope, etc. ? qb-144-ca-01s: 144-pin plas tic lqfp (gj-gae type) ? qb-176-ca-01s: 176-pin plas tic lqfp (gm-gar type) <11> qb-144-sa-01s qb-176-sa-01s qb-144gj-ys-01t qb-176gm-ys-01t space adapter adapter to adjust the height. ? qb-144-sa-01s: 144-pin plas tic lqfp (gj-gae type) ? qb-176-sa-01s: 176-pin plas tic lqfp (gm-gar type) ? qb-144gj-ys-01t: 144-pin pl astic lqfp (gj-gae type) ? qb-176gm-ys-01t: 176-pin pl astic lqfp (gm-gar type) <12> qb-144gj-yq-01t qb-176gm-yq-01t (t type only) yq connector conversion adapter to connect target connector and exchange adapter ? qb-144gj-yq-01t: 144-pin pl astic lqfp (gj-gae type) ? qb-176gm-yq-01t: 176-pin pl astic lqfp (gm-gar type) <13> qb-144gj-ma-01s qb-176gm-ma-01s qb-144gj-hq-01t qb-176gm-hq-01t mount adapter adapter to mount the v850e/sj3-h or v850e/sk3-h on a socket. ? qb-144gj-ma-01s: 144-pin pl astic lqfp (gj-gae type) ? qb-176gm-ma-01s: 176-pin pl astic lqfp (gm-gar type) ? qb-144gj-hq-01t: 144-pin pl astic lqfp (gj-gae type) ? qb-176gm-hq-01t: 176-pin pl astic lqfp (gm-gar type) <14> qb-144gj-tc-01s qb-176gm-tc-01s qb-144gj-nq-01t qb-176gm-nq-01t target connector connector to solder on the target system. ? qb-144gj-tc-01s: 144-pin pl astic lqfp (gj-gae type) ? qb-176gm-tc-01s: 176-pin pl astic lqfp (gm-gar type) ? qb-144gj-nq-01t: 144-pin pl astic lqfp (gj-gae type) ? qb-176gm-nq-01t: 176-pin pl astic lqfp (gm-gar type) note the qb-v850esx3h is supplied with a power suppl y unit, usb interface cable, and flash memory programmer (minicube2). it is also supplied with integrated debugger id850qb as control software. remark the numbers in the angle brackets correspond to the numbers in figure a-2.
appendix a development tools user?s manual u19201ej3v0ud 1501 a.4.2 when using on-chip debug emulator ie-v850e1-cd-nw the system configuration when connec ting the ie-v850e1-cd-nw to the host machine (pc-9821 series, pc/at compatible) is shown below. figure a-3. system configuration (ie-v850e1-cd-nw used) <6> <5> target system <1> <3> <4> <2> v850e/sj3-h, v850e/sk3-h <1> host machine personal computer including pcmcia compliant with the pcmcia2.1/jeida standard ver. 4.2. when using a product which does not have a pcmcia slot, use a pci- pcmcia conversion board or the like. for details on the conversion board, consult an nec electronics sales representative. <2> cd-rom note 1 the integrated debugger id850qb, n-wire checker, device driver, documents and so on in the cd-rom format are included. this cd-rom is supplied with the ie- v850e1-cd-nw. <3> ie-v850e1-cd-nw on-chip debug emulator this on-chip debug emulator is used to debug hardware and software when application systems using the v850e/sj3-h or v850e/sk3-h are developed. it is supplied with the integrated debugger id850qb. <4> ie-v850e1-cd-nw connection cable this connection cable is used to conne ct the ie-v850e1-cd-nw and the target system. it is supplied with the ie-v850e1- cd-nw. the cable length is approximately 50 cm. <5> connector conversion board kel adapter it is supplied with the ie-v850e1-cd-nw. <6> ie-v850e1-cd-nw connector kel connector note 2 8830e-026-170s (it is supplied with the ie-v850e1-cd-nw.) 8830e-026-170l (sold separately) notes 1. obtain the device file from the nec electronics website. http://www.necel.com/micro/en/ods/index.html 2. product of kel corporation remark the numbers in the square brackets correspond to the numbers in figure a-3.
appendix a development tools user?s manual u19201ej3v0ud 1502 a.4.3 when using minicube qb-v850mini the system configuration when con necting the qb-v850mini to the host machine (pc-9821 series, pc/at compatible) is shown below. figure a-4. system confi guration (qb-v850mini used) <1> host machine (with on-chip usb port) <2> id850qb disk (software tool for debugging are packaged.) <3> device file note 1 <4> usb interface cable (supplied with <5>) <5> on-chip debug emulator (qb-v850mini) <6> ocd cable (supplied with <5>) <7> kel adapter (supplied with <5>) notes 2, 3 <8> kel connector (supplied with <5>) notes 2, 3 <9> 2.54 mm pitch 20-pin general-purpose connector (sold separately) note 3 notes 1. obtain the device file from the nec electronics website. http://www.necel.com/micro/en/ods/index.html 2. product of kel corporation 3. a connector other than kel connectors can also be us ed as the target connector. for details, see the qb-v850mini user?s manual. s t a t u s t a r g e t p o w e r <1> <4> <5> <6> <7> <8> <9> device file <3> <2> target system target system v850e/sj3-h, v850e/sk3-h
appendix a development tools user?s manual u19201ej3v0ud 1503 a.4.4 when using minicube2 qb-mini2 the system configuration wh en connecting minicube2 to the host machine (pc-9821 series, pc/at compatible) is shown below. figure a-5. system configuration of on-chip emulation system <6> <5> target system v850e/sj3-h, v850e/sk3-h <1> <2> software <4> <3> m in icu be 2 <1> host machine pc with usb ports <2> software the integrated debugger id850qb, device file, etc. download the device file from the nec electronics website. http://www.necel.com/micro/en/ods/index.html <3> usb interface cable usb cable to connect the host machine and minicube2. it is supplied with minicube2. the cable length is approximately 2 m. <4> minicube2 on-chip debug emulator this on-chip debug emulator serves to debug hardware and software when developing application systems using the v 850e/sj3-h or v850e/sk3-h. it supports integrated debugger id850qb. <5> 16-pin target cable cable to connect minicube2 and the target system. it is supplied with minicube2. the cable length is approximately 15 cm. <6> target connector (sold separat ely) use a 16-pin general-purpose connector with 2.54 mm pitch. remark the numbers in the angular brackets co rrespond to the numbers in figure a-5.
appendix a development tools user?s manual u19201ej3v0ud 1504 a.5 debugging tools (software) this debugger supports the in-circuit emul ators for the v850 microcontrollers. the id850qb is a windows-based software. it has improved c-compatible debugging functions and can display the results of tracing with the source program using an integrating window function that associates the source program, disassemble display, and memo ry display with the trace result. it should be used in combination with the device file (sold separately). id850qb integrated debugger part number: s id703000-qb (id850qb) remark in the part number differs depending on the os used. s id703000-qb host machine os supply medium ab17 windows (japanese version) bb17 pc-9800 series, ibm pc/at compatibles windows (english version) cd-rom
appendix a development tools user?s manual u19201ej3v0ud 1505 a.6 embedded software the rx850 and rx850 pro are real-time oss conforming to itron 3.0 specifications. a tool (configurator) for generating multiple information tables is supplied. rx850 pro has more functions than rx850. rx850, rx850 pro real-time os part number: s rx703000- ??? (rx850) s rx703100- ??? (rx850 pro) v850mini-net (provisional name) (network library) this is a network library conforming to rfc. it is a lightweight tcp/ip of compact design, requiring only a small memory. in addition to the tcp/ip standard set, an http server, smtp client , and pop client are also supported. rx-fs850 (file system) this is a fat file system function. it is a file system that supports the cd-rom file system function. this file system is used with the real-time os rx850 pro. caution to purchase the rx850 or rx850 pro, first fill in the purchase applicati on form and sign the user agreement. remark and ??? in the part number differ depending on the host machine and os used. s rx703000- ??? s rx703100- ??? ??? product outline maximum number for use in mass production 001 evaluation object do not use for mass-produced product. 100k 0.1 million units 001m 1 million units 010m mass-production object 10 million units s01 source program object source program for mass production host machine os supply medium ab17 windows (japanese version) bb17 pc-9800 series, ibm pc/at compatibles windows (english version) 3k17 sparcstation solaris (rel. 2.5.1) cd-rom
appendix a development tools user?s manual u19201ej3v0ud 1506 a.7 flash memory writing tools flashpro v (part number: pg-fp5) flash memory programmer flash memory programmer dedica ted to microcontrollers with on-chip flash memory. fa-144gj-gae-b flash memory writing adapter flash memory writing adapter us ed connected to flashpro v. ? fa-144gj-gae-b: for 144-pi n plastic lqfp (gj-gae type) fa-176gm-gar-b flash memory writing adapter flash memory writing adapter us ed connected to flashpro v. ? fa-176gm-gar-b: for 176-pin plastic lqfp (gm-gar type) remark fa-144gj-gae-b and fa-176gm-gar-b are products of naito densei machida mfg. co., ltd. tel: +81-42-750-4172 naito densei machida mfg. co., ltd.
user?s manual u19201ej3v0ud 1507 appendix b register index (1/20) symbol name unit page ada0cr0 a/d conversion result register 0 adc 686 ada0cr0h a/d conversion result register 0h adc 686 ada0cr1 a/d conversion result register 1 adc 686 ada0cr1h a/d conversion result register 1h adc 686 ada0cr2 a/d conversion result register 2 adc 686 ada0cr2h a/d conversion result register 2h adc 686 ada0cr3 a/d conversion result register 3 adc 686 ada0cr3h a/d conversion result register 3h adc 686 ada0cr4 a/d conversion result register 4 adc 686 ada0cr4h a/d conversion result register 4h adc 686 ada0cr5 a/d conversion result register 5 adc 686 ada0cr5h a/d conversion result register 5h adc 686 ada0cr6 a/d conversion result register 6 adc 686 ada0cr6h a/d conversion result register 6h adc 686 ada0cr7 a/d conversion result register 7 adc 686 ada0cr7h a/d conversion result register 7h adc 686 ada0cr8 a/d conversion result register 8 adc 686 ada0cr8h a/d conversion result register 8h adc 686 ada0cr9 a/d conversion result register 9 adc 686 ada0cr9h a/d conversion result register 9h adc 686 ada0cr10 a/d conversion result register 10 adc 686 ada0cr10h a/d conversion result register 10h adc 686 ada0cr11 a/d conversion result register 11 adc 686 ada0cr11h a/d conversion result register 11h adc 686 ada0cr12 a/d conversion result register 12 adc 686 ada0cr12h a/d conversion result register 12h adc 686 ada0cr13 a/d conversion result register 13 adc 686 ada0cr13h a/d conversion result register 13h adc 686 ada0cr14 a/d conversion result register 14 adc 686 ada0cr14h a/d conversion result register 14h adc 686 ada0cr15 a/d conversion result register 15 adc 686 ada0cr15h a/d conversion result register 15h adc 686 ada0m0 a/d converter mode register 0 adc 679 ada0m1 a/d converter mode register 1 adc 681 ada0m2 a/d converter mode register 2 adc 684 ada0pfm power-fail compare mode register adc 688 ada0pft power-fail compare threshold value register adc 689 ada0s a/d converter channel specification register adc 685 adic interrupt control register intc 1296
appendix b register index user?s manual u19201ej3v0ud 1508 (2/20) symbol name unit page asid program id register cpu 83 awc address wait control register bcu 316 bcc bus cycle control register bcu 318 bcr iebus control register iebus 1032 bpc peripheral i/o area select control register cpu 123 bsc bus size configuration register bcu 303 c0brp can0 module bit rate prescaler register can 1167 c0btr can0 module bit rate register can 1168 c0ctrl can0 module control register can 1157 c0erc can0 module error counter register can 1163 c0gmabt can0 global automatic block transmission control register can 1152 c0gmabtd can0 global automatic block transmission delay register can 1154 c0gmcs can0 global clock selection register can 1151 c0gmctrl can0 global control register can 1149 c0ie can0 module interrupt enable register can 1164 c0info can0 module information register can 1162 c0ints can0 module interrupt status register can 1166 c0lec can0 module last error information register can 1161 c0lipt can0 module last in-pointer register can 1170 c0lopt can0 module last out-pointer register can 1172 c0mask1h can0 module mask 1 register h can 1155 c0mask1l can0 module mask 1 register l can 1155 c0mask2h can0 module mask 2 register h can 1155 c0mask2l can0 module mask 2 register l can 1155 c0mask3h can0 module mask 3 register h can 1155 c0mask3l can0 module mask 3 register l can 1155 c0mask4h can0 module mask 4 register h can 1155 c0mask4l can0 module mask 4 register l can 1155 c0mconfm can0 message configuration register m can 1179 c0mctrlm can0 message control register m can 1181 c0mdata01m can0 message data byte 01 register m can 1176 c0mdata0m can0 message data byte 0 register m can 1176 c0mdata1m can0 message data byte 1 register m can 1176 c0mdata23m can0 message data byte 23 register m can 1176 c0mdata2m can0 message data byte 2 register m can 1176 c0mdata3m can0 message data byte 3 register m can 1176 c0mdata45m can0 message data byte 45 register m can 1176 c0mdata4m can0 message data byte 4 register m can 1176 c0mdata5m can0 message data byte 5 register m can 1176 c0mdata67m can0 message data byte 67 register m can 1176 c0mdata6m can0 message data byte 6 register m can 1176 c0mdata7m can0 message data byte 7 register m can 1176 c0mdlcm can0 message data length register m can 1178 remark m = 00 to 31
appendix b register index user?s manual u19201ej3v0ud 1509 (3/20) symbol name unit page c0midhm can0 message id register mh can 1180 c0midlm can0 message id register ml can 1180 c0rgpt can0 module receive hi story list register can 1171 c0tgpt can0 module transmit history list register can 1173 c0ts can0 module time stamp register can 1174 c1brp can1 module bit rate prescaler register can 1167 c1btr can1 module bit rate register can 1168 c1ctrl can1 module control register can 1157 c1erc can1 module error counter register can 1163 c1gmabt can1 global automatic block transmission control register can 1152 c1gmabtd can1 global automatic block transmission delay register can 1154 c1gmcs can1 global clock selection register can 1151 c1gmctrl can1 global control register can 1149 c1ie can1 module interrupt enable register can 1164 c1info can1 module information register can 1162 c1ints can1 module interrupt status register can 1166 c1lec can1 module last error information register can 1161 c1lipt can1 module last in-pointer register can 1170 c1lopt can1 module last out-pointer register can 1172 c1mask1h can1 module mask 1 register h can 1155 c1mask1l can1 module mask 1 register l can 1155 c1mask2h can1 module mask 2 register h can 1155 c1mask2l can1 module mask 2 register l can 1155 c1mask3h can1 module mask 3 register h can 1155 c1mask3l can1 module mask 3 register l can 1155 c1mask4h can1 module mask 4 register h can 1155 c1mask4l can1 module mask 4 register l can 1155 c1mconfm can1 message configuration register m can 1179 c1mctrlm can1 message control register m can 1181 c1mdata01m can1 message data byte 01 register m can 1176 c1mdata0m can1 message data byte 0 register m can 1176 c1mdata1m can1 message data byte 1 register m can 1176 c1mdata23m can1 message data byte 23 register m can 1176 c1mdata2m can1 message data byte 2 register m can 1176 c1mdata3m can1 message data byte 3 register m can 1176 c1mdata45m can1 message data byte 45 register m can 1176 c1mdata4m can1 message data byte 4 register m can 1176 c1mdata5m can1 message data byte 5 register m can 1176 c1mdata67m can1 message data byte 67 register m can 1176 c1mdata6m can1 message data byte 6 register m can 1176 c1mdata7m can1 message data byte 7 register m can 1176 c1mdlcm can1 message data length register m can 1178 c1midhm can1 message id register mh can 1180 c1midlm can1 message id register ml can 1180 remark m = 00 to 31
appendix b register index user?s manual u19201ej3v0ud 1510 (4/20) symbol name unit page c1rgpt can1 module receive hi story list register can 1171 c1tgpt can1 module transmit history list register can 1173 c1ts can1 module time stamp register can 1174 cb0ctl0 csib0 control register 0 csi 828 cb0ctl1 csib0 control register 1 csi 831 cb0ctl2 csib0 control register 2 csi 833 cb0ric interrupt control register intc 1296 cb0rx csib0 receive data register csi 827 cb0rxl csib0 receive data register l csi 827 cb0str csib0 status register csi 835 cb0tic interrupt control register intc 1296 cb0tx csib0 transmit data register csi 827 cb0txl csib0 transmit data register l csi 827 cb1ctl0 csib1 control register 0 csi 828 cb1ctl1 csib1 control register 1 csi 831 cb1ctl2 csib1 control register 2 csi 833 cb1ric interrupt control register intc 1296 cb1rx csib1 receive data register csi 827 cb1rxl csib1 receive data register l csi 827 cb1str csib1 status register csi 835 cb1tic interrupt control register intc 1296 cb1tx csib1 transmit data register csi 827 cb1txl csib1 transmit data register l csi 827 cb2ctl0 csib2 control register 0 csi 828 cb2ctl1 csib2 control register 1 csi 831 cb2ctl2 csib2 control register 2 csi 833 cb2ric interrupt control register intc 1296 cb2rx csib2 receive data register csi 827 cb2rxl csib2 receive data register l csi 827 cb2str csib2 status register csi 835 cb2tic interrupt control register intc 1296 cb2tx csib2 transmit data register csi 827 cb2txl csib2 transmit data register l csi 827 cb3ctl0 csib3 control register 0 csi 828 cb3ctl1 csib3 control register 1 csi 831 cb3ctl2 csib3 control register 2 csi 833 cb3ric interrupt control register intc 1296 cb3rx csib3 receive data register csi 827 cb3rxl csib3 receive data register l csi 827 cb3str csib3 status register csi 835 cb3tic interrupt control register intc 1296 cb3tx csib3 transmit data register csi 827 cb3txl csib3 transmit data register l csi 827 cb4ctl0 csib4 control register 0 csi 828
appendix b register index user?s manual u19201ej3v0ud 1511 (5/20) symbol name unit page cb4ctl1 csib4 control register 1 csi 831 cb4ctl2 csib4 control register 2 csi 833 cb4ric interrupt control register intc 1296 cb4rx csib4 receive data register csi 827 cb4rxl csib4 receive data register l csi 827 cb4str csib4 status register csi 835 cb4tic interrupt control register intc 1296 cb4tx csib4 transmit data register csi 827 cb4txl csib4 transmit data register l csi 827 cb5ctl0 csib5 control register 0 csi 828 cb5ctl1 csib5 control register 1 csi 831 cb5ctl2 csib5 control register 2 csi 833 cb5ric interrupt control register intc 1296 cb5rx csib5 receive data register csi 827 cb5rxl csib5 receive data register l csi 827 cb5str csib5 status register csi 835 cb5tic interrupt control register intc 1296 cb5tx csib5 transmit data register csi 827 cb5txl csib5 transmit data register l csi 827 ccls cpu operation clock status register cg 347 ccr iebus communication count register iebus 1059 cdr iebus control data register iebus 1050 ce0ctl0 csie0 control register 0 csie 828 ce0ctl1 csie0 control register 1 csie 831 ce0ctl2 csie0 control register 2 csie 833 ce0ctl3 csie0 control register 3 csie 834 ce0rx0 csie0 receive data buffer register csie 883 ce0rx0h csie0 receive data buffer register h csie 883 ce0rx0l csie0 receive data buffer register l csie 883 ce0str csie0 status register csie 892 ce0tic interrupt control register intc 1296 ce0tiofic interrupt control register intc 1296 ce0tx0 csie0 transmit data buffer register csie 884 ce0tx0h csie0 transmit data buffer register h csie 884 ce0tx0l csie0 transmit data buffer register l csie 884 ce1ctl0 csie1 control register 0 csie 828 ce1ctl1 csie1 control register 1 csie 831 ce1ctl2 csie1 control register 2 csie 833 ce1ctl3 csie1 control register 3 csie 834 ce1rx0 csie1 receive data buffer register csie 883 ce1rx0h csie1 receive data buffer register h csie 883 ce1rx0l csie1 receive data buffer register l csie 883 ce1str csie1 status register csie 892 ce1tic interrupt control register intc 1296
appendix b register index user?s manual u19201ej3v0ud 1512 (6/20) symbol name unit page ce1tiofic interrupt control register intc 1296 ce1tx0 csie1 transmit data buffer register csie 884 ce1tx0h csie1 transmit data buffer register h csie 884 ce1tx0l csie1 transmit data buffer register l csie 884 ckc clock control register cg 349 clm clock monitor mode register clm 1371 corad0 correction address register 0 romc 1385 corad0h correction address register 0h romc 1385 corad0l correction address register 0l romc 1385 corad1 correction address register 1 romc 1385 corad1h correction address register 1h romc 1385 corad1l correction address register 1l romc 1385 corad2 correction address register 2 romc 1385 corad2h correction address register 2h romc 1385 corad2l correction address register 2l romc 1385 corad3 correction address register 3 romc 1385 corad3h correction address register 3h romc 1385 corad3l correction address register 3l romc 1385 corad4 correction address register 4 romc 1385 corad4h correction address register 4h romc 1385 corad4l correction address register 4l romc 1385 corad5 correction address register 5 romc 1385 corad5h correction address register 5h romc 1385 corad5l correction address register 5l romc 1385 corad6 correction address register 6 romc 1385 corad6h correction address register 6h romc 1385 corad6l correction address register 6l romc 1385 corad7 correction address register 7 romc 1385 corad7h correction address register 7h romc 1385 corad7l correction address register 7l romc 1385 corcn correction control register romc 1387 crcd crc data register crc 1274 crcin crc input register crc 1274 csc0 chip area select control register 0 bcu 296 csc1 chip area select control register 1 bcu 296 ctbp callt base pointer cpu 82 ctpc callt execution status saving register cpu 81 ctpsw callt execution status saving register cpu 81 da0cs0 d/a converter conversion value setting register 0 dac 714 da0cs1 d/a converter conversion value setting register 1 dac 714 da0m d/a converter mode register dac 713 dadc0 dma addressing control register 0 dma 1255 dadc1 dma addressing control register 1 dma 1255 dadc2 dma addressing control register 2 dma 1255 dadc3 dma addressing control register 3 dma 1255
appendix b register index user?s manual u19201ej3v0ud 1513 (7/20) symbol name unit page dbc0 dma transfer count register 0 dma 1254 dbc1 dma transfer count register 1 dma 1254 dbc2 dma transfer count register 2 dma 1254 dbc3 dma transfer count register 3 dma 1254 dbpc exception/debug trap status saving register cpu 82 dbpsw exception/debug trap status saving register cpu 82 dchc0 dma channel control register 0 dma 1256 dchc1 dma channel control register 1 dma 1256 dchc2 dma channel control register 2 dma 1256 dchc3 dma channel control register 3 dma 1256 dda0h dma destination address register 0h dma 1253 dda0l dma destination address register 0l dma 1253 dda1h dma destination address register 1h dma 1253 dda1l dma destination address register 1l dma 1253 dda2h dma destination address register 2h dma 1253 dda2l dma destination address register 2l dma 1253 dda3h dma destination address register 3h dma 1253 dda3l dma destination address register 3l dma 1253 dlr iebus telegraph length register iebus 1055 dmaic0 interrupt control register intc 1296 dmaic1 interrupt control register intc 1296 dmaic2 interrupt control register intc 1296 dmaic3 interrupt control register intc 1296 dr iebus data register iebus 1056 dsa0h dma source address register 0h dma 1252 dsa0l dma source address register 0l dma 1252 dsa1h dma source address register 1h dma 1252 dsa1l dma source address register 1l dma 1252 dsa2h dma source address register 2h dma 1252 dsa2l dma source address register 2l dma 1252 dsa3h dma source address register 3h dma 1252 dsa3l dma source address register 3l dma 1252 dtfr0 dma trigger factor register 0 dma 1257 dtfr1 dma trigger factor register 1 dma 1257 dtfr2 dma trigger factor register 2 dma 1257 dtfr3 dma trigger factor register 3 dma 1257 dwc0 data wait control register 0 bcu 311 dwc1 data wait control register 1 bcu 312 ecr interrupt source register cpu 79 eipc interrupt status saving register cpu 78 eipsw interrupt status saving register cpu 78 en0nfc tmp7 noise elimination control register timer 392 en1nfc tmp8 noise elimination control register timer 392 erric interrupt control register intc 1296
appendix b register index user?s manual u19201ej3v0ud 1514 (8/20) symbol name unit page erric0 interrupt control register intc 1296 erric1 interrupt control register intc 1296 esr iebus error status register iebus 1044 eximc external bus interface mode control register bcu 301 fepc nmi status saving register cpu 79 fepsw nmi status saving register cpu 79 fsr iebus field status register iebus 1057 ieic1 interrupt control register intc 1296 ieic2 interrupt control register intc 1296 iic0 iic shift register 0 i 2 c 953 iic1 iic shift register 1 i 2 c 953 iic2 iic shift register 2 i 2 c 953 iic3 iic shift register 3 i 2 c 953 iic4 iic shift register 4 i 2 c 953 iic5 iic shift register 5 i 2 c 953 iicc0 iic control register 0 i 2 c 936 iicc1 iic control register 1 i 2 c 936 iicc2 iic control register 2 i 2 c 936 iicc3 iic control register 3 i 2 c 936 iicc4 iic control register 4 i 2 c 936 iicc5 iic control register 5 i 2 c 936 iiccl0 iic clock select register 0 i 2 c 946 iiccl1 iic clock select register 1 i 2 c 946 iiccl2 iic clock select register 2 i 2 c 946 iiccl3 iic clock select register 3 i 2 c 946 iiccl4 iic clock select register 4 i 2 c 946 iiccl5 iic clock select register 5 i 2 c 946 iicf0 iic flag register 0 i 2 c 944 iicf1 iic flag register 1 i 2 c 944 iicf2 iic flag register 2 i 2 c 944 iicf3 iic flag register 3 i 2 c 944 iicf4 iic flag register 4 i 2 c 944 iicf5 iic flag register 5 i 2 c 944 iicic0 interrupt control register intc 1296 iicic1 interrupt control register intc 1296 iicic2 interrupt control register intc 1296 iicic3 interrupt control register intc 1296 iicic4 interrupt control register intc 1296 iicic5 interrupt control register intc 1296 iics0 iic status register 0 i 2 c 941 iics1 iic status register 1 i 2 c 941 iics2 iic status register 2 i 2 c 941 iics3 iic status register 3 i 2 c 941 iics4 iic status register 4 i 2 c 941
appendix b register index user?s manual u19201ej3v0ud 1515 (9/20) symbol name unit page iics5 iic status register 5 i 2 c 941 iicx0 iic function expansion register 0 i 2 c 947 iicx1 iic function expansion register 1 i 2 c 947 iicx2 iic function expansion register 2 i 2 c 947 iicx3 iic function expansion register 3 i 2 c 947 iicx4 iic function expansion register 4 i 2 c 947 iicx5 iic function expansion register 5 i 2 c 947 imr0 interrupt mask register 0 intc 1300 imr0h interrupt mask register 0h intc 1300 imr0l interrupt mask register 0l intc 1300 imr1 interrupt mask register 1 intc 1300 imr1h interrupt mask register 1h intc 1300 imr1l interrupt mask register 1l intc 1300 imr2 interrupt mask register 2 intc 1300 imr2h interrupt mask register 2h intc 1300 imr2l interrupt mask register 2l intc 1300 imr3 interrupt mask register 3 intc 1300 imr3h interrupt mask register 3h intc 1300 imr3l interrupt mask register 3l intc 1300 imr4 interrupt mask register 4 intc 1300 imr4h interrupt mask register 4h intc 1300 imr4l interrupt mask register 4l intc 1300 imr5 interrupt mask register 5 intc 1300 imr5h interrupt mask register 5h intc 1300 imr5l interrupt mask register 5l intc 1300 imr6 interrupt mask register 6 intc 1300 imr6h interrupt mask register 6h intc 1300 imr6l interrupt mask register 6l intc 1300 imr7l interrupt mask register 7l intc 1300 intf0 external falling edge specification register 0 intc 1314 intf3 external falling edge specification register 3 intc 1315 intf4 external falling edge specification register 4 intc 1316 intf5 external falling edge specification register 5 intc 1317 intf6 external falling edge specification register 6 intc 1318 intf8 external falling edge specification register 8 intc 1319 intf9 external falling edge specification register 9 intc 1320 intf9h external falling edge specification register 9h intc 1320 intf9l external falling edge specification register 9l intc 1320 intf15 external falling edge specification register 15 intc 1321 intr0 external rising edge specification register 0 intc 1314 intr3 external rising edge specification register 3 intc 1315 intr4 external rising edge specification register 4 intc 1316 intr5 external rising edge specification register 5 intc 1317 intr6 external rising edge specification register 6 intc 1318
appendix b register index user?s manual u19201ej3v0ud 1516 (10/20) symbol name unit page intr8 external rising edge specification register 8 intc 1319 intr9 external rising edge specification register 9 intc 1320 intr9h external rising edge specification register 9h intc 1320 intr9l external rising edge specification register 9l intc 1320 intr15 external rising edge specification register 15 intc 1321 ispr in-service priority register intc 1303 isr iebus interrupt status register iebus 1041 kric interrupt control register intc 1296 krm key return mode register kr 1327 lockr lock register cg 350 lviic interrupt control register intc 1296 lvim low voltage detection register lvi 1376 lvis low voltage detection level select register lvi 1377 nfc noise elimination control register intc 1322 ocdm on-chip debug mode register dcu 1429 ocks0 iic division clock select register 0 i 2 c 952 ocks1 iic division clock select register 1 i 2 c 952 ocks2 iebus clock select register iebus 1060 ocks3 iic division clock select register 3 i 2 c 952 osts oscillation stabilization time select register wdt 1332 p0 port 0 register port 141 p1 port 1 register port 145 p2 port 2 register port 146 p3 port 3 register port 149 p3h port 3 register h port 149 p3l port 3 register l port 149 p4 port 4 register port 158 p5 port 5 register port 162 p6 port 6 register port 168 p6h port 6 register h port 168 p6l port 6 register l port 168 p7h port 7 register h port 176 p7l port 7 register l port 176 p8 port 8 register port 177 p9 port 9 register port 183 p9h port 9 register h port 183 p9l port 9 register l port 183 p13 port 13 register port 190 p14 port 14 register port 191 p15 port 15 register port 192 par iebus partner address register iebus 1049 pc program counter cpu 76 pcc processor clock control register cg 345 pcd port cd register port 194
appendix b register index user?s manual u19201ej3v0ud 1517 (11/20) symbol name unit page pcm port cm register port 196 pcs port cs register port 198 pct port ct register port 200 pdh port dh register port 202 pdl port dl register port 205 pdlh port dl register h port 205 pdll port dl register l port 205 pemu1 peripheral emulation register 1 cpu 1381 pf0 port 0 function register port 144 pf2 port 2 function register port 147 pf3 port 3 function register port 156 pf3h port 3 function register h port 156 pf3l port 3 function register l port 156 pf4 port 4 function register port 160 pf5 port 5 function register port 166 pf6 port 6 function register port 174 pf6h port 6 function register h port 174 pf6l port 6 function register l port 174 pf8 port 8 function register port 181 pf9 port 9 function register port 189 pf9h port 9 function register h port 189 pf9l port 9 function register l port 189 pf15 port 15 function register port 193 pfc0 port 0 function control register port 143 pfc3 port 3 function control register port 153 pfc3h port 3 function control register h port 153 pfc3l port 3 function control register l port 153 pfc4 port 4 function control register port 160 pfc5 port 5 function control register port 164 pfc6 port 6 function control register port 171 pfc6h port 6 function control register h port 171 pfc6l port 6 function control register l port 171 pfc8 port 8 function control register port 180 pfc9 port 9 function control register port 186 pfc9h port 9 function control register h port 186 pfc9l port 9 function control register l port 186 pfccd port cd function control register port 195 pfce0 port 0 function control expansion register port 143 pfce3 port 3 function control expansion register port 153 pfce3h port 3 function control expansion register h port 153 pfce3l port 3 function control expansion register l port 153 pfce5 port 5 function control expansion register port 164 pfce6 port 6 function control expansion register port 171 pfce6h port 6 function control expansion register h port 171
appendix b register index user?s manual u19201ej3v0ud 1518 (12/20) symbol name unit page pfce6l port 6 function control expansion register l port 171 pfce8 port 8 function control expansion register port 180 pfce9 port 9 function control expansion register port 186 pfce9h port 9 function control expansion register h port 186 pfce9l port 9 function control expansion register l port 186 pic0 interrupt control register intc 1296 pic1 interrupt control register intc 1296 pic2 interrupt control register intc 1296 pic3 interrupt control register intc 1296 pic4 interrupt control register intc 1296 pic5 interrupt control register intc 1296 pic6 interrupt control register intc 1296 pic7 interrupt control register intc 1296 pic8 interrupt control register intc 1296 pic9 interrupt control register intc 1296 pllctl pll control register cg 348 plls pll lockup time specification register cg 351 pm0 port 0 mode register port 142 pm1 port 1 mode register port 145 pm2 port 2 mode register port 146 pm3 port 3 mode register port 150 pm3h port 3 mode register h port 150 pm3l port 3 mode register l port 150 pm4 port 4 mode register port 158 pm5 port 5 mode register port 162 pm6 port 6 mode register port 168 pm6h port 6 mode register h port 168 pm6l port 6 mode register l port 168 pm7h port 7 mode register h port 176 pm7l port 7 mode register l port 176 pm8 port 8 mode register port 178 pm9 port 9 mode register port 183 pm9h port 9 mode register h port 183 pm9l port 9 mode register l port 183 pm13 port 13 mode register port 190 pm14 port 14 mode register port 191 pm15 port 15 mode register port 192 pmc0 port 0 mode control register port 142 pmc2 port 2 mode control register port 147 pmc3 port 3 mode control register port 151 pmc3h port 3 mode control register h port 151 pmc3l port 3 mode control register l port 151 pmc4 port 4 mode control register port 159 pmc5 port 5 mode control register port 163
appendix b register index user?s manual u19201ej3v0ud 1519 (13/20) symbol name unit page pmc6 port 6 mode control register port 169 pmc6h port 6 mode control register h port 169 pmc6l port 6 mode control register l port 169 pmc8 port 8 mode control register port 179 pmc9 port 9 mode control register port 184 pmc9h port 9 mode control register h port 184 pmc9l port 9 mode control register l port 184 pmc15 port 15 mode control register port 193 pmccd port cd mode control register port 195 pmccm port cm mode control register port 197 pmccs port cs mode control register port 199 pmcct port ct mode control register port 201 pmcd port cd mode register port 194 pmcdh port dh mode control register port 203 pmcdl port dl mode control register port 206 pmcdlh port dl mode control register h port 206 pmcdll port dl mode control register l port 206 pmcm port cm mode register port 196 pmcs port cs mode register port 198 pmct port ct mode register port 200 pmdh port dh mode register port 202 pmdl port dl mode register port 205 pmdlh port dl mode register h port 205 pmdll port dl mode register l port 205 prcmd command register cpu 126 prdselh product selection register h cpu 99 prdsell product selection register l cpu 99 prscm0 prescaler compare register 0 wt 625 prscm1 brg1 prescaler compare register csi 876 prscm2 brg2 prescaler compare register csi 876 prscm3 brg3 prescaler compare register csi 876 prsm0 prescaler mode register 0 wt 624 prsm1 brg1 prescaler mode register csi 875 prsm2 brg2 prescaler mode register csi 875 prsm3 brg3 prescaler mode register csi 875 psc power save control register cg 1330 psmr power save mode register cg 1331 psr iebus power save register iebus 1036 psw program status word cpu 80 r0-r31 general-purpose register cpu 76 rams internal ram data status register cg 1377 rc1alh alarm hour setting register rtc 647 rc1alm alarm minute setting register rtc 647 rc1alw alarm week setting register rtc 648
appendix b register index user?s manual u19201ej3v0ud 1520 (14/20) symbol name unit page rc1cc0 real-time counter control register 0 rtc 636 rc1cc1 real-time counter control register 1 rtc 636 rc1cc2 real-time counter control register 2 rtc 638 rc1cc3 real-time counter control register 3 rtc 639 rc1day day count register rtc 643 rc1hour hour count register rtc 641 rc1min minute count register rtc 641 rc1month month count register rtc 645 rc1sec second count register rtc 640 rc1subc subcount register rtc 640 rc1subu watch error correction register rtc 646 rc1week week count register rtc 644 rc1year year count register rtc 645 rcm internal oscillation mode register cg 347 recic0 interrupt control register intc 1296 recic1 interrupt control register intc 1296 resf reset source flag register lvi 1360 rsa iebus receive slave address register iebus 1050 rtbh0 real-time output buffer register 0h rtp 670 rtbh1 real-time output buffer register 1h rtp 670 rtbl0 real-time output buffer register 0l rtp 670 rtbl1 real-time output buffer register 1l rtp 670 rtc0ic interrupt control register intc 1296 rtc1ic interrupt control register intc 1296 rtc2ic interrupt control register intc 1296 rtpc0 real-time output port control register 0 rtp 672 rtpc1 real-time output port control register 1 rtp 672 rtpm0 real-time output port mode register 0 rtp 671 rtpm1 real-time output port mode register 1 rtp 671 sar iebus slave address register iebus 1049 scr iebus success count register iebus 1058 selcnt0 selector operation control register 0 timer 500 sfc0 sscg frequency control register 0 cg 353 sfc1 sscg frequency control register 1 cg 354 sscgctl sscg control register cg 352 ssr iebus slave status register iebus 1037 staic interrupt control register intc 1296 sva0 slave address register 0 i 2 c 953 sva1 slave address register 1 i 2 c 953 sva2 slave address register 2 i 2 c 953 sva3 slave address register 3 i 2 c 953 sva4 slave address register 4 i 2 c 953 sva5 slave address register 5 i 2 c 953 sys system status register cpu 127
appendix b register index user?s manual u19201ej3v0ud 1521 (15/20) symbol name unit page tm0cmp0 tmm0 compare register 0 timer 614 tm0ctl0 tmm0 control register 0 timer 615 tm0eqic0 interrupt control register intc 1296 tm1cmp0 tmm1 compare register 0 timer 614 tm1ctl0 tmm1 control register 0 timer 615 tm1eqic0 interrupt control register intc 1296 tm2cmp0 tmm2 compare register 0 timer 614 tm2ctl0 tmm2 control register 0 timer 615 tm2eqic0 interrupt control register intc 1296 tp0ccic0 interrupt control register intc 1296 tp0ccic1 interrupt control register intc 1296 tp0ccr0 tmp0 capture/compare register 0 timer 387 tp0ccr1 tmp0 capture/compare register 1 timer 389 tp0cnt tmp0 counter read buffer register timer 391 tp0ctl0 tmp0 control register 0 timer 373 tp0ctl1 tmp0 control register 1 timer 374 tp0ioc0 tmp0 i/o control register 0 timer 378 tp0ioc1 tmp0 i/o control register 1 timer 380 tp0ioc2 tmp0 i/o control register 2 timer 381 tp0opt0 tmp0 option register 0 timer 384 tp0ovic interrupt control register intc 1296 tp1ccic0 interrupt control register intc 1296 tp1ccic1 interrupt control register intc 1296 tp1ccr0 tmp1 capture/compare register 0 timer 387 tp1ccr1 tmp1 capture/compare register 1 timer 389 tp1cnt tmp1 counter read buffer register timer 391 tp1ctl0 tmp1 control register 0 timer 373 tp1ctl1 tmp1 control register 1 timer 374 tp1ioc0 tmp1 i/o control register 0 timer 378 tp1ioc1 tmp1 i/o control register 1 timer 380 tp1ioc2 tmp1 i/o control register 2 timer 381 tp1opt0 tmp1 option register 0 timer 384 tp1ovic interrupt control register intc 1296 tp2ccic0 interrupt control register intc 1296 tp2ccic1 interrupt control register intc 1296 tp2ccr0 tmp2 capture/compare register 0 timer 387 tp2ccr1 tmp2 capture/compare register 1 timer 389 tp2cnt tmp2 counter read buffer register timer 391 tp2ctl0 tmp2 control register 0 timer 373 tp2ctl1 tmp2 control register 1 timer 374 tp2ioc0 tmp2 i/o control register 0 timer 378 tp2ioc1 tmp2 i/o control register 1 timer 380 tp2ioc2 tmp2 i/o control register 2 timer 381 tp2opt0 tmp2 option register 0 timer 384
appendix b register index user?s manual u19201ej3v0ud 1522 (16/20) symbol name unit page tp2ovic interrupt control register intc 1296 tp3ccic0 interrupt control register intc 1296 tp3ccic1 interrupt control register intc 1296 tp3ccr0 tmp3 capture/compare register 0 timer 387 tp3ccr1 tmp3 capture/compare register 1 timer 389 tp3cnt tmp3 counter read buffer register timer 391 tp3ctl0 tmp3 control register 0 timer 373 tp3ctl1 tmp3 control register 1 timer 374 tp3ioc0 tmp3 i/o control register 0 timer 378 tp3ioc1 tmp3 i/o control register 1 timer 380 tp3ioc2 tmp3 i/o control register 2 timer 381 tp3opt0 tmp3 option register 0 timer 384 tp3ovic interrupt control register intc 1296 tp4ccic0 interrupt control register intc 1296 tp4ccic1 interrupt control register intc 1296 tp4ccr0 tmp4 capture/compare register 0 timer 387 tp4ccr1 tmp4 capture/compare register 1 timer 389 tp4cnt tmp4 counter read buffer register timer 391 tp4ctl0 tmp4 control register 0 timer 373 tp4ctl1 tmp4 control register 1 timer 374 tp4ioc0 tmp4 i/o control register 0 timer 378 tp4ioc1 tmp4 i/o control register 1 timer 380 tp4ioc2 tmp4 i/o control register 2 timer 381 tp4opt0 tmp4 option register 0 timer 384 tp4ovic interrupt control register intc 1296 tp5ccic0 interrupt control register intc 1296 tp5ccic1 interrupt control register intc 1296 tp5ccr0 tmp5 capture/compare register 0 timer 387 tp5ccr1 tmp5 capture/compare register 1 timer 389 tp5cnt tmp5 counter read buffer register timer 391 tp5ctl0 tmp5 control register 0 timer 373 tp5ctl1 tmp5 control register 1 timer 374 tp5ioc0 tmp5 i/o control register 0 timer 378 tp5ioc1 tmp5 i/o control register 1 timer 380 tp5ioc2 tmp5 i/o control register 2 timer 381 tp5opt0 tmp5 option register 0 timer 384 tp5ovic interrupt control register intc 1296 tp6ccic0 interrupt control register intc 1296 tp6ccic1 interrupt control register intc 1296 tp6ccr0 tmp6 capture/compare register 0 timer 387 tp6ccr1 tmp6 capture/compare register 1 timer 389 tp6cnt tmp6 counter read buffer register timer 391 tp6ctl0 tmp6 control register 0 timer 373 tp6ctl1 tmp6 control register 1 timer 374
appendix b register index user?s manual u19201ej3v0ud 1523 (17/20) symbol name unit page tp6ioc0 tmp6 i/o control register 0 timer 378 tp6ioc1 tmp6 i/o control register 1 timer 380 tp6ioc2 tmp6 i/o control register 2 timer 381 tp6opt0 tmp6 option register 0 timer 384 tp6ovic interrupt control register intc 1296 tp7ccic0 interrupt control register intc 1296 tp7ccic1 interrupt control register intc 1296 tp7ccr0 tmp7 capture/compare register 0 timer 387 tp7ccr1 tmp7 capture/compare register 1 timer 389 tp7cnt tmp7 counter read buffer register timer 391 tp7ctl0 tmp7 control register 0 timer 373 tp7ctl1 tmp7 control register 1 timer 374 tp7ctl2 tmp7 control register 2 timer 376 tp7iecic interrupt control register intc 1296 tp7ioc0 tmp7 i/o control register 0 timer 378 tp7ioc1 tmp7 i/o control register 1 timer 380 tp7ioc2 tmp7 i/o control register 2 timer 381 tp7ioc3 tmp7 i/o control register 3 timer 382 tp7opt0 tmp7 option register 0 timer 384 tp7opt1 tmp7 option register 1 timer 385 tp7ovic interrupt control register intc 1296 tp7tcw tmp7 counter write register timer 391 tp8ccic0 interrupt control register intc 1296 tp8ccic1 interrupt control register intc 1296 tp8ccr0 tmp8 capture/compare register 0 timer 387 tp8ccr1 tmp8 capture/compare register 1 timer 389 tp8cnt tmp8 counter read buffer register timer 391 tp8ctl0 tmp8 control register 0 timer 373 tp8ctl1 tmp8 control register 1 timer 374 tp8ctl2 tmp8 control register 2 timer 376 tp8iecic interrupt control register intc 1296 tp8ioc0 tmp8 i/o control register 0 timer 378 tp8ioc1 tmp8 i/o control register 1 timer 380 tp8ioc2 tmp8 i/o control register 2 timer 381 tp8ioc3 tmp8 i/o control register 3 timer 382 tp8opt0 tmp8 option register 0 timer 384 tp8opt1 tmp8 option register 1 timer 385 tp8ovic interrupt control register intc 1296 tp8tcw tmp8 counter write register timer 391 tq0ccic0 interrupt control register intc 1296 tq0ccic1 interrupt control register intc 1296 tq0ccic2 interrupt control register intc 1296 tq0ccic3 interrupt control register intc 1296 tq0ccr0 tmq0 capture/compare register 0 timer 513
appendix b register index user?s manual u19201ej3v0ud 1524 (18/20) symbol name unit page tq0ccr1 tmq0 capture/compare register 1 timer 515 tq0ccr2 tmq0 capture/compare register 2 timer 517 tq0ccr3 tmq0 capture/compare register 3 timer 519 tq0cnt tmq0 counter read buffer register timer 521 tq0ctl0 tmq0 control register 0 timer 507 tq0ctl1 tmq0 control register 1 timer 508 tq0ioc0 tmq0 i/o control register 0 timer 509 tq0ioc1 tmq0 i/o control register 1 timer 510 tq0ioc2 tmq0 i/o control register 2 timer 511 tq0opt0 tmq0 option register 0 timer 512 tq0ovic interrupt control register intc 1296 trxic0 interrupt control register intc 1296 trxic1 interrupt control register intc 1296 ua0ctl0 uarta0 control register 0 uart 725 ua0ctl1 uarta0 control register 1 uart 749 ua0ctl2 uarta0 control register 2 uart 750 ua0opt0 uarta0 option control register 0 uart 727 ua0ric interrupt control register intc 1296 ua0rx uarta0 receive data register uart 731 ua0str uarta0 status register uart 729 ua0tic interrupt control register intc 1296 ua0tx uarta0 transmit data register uart 731 ua1ctl0 uarta1 control register 0 uart 725 ua1ctl1 uarta1 control register 1 uart 749 ua1ctl2 uarta1 control register 2 uart 750 ua1opt0 uarta1 option control register 0 uart 727 ua1ric interrupt control register intc 1296 ua1rx uarta1 receive data register uart 731 ua1str uarta1 status register uart 729 ua1tic interrupt control register intc 1296 ua1tx uarta1 transmit data register uart 731 ua2ctl0 uarta2 control register 0 uart 725 ua2ctl1 uarta2 control register 1 uart 749 ua2ctl2 uarta2 control register 2 uart 750 ua2opt0 uarta2 option control register 0 uart 727 ua2ric interrupt control register intc 1296 ua2rx uarta2 receive data register uart 731 ua2str uarta2 status register uart 729 ua2tic interrupt control register intc 1296 ua2tx uarta2 transmit data register uart 731 ua3ctl0 uarta3 control register 0 uart 725 ua3ctl1 uarta3 control register 1 uart 749 ua3ctl2 uarta3 control register 2 uart 750 ua3opt0 uarta3 option control register 0 uart 727
appendix b register index user?s manual u19201ej3v0ud 1525 (19/20) symbol name unit page ua3ric interrupt control register intc 1296 ua3rx uarta3 receive data register uart 731 ua3str uarta3 status register uart 729 ua3tic interrupt control register intc 1296 ua3tx uarta3 transmit data register uart 731 ua4ctl0 uarta4 control register 0 uarta 725 ua4ctl1 uarta4 control register 1 uarta 749 ua4ctl2 uarta4 control register 2 uarta 750 ua4opt0 uarta4 option control register 0 uarta 727 ua4ric interrupt control register intc 1296 ua4rx uarta4 receive data register uarta 731 ua4str uarta4 status register uarta 729 ua4tic interrupt control register intc 1296 ua4tx uarta4 transmit data register uarta 731 ua5ctl0 uarta5 control register 0 uarta 725 ua5ctl1 uarta5 control register 1 uarta 749 ua5ctl2 uarta5 control register 2 uarta 750 ua5opt0 uarta5 option control register 0 uarta 727 ua5ric interrupt control register intc 1296 ua5rx uarta5 receive data register uarta 731 ua5str uarta5 status register uarta 729 ua5tic interrupt control register intc 1296 ua5tx uarta5 transmit data register uarta 731 uar iebus unit address register iebus 1049 ub0ctl0 uartb0 control register 0 uartb 764 ub0ctl2 uartb0 control register 2 uartb 770 ub0fic0 uartb0 fifo control register 0 uartb 774 ub0fic1 uartb0 fifo control register 1 uartb 778 ub0fic2 uartb0 fifo control register 2 uartb 779 ub0fic2h uartb0 fifo control register 2h uartb 779 ub0fic2l uartb0 fifo control register 2l uartb 779 ub0fis0 uartb0 fifo status register 0 uartb 781 ub0fis1 uartb0 fifo status register 1 uartb 782 ub0rx uartb0 receive data register uartb 772 ub0rxap uartb0 receive data register ap uartb 772 ub0str uartb0 status register uartb 767 ub0tific interrupt control register intc 1296 ub0tireic interrupt control register intc 1296 ub0tiric interrupt control register intc 1296 ub0titic interrupt control register intc 1296 ub0titoic interrupt control register intc 1296 ub0tx uartb0 transmit data register uartb 771 ub1ctl0 uartb1 control register 0 uartb 764 ub1ctl2 uartb1 control register 2 uartb 770
appendix b register index user?s manual u19201ej3v0ud 1526 (20/20) symbol name unit page ub1fic0 uartb1 fifo control register 0 uartb 774 ub1fic1 uartb1 fifo control register 1 uartb 778 ub1fic2 uartb1 fifo control register 2 uartb 779 ub1fic2h uartb1 fifo control register 2h uartb 779 ub1fic2l uartb1 fifo control register 2l uartb 779 ub1fis0 uartb1 fifo status register 0 uartb 781 ub1fis1 uartb1 fifo status register 1 uartb 782 ub1rx uartb1 receive data register uartb 772 ub1rxap uartb1 receive data register ap uartb 772 ub1str uartb1 status register uartb 767 ub1tific interrupt control register intc 1296 ub1tireic interrupt control register intc 1296 ub1tiric interrupt control register intc 1296 ub1titic interrupt control register intc 1296 ub1titoic interrupt control register intc 1296 ub1tx uartb1 transmit data register uartb 771 usr iebus unit status register iebus 1038 vswc system wait control register cpu 128 wdte watchdog timer enable register wdt 666 wdtm2 watchdog timer mode register 2 wdt 663 wtic interrupt control register intc 1296 wtiic interrupt control register intc 1296 wtm watch timer operation mode register wt 628 wupic0 interrupt control register intc 1296 wupic1 interrupt control register intc 1296
user?s manual u19201ej3v0ud 1527 appendix c instruction set list c.1 conventions (1) register symbols u sed to describe operands register symbol explanation reg1 general-purpose registers: used as source registers. reg2 general-purpose registers: used mainly as destination registers. also used as source register in some instructions. reg3 general-purpose registers: used mainly to store the remainders of division results and the higher order 32 bits of multiplication results. bit#3 3-bit data for specifying the bit number immx x bit immediate data dispx x bit displacement data regid system register number vector 5-bit data that specifies the trap vector (00h to 1fh) cccc 4-bit data that shows the conditions code sp stack pointer (sp) ep element pointer (r30) listx x item register list (2) register symbols used to describe opcodes register symbol explanation r 1-bit data of a code that specifies reg1 or regid r 1-bit data of the code that specifies reg2 w 1-bit data of the code that specifies reg3 d 1-bit displacement data i 1-bit immediate data (indicates th e higher bits of immediate data) i 1-bit immediate data cccc 4-bit data that shows the condition codes cccc 4-bit data that shows the condition codes of bcond instruction bbb 3-bit data for specifying the bit number l 1-bit data that specifies a program register in the register list s 1-bit data that specifies a system register in the register list
appendix c instruction set list user?s manual u19201ej3v0ud 1528 (3) register symbols used in operations register symbol explanation input for gr [ ] general-purpose register sr [ ] system register zero-extend (n) expand n with zeros until word length. sign-extend (n) expand n with signs until word length. load-memory (a, b) read size b data from address a. store-memory (a, b, c) write data b into address a in size c. load-memory-bit (a, b) read bit b of address a. store-memory-bit (a, b, c) write c to bit b of address a. saturated (n) execute saturated processing of n (n is a 2?s complement). if, as a result of calculations, n 7fffffffh, let it be 7fffffffh. n 80000000h, let it be 80000000h. result reflects the results in a flag. byte byte (8 bits) halfword half word (16 bits) word word (32 bits) + addition ? subtraction ll bit concatenation multiplication division % remainder from division results and logical product or logical sum xor exclusive or not logical negation logically shift left by logical shift left logically shift right by logical shift right arithmetically shift right by arithmetic shift right (4) register symbols u sed in execution clock register symbol explanation i if executing another instruction immediately a fter executing the first instruction (issue). r if repeating execution of the same instruction immedi ately after executing the first instruction (repeat). l if using the results of instruction execution in the instruction immediately afte r the execution (latency).
appendix c instruction set list user?s manual u19201ej3v0ud 1529 (5) register symbols used in flag operations identifier explanation (blank) no change 0 clear to 0 x set or cleared in accordance with the results. r previously saved values are restored. (6) condition codes condition name (cond) condition code (cccc) condition formula explanation v 0 0 0 0 ov = 1 overflow nv 1 0 0 0 ov = 0 no overflow c/l 0 0 0 1 cy = 1 carry lower (less than) nc/nl 1 0 0 1 cy = 0 no carry not lower (greater than or equal) z/e 0 0 1 0 z = 1 zero equal nz/ne 1 0 1 0 z = 0 not zero not equal nh 0 0 1 1 (cy or z) = 1 not higher (less than or equal) h 1 0 1 1 (cy or z) = 0 higher (greater than) n 0 1 0 0 s = 1 negative p 1 1 0 0 s = 0 positive t 0 1 0 1 ? always (unconditional) sa 1 1 0 1 sat = 1 saturated lt 0 1 1 0 (s xor ov) = 1 less than signed ge 1 1 1 0 (s xor ov) = 0 greater than or equal signed le 0 1 1 1 ((s xor ov) or z) = 1 less than or equal signed gt 1 1 1 1 ((s xor ov) or z) = 0 greater than signed
appendix c instruction set list user?s manual u19201ej3v0ud 1530 c.2 instruction set (in alphabetical order) (1/6) execution clock flags mnemonic operand opcode operation i r l cy ov s z sat reg1,reg2 r r rr r0 01 11 0 rrrrr gr[reg2] gr[reg2]+gr[reg1] 1 1 1 add imm5,reg2 rrrrr010010iiiii gr[reg2] gr[reg2]+sign-extend(imm5) 1 1 1 addi imm16,reg1,reg2 r r rr r1 10 00 0 rrrrr iiiiiiiiiiiiiiii gr[reg2] gr[reg1]+sign-extend(imm16) 1 1 1 and reg1,reg2 r r rr r0 01 01 0 rrrrr gr[reg2] gr[reg2]and gr[reg1] 1 1 1 0 andi imm16,reg1,reg2 r r rr r1 10 11 0 rrrrr iiiiiiiiiiiiiiii gr[reg2] gr[reg1]and zero-extend(imm16) 1 1 1 0 0 when conditions are satisfied 3 note 2 3 note 2 3 note 2 bcond disp9 ddddd1011dddcccc note 1 if conditions are satisfied then pc pc+sign-extend(disp9) when conditions are not satisfied 1 1 1 bsh reg2,reg3 r r r r r 1 1 1 1 1 1 0 0 0 0 0 wwwww01101000010 gr[reg3] gr[reg2] (23:16) ll gr[reg2] (31:24) ll gr[reg2] (7:0) ll gr[reg2] (15:8) 1 1 1 0 bsw reg2,reg3 r r r r r 1 1 1 1 1 1 0 0 0 0 0 wwwww01101000000 gr[reg3] gr[reg2] (7:0) ll gr[reg2] (15:8) ll gr [reg2] (23:16) ll gr[reg2] (31:24) 1 1 1 0 callt imm6 0000001000iiiiii ctpc pc+2(return pc) ctpsw psw adr ctbp+zero-extend(imm6 logically shift left by 1) pc ctbp+zero-extend(load-memory(adr,halfword)) 5 5 5 bit#3, disp16[reg1] 10bbb111110rrrrr dddddddddddddddd adr gr[reg1]+sign-extend(disp16) z flag not(load-memory-bit(adr,bit#3)) store-memory-bit(adr,bit#3,0) 3 note 3 3 note 3 3 note 3 clr1 reg2,[reg1] r r rr r1 11 11 1 rrrrr 0000000011100100 adr gr[reg1] z flag not(load-memory-bit(adr,reg2)) store-memory-bit(adr,reg2,0) 3 note 3 3 note 3 3 note 3 cccc,imm5,reg2,reg3 rrrrr111111iiiii wwwww011000cccc0 if conditions are satisfied then gr[reg3] sign-extended(imm5) else gr[reg3] gr[reg2] 1 1 1 cmov cccc,reg1,reg2,reg3 r r r r r 1 1 1 1 1 1 r r r r wwwww011001cccc0 if conditions are satisfied then gr[reg3] gr[reg1] else gr[reg3] gr[reg2] 1 1 1 reg1,reg2 r r rr r0 01 11 1 rrrrr result gr[reg2]?gr[reg1] 1 1 1 cmp imm5,reg2 rrrrr010011iiiii result gr[reg2]?sign-extend(imm5) 1 1 1 ctret 0000011111100000 0000000101000100 pc ctpc psw ctpsw 4 4 4 r r r r r dbret 0000011111100000 0000000101000110 pc dbpc psw dbpsw 4 4 4 r r r r r
appendix c instruction set list user?s manual u19201ej3v0ud 1531 (2/6) execution clock flags mnemonic operand opcode operation i r l cy ov s z sat dbtrap 1111100001000000 dbpc pc+2(return pc) dbpsw psw psw.np 1 psw.ep 1 psw.id 1 pc 00000060h 4 4 4 di 0000011111100000 0000000101100000 psw.id 1 1 1 1 imm5,list12 0000011001iiiiil lllllllllll00000 sp sp+zero-extend(imm5 logically shift left by 2) gr[reg in list12] load-memory(sp,word) sp sp+4 repeat 2 steps above until all regs in list12 is loaded n+1 note 4 n+1 note 4 n+1 note 4 dispose imm5,list12,[reg1] 0 0 0 0 0 1 1 0 0 1 i i i i i l lllllllllllrrrrr note 5 sp sp+zero-extend(imm5 logically shift left by 2) gr[reg in list12] load-memory(sp,word) sp sp+4 repeat 2 steps above until all regs in list12 is loaded pc gr[reg1] n+3 note 4 n+3 note 4 n+3 note 4 div reg1,reg2,reg3 r r rr r1 11 11 1 rrrrr wwwww01011000000 gr[reg2] gr[reg2]gr[reg1] gr[reg3] gr[reg2]%gr[reg1] 35 35 35 reg1,reg2 r r rr r0 00 01 0 rrrrr gr[reg2] gr[reg2]gr[reg1] note 6 35 35 35 divh reg1,reg2,reg3 r r rr r1 11 11 1 rrrrr wwwww01010000000 gr[reg2] gr[reg2]gr[reg1] note 6 gr[reg3] gr[reg2]%gr[reg1] 35 35 35 divhu reg1,reg2,reg3 r r rr r1 11 11 1 rrrrr wwwww01010000010 gr[reg2] gr[reg2]gr[reg1] note 6 gr[reg3] gr[reg2]%gr[reg1] 34 34 34 divu reg1,reg2,reg3 r r rr r1 11 11 1 rrrrr wwwww01011000010 gr[reg2] gr[reg2]gr[reg1] gr[reg3] gr[reg2]%gr[reg1] 34 34 34 ei 1000011111100000 0000000101100000 psw.id 0 1 1 1 halt 0000011111100000 0000000100100000 stop 1 1 1 hsw reg2,reg3 r r r r r 1 1 1 1 1 1 0 0 0 0 0 wwwww01101000100 gr[reg3] gr[reg2](15:0) ll gr[reg2] (31:16) 1 1 1 0 jarl disp22,reg2 r r r r r 1 1 1 1 0 d d d d d d ddddddddddddddd0 note 7 gr[reg2] pc+4 pc pc+sign-extend(disp22) 3 3 3 jmp [reg1] 00000000011rrrrr pc gr[reg1] 4 4 4 jr disp22 0000011110dddddd ddddddddddddddd0 note 7 pc pc+sign-extend(disp22) 3 3 3 ld.b disp16[reg1],reg2 r r rr r1 11 00 0 rrrrr dddddddddddddddd adr gr[reg1]+sign-extend(disp16) gr[reg2] sign-extend(load-memory(adr,byte)) 1 1 note 11 ld.bu disp16[reg1],reg2 r r rr r1 11 10 b rrrrr dddddddddddddd1 notes 8, 10 adr gr[reg1]+sign-extend(disp16) gr[reg2] zero-extend(load-memory(adr,byte)) 1 1 note 11
appendix c instruction set list user?s manual u19201ej3v0ud 1532 (3/6) execution clock flags mnemonic operand opcode operation i r l cy ov s z sat ld.h disp16[reg1],reg2 rrrrr111001rrrrr ddddddddddddddd0 note 8 adr gr[reg1]+sign-extend(disp16) gr[reg2] sign-extend(load-memory(adr,halfword)) 1 1 note 11 other than regid = psw 1 1 1 ldsr reg2,regid rrrrr111111rrrrr 0000000000100000 note 12 sr[regid] gr[reg2] regid = psw 1 1 1 ld.hu disp16[reg1],reg2 r r rr r1 11 11 1 rrrrr ddddddddddddddd1 note 8 adr gr[reg1]+sign-extend(disp16) gr[reg2] zero-extend(load-memory(adr,halfword) 1 1 note 11 ld.w disp16[reg1],reg2 r r rr r1 11 00 1 rrrrr ddddddddddddddd1 note 8 adr gr[reg1]+sign-extend(disp16) gr[reg2] load-memory(adr,word) 1 1 note 11 reg1,reg2 r r rr r0 00 00 0 rrrrr gr[reg2] gr[reg1] 1 1 1 imm5,reg2 rrrrr010000iiiii gr[reg2] sign-extend(imm5) 1 1 1 mov imm32,reg1 00000110001rrrrr iiiiiiiiiiiiiiii iiiiiiiiiiiiiiii gr[reg1] imm32 2 2 2 movea imm16,reg1,reg2 r r rr r1 10 00 1 rrrrr iiiiiiiiiiiiiiii gr[reg2] gr[reg1]+sign-extend(imm16) 1 1 1 movhi imm16,reg1,reg2 r r rr r1 10 01 0 rrrrr iiiiiiiiiiiiiiii gr[reg2] gr[reg1]+(imm16 ll 0 16 ) 1 1 1 reg1,reg2,reg3 r r rr r1 11 11 1 rrrrr wwwww01000100000 gr[reg3] ll gr[reg2] gr[reg2]xgr[reg1] 1 2 note 14 2 mul note 22 imm9,reg2,reg3 rrrrr111111iiiii wwwww01001iiii00 note 13 gr[reg3] ll gr[reg2] gr[reg2]xsign-extend(imm9) 1 2 note 14 2 reg1,reg2 r r rr r0 00 11 1 rrrrr gr[reg2] gr[reg2] note 6 xgr[reg1] note 6 1 1 2 mulh imm5,reg2 rrrrr010111iiiii gr[reg2] gr[reg2] note 6 xsign-extend(imm5) 1 1 2 mulhi imm16,reg1,reg2 r r rr r1 10 11 1 rrrrr iiiiiiiiiiiiiiii gr[reg2] gr[reg1] note 6 ximm16 1 1 2 reg1,reg2,reg3 r r rr r1 11 11 1 rrrrr wwwww01000100010 gr[reg3] ll gr[reg2] gr[reg2]xgr[reg1] 1 2 note 1 4 2 mulu note 22 imm9,reg2,reg3 rrrrr111111iiiii wwwww01001iiii10 note 13 gr[reg3] ll gr[reg2] gr[reg2]xzero-extend(imm9) 1 2 note 1 4 2 nop 0000000000000000 pass at least one clock cycle doing nothing. 1 1 1 not reg1,reg2 r r rr r0 00 00 1 rrrrr gr[reg2] not(gr[reg1]) 1 1 1 0 bit#3,disp16[reg1] 01bbb111110rrrrr dddddddddddddddd adr gr[reg1]+sign-extend(disp16) z flag not(load-memory-bit(adr,bit#3)) store-memory-bit(adr,bit#3,z flag) 3 note 3 3 note 3 3 note 3 not1 reg2,[reg1] r r rr r1 11 11 1 rrrrr 0000000011100010 adr gr[reg1] z flag not(load-memory-bit(adr,reg2)) store-memory-bit(adr,reg2,z flag) 3 note 3 3 note 3 3 note 3
appendix c instruction set list user?s manual u19201ej3v0ud 1533 (4/6) execution clock flags mnemonic operand opcode operation i r l cy ov s z sat or reg1,reg2 r r rr r0 01 00 0 rrrrr gr[reg2] gr[reg2]or gr[reg1] 1 1 1 0 ori imm16,reg1,reg2 r r rr r1 10 10 0 rrrrr iiiiiiiiiiiiiiii gr[reg2] gr[reg1]or zero-extend(imm16) 1 1 1 0 list12,imm5 0000011110iiiiil lllllllllll00001 store-memory(sp?4,gr[reg in list12],word) sp sp?4 repeat 1 step above until all regs in list12 is stored sp sp-zero-extend(imm5) n+1 note 4 n+1 note 4 n+1 note 4 prepare list12,imm5, sp/imm note 15 0000011110iiiiil lllllllllllff011 imm16/imm32 note 16 store-memory(sp?4,gr[reg in list12],word) gr[reg in list 12] load-memory(sp,word) sp sp+4 repeat 2 step above until a ll regs in list12 is loaded pc gr[reg1] n+2 note 4 note 17 n+2 note 4 note 17 n+2 note 4 note 17 reti 0000011111100000 0000000101000000 if psw.ep=1 then pc eipc psw eipsw else if psw.np=1 then pc fepc psw fepsw else pc eipc psw eipsw 4 4 4 r r r r r reg1,reg2 r r rr r1 11 11 1 rrrrr 0000000010100000 gr[reg2] gr[reg2]arithmetically shift right by gr[reg1] 1 1 1 0 sar imm5,reg2 rrrrr010101iiiii gr[reg2] gr[reg2]arithmetically shift right by zero-extend(imm5) 1 1 1 0 sasf cccc,reg2 rrrrr1111110cccc 0000001000000000 if conditions are satisfied then gr[reg2] (gr[reg2]logically shift left by 1) or 00000001h else gr[reg2] (gr[reg2]logically shift left by 1) or 00000000h 1 1 1 reg1,reg2 r r rr r0 00 11 0 rrrrr gr[reg2] saturated(gr[reg2]+gr[reg1]) 1 1 1 satadd imm5,reg2 rrrrr010001iiiii gr[reg2] saturated(gr[reg2]+sign-extend(imm5) 1 1 1 satsub reg1,reg2 r r rr r0 00 10 1 rrrrr gr[reg2] saturated(gr[reg2]?gr[reg1]) 1 1 1 satsubi imm16,reg1,reg2 r r rr r1 10 01 1 rrrrr iiiiiiiiiiiiiiii gr[reg2] saturated(gr[reg1]?sign-extend(imm16) 1 1 1 satsubr reg1,reg2 r r rr r0 00 10 0 rrrrr gr[reg2] saturated(gr[reg1]?gr[reg2]) 1 1 1 setf cccc,reg2 rrrrr1111110cccc 0000000000000000 if conditions are satisfied then gr[reg2] 00000001h else gr[reg2] 00000000h 1 1 1
appendix c instruction set list user?s manual u19201ej3v0ud 1534 (5/6) execution clock flags mnemonic operand opcode operation i r l cy ov s z sat bit#3,disp16[reg1] 00bbb111110rrrrr dddddddddddddddd adr gr[reg1]+sign-extend(disp16) z flag not(load-memory-bit(adr,bit#3)) store-memory-bit(adr,bit#3,1) 3 note 3 3 note 3 3 note 3 set1 reg2,[reg1] r r rr r1 11 11 1 rrrrr 0000000011100000 adr gr[reg1] z flag not(load-memory-bit(adr,reg2)) store-memory-bit(adr,reg2,1) 3 note 3 3 note 3 3 note 3 reg1,reg2 r r rr r1 11 11 1 rrrrr 0000000011000000 gr[reg2] gr[reg2] logically shift left by gr[reg1] 1 1 1 0 shl imm5,reg2 rrrrr010110iiiii gr[reg2] gr[reg2] logically shift left by zero-extend(imm5) 1 1 1 0 reg1,reg2 r r rr r1 11 11 1 rrrrr 0000000010000000 gr[reg2] gr[reg2] logically shift right by gr[reg1] 1 1 1 0 shr imm5,reg2 rrrrr010100iiiii gr[reg2] gr[reg2] logically shift right by zero-extend(imm5) 1 1 1 0 sld.b disp7[ep],reg2 r r r r r 0 1 1 0 d d d d d d d adr ep+zero-extend(disp7) gr[reg2] sign-extend(load-memory(adr,byte)) 1 1 note 9 sld.bu disp4[ep],reg2 rrrrr0000110dddd note 18 adr ep+zero-extend(disp4) gr[reg2] zero-extend(load-memory(adr,byte)) 1 1 note 9 sld.h disp8[ep],reg2 r r r r r 1 0 0 0 d d d d d d d note 19 adr ep+zero-extend(disp8) gr[reg2] sign-extend(load-memory(adr,halfword)) 1 1 note 9 sld.hu disp5[ep],reg2 rrrrr0000111dddd notes 18, 20 adr ep+zero-extend(disp5) gr[reg2] zero-extend(load-memory(adr,halfword)) 1 1 note 9 sld.w disp8[ep],reg2 rrrrr1010dddddd0 note 21 adr ep+zero-extend(disp8) gr[reg2] load-memory(adr,word) 1 1 note 9 sst.b reg2,disp7[ep] r r r r r 0 1 1 1 d d d d d d d adr ep+zero-extend(disp7) store-memory(adr,gr[reg2],byte) 1 1 1 sst.h reg2,disp8[ep] r r r r r 1 0 0 1 d d d d d d d note 19 adr ep+zero-extend(disp8) store-memory(adr,gr[reg2],halfword) 1 1 1 sst.w reg2,disp8[ep] rrrrr1010dddddd1 note 21 adr ep+zero-extend(disp8) store-memory(adr,gr[reg2],word) 1 1 1 st.b reg2,disp16[reg1] r r rr r1 11 01 0 rrrrr dddddddddddddddd adr gr[reg1]+sign-extend(disp16) store-memory(adr,gr[reg2],byte) 1 1 1 st.h reg2,disp16[reg1] r r rr r1 11 01 1 rrrrr ddddddddddddddd0 note 8 adr gr[reg1]+sign-extend(disp16) store-memory(adr,gr[reg2],halfword) 1 1 1 st.w reg2,disp16[reg1] rrrrr111011rrrrr ddddddddddddddd1 note 8 adr gr[reg1]+sign-extend(disp16) store-memory(adr,gr[reg2],word) 1 1 1 stsr regid,reg2 r r rr r1 11 11 1 rrrrr 0000000001000000 gr[reg2] sr[regid] 1 1 1
appendix c instruction set list user?s manual u19201ej3v0ud 1535 (6/6) execution clock flags mnemonic operand opcode operation i r l cy ov s z sat sub reg1,reg2 r r rr r0 01 10 1 rrrrr gr[reg2] gr[reg2]?gr[reg1] 1 1 1 subr reg1,reg2 r r rr r0 01 10 0 rrrrr gr[reg2] gr[reg1]?gr[reg2] 1 1 1 switch reg1 00000000010rrrrr adr (pc+2) + (gr[reg1] logically shift left by 1) pc (pc+2) + (sign-extend (load-memory(adr,halfword)) logically shift left by 1 5 5 5 sxb reg1 00000000101rrrrr gr[reg1] sign-extend (gr[reg1] (7:0)) 1 1 1 sxh reg1 00000000111rrrrr gr[reg1] sign-extend (gr[reg1] (15:0)) 1 1 1 trap vector 00000111111iiiii 0000000100000000 eipc pc+4(return pc) eipsw psw ecr.eicc exception code (40h to 4fh, 50h to 5fh) psw.ep 1 psw.id 1 pc 00000040h (when vector is 00h to 0fh (exception code: 40h to 4fh)) 00000050h (when vector is 10h to 1fh (exception code: 50h to 5fh)) 4 4 4 tst reg1,reg2 r r rr r0 01 01 1 rrrrr result gr[reg2] and gr[reg1] 1 1 1 0 bit#3,disp16[reg1] 11bbb111110rrrrr dddddddddddddddd adr gr[reg1]+sign-extend(disp16) z flag not(load-memory-bit(adr,bit#3)) 3 note 3 3 note 3 3 note 3 tst1 reg2, [reg1] r r rr r1 11 11 1 rrrrr 0000000011100110 adr gr[reg1] z flag not(load-memory-bit(adr,reg2)) 3 note 3 3 note 3 3 note 3 xor reg1,reg2 r r rr r0 01 00 1 rrrrr gr[reg2] gr[reg2] xor gr[reg1] 1 1 1 0 xori imm16,reg1,reg2 r r rr r1 10 10 1 rrrrr iiiiiiiiiiiiiiii gr[reg2] gr[reg1] xor zero-extend(imm16) 1 1 1 0 zxb reg1 00000000100rrrrr gr[reg1] zero-extend(gr[reg1] (7:0)) 1 1 1 zxh reg1 00000000110rrrrr gr[reg1] zero-extend(gr[reg1] (15:0)) 1 1 1 notes 1. dddddddd: higher 8 bits of disp9. 2. 4 if there is an instruction that rewrites the contents of the psw immediately before. 3. if there is no wait state (3 + the number of read access wait states). 4. n is the total number of list12 load registers. (a ccording to the number of wait states. also, if there are no wait states, n is the total number of list12 registers. if n = 0, same operation as when n = 1) 5. rrrrr: other than 00000. 6. the lower halfword data only are valid. 7. ddddddddddddddddddddd: the higher 21 bits of disp22. 8. ddddddddddddddd: the higher 15 bits of disp16. 9. according to the number of wait stat es (1 if there are no wait states). 10. b: bit 0 of disp16. 11. according to the number of wait stat es (2 if there are no wait states).
appendix c instruction set list user?s manual u19201ej3v0ud 1536 notes 12. in this instruction, for convenience of mnemonic descr iption, the source register is made reg2, but the reg1 field is used in the opcode. therefore, the m eaning of register specific ation in the mnemonic description and in the opcode differs from other instructions. rrrrr = regid specification rrrrr = reg2 specification 13. iiiii: lower 5 bits of imm9. iiii: higher 4 bits of imm9. 14. in the case of reg2 = reg3 (the lower 32 bits of the results are not written in the register) or reg3 = r0 (the higher 32 bits of the results are not wri tten in the register), shortened by 1 clock. 15. sp/imm: specified by bits 19 and 20 of the sub-opcode. 16. ff = 00: load sp in ep. 01: load sign expanded 16-bit immediate data (bits 47 to 32) in ep. 10: load 16-bit logically left shifted 16-bit immediate data (bits 47 to 32) in ep. 11: load 32-bit immediate data (bits 63 to 32) in ep. 17. if imm = imm32, n + 3 clocks. 18. rrrrr: other than 00 000. 19. ddddddd: higher 7 bits of disp8. 20. dddd: higher 4 bits of disp5. 21. dddddd: higher 6 bits of disp8. 22. do not make a combination that satisfies all the following conditions when using the ?mul reg1, reg2, reg3? instruction and ?mulu reg1, reg2, reg3? in struction. operation is not guaranteed when an instruction that satisfies the fo llowing conditions is executed. ? reg1 = reg3 ? reg1 reg2 ? reg1 r0 ? reg3 r0
user?s manual u19201ej3v0ud 1537 appendix d list of cautions this appendix lists cautions described in this document. ?classification ( hard/soft ) ? in table is as follows. hard: cautions for microcontroller internal/external hardware soft: cautions for software such as register settings or programs
appendix d list of cautions user?s manual u19201ej3v0ud 1538 (1/54) chapter classification function details of function cautions page flmd0 set this pin to low level in the normal operation mode. pp. 30, 33 ? hard regc connect the regc pin to v ss via a 4.7 f capacitor. pp. 30, 33 ? hard, soft drst fix this pin to the low level from when the reset status has been released until the ocdm.ocdm0 bit is cleared (0) when the on-chip debug function is not used. for details, see 4.6.3 cautions on on-chip debug pins. in addition, this pin incorporates a pull- down resistor and it can be disconnected by clearing the cdm.ocdm0 bit. pp. 30, 33 ? a0-a15 port 9 cannot be used as port pins or other alternate-function pins when the a0 to a15 pins are used in the separate bus mode. pp. 30, 33 ? chapter 1 hard introduction ani0-ani15 to use port 7 (p70/ani0 to p715/ani15) as a/d converter function pins and port i/o pins in mix, be sure to observe usage cautions (refer to 13.6 (4) alternate i/o). pp. 30, 33 ? when using an alternate function that is assigned to two ports when using an alternate function that is assigned to two ports, always use the alternate function at only one of the ports. p. 60 ? chapter 2 hard pin functions cautions on power application when the power is turned on, the following pins may momentarily output an undefined level. ? p53/sib2/kr3/tiq00/toq00/rtp03/ddo pin p. 73 ? eipc register eipsw register fepc register fepsw register because only one set of these registers is available, the contents of these registers must be saved by program if multiple interrupts are enabled. p. 77 ? eipc, fepc, ctpc register even if eipc or fepc, or bit 0 of ctpc is set to 1 by the ldsr instruction, bit 0 is ignored when execution is returned to the main routine by the reti instruction after interrupt servicing (this is because bit 0 of the pc is fixed to 0). set an even value to eipc, fepc, and ctpc (bit 0 = 0). p. 77 ? asid register initialize the asid register to 00h in its initialization routine. p. 83 ? program space because the 4 kb area of addresses 03fff000h to 03ffffffh is an on-chip peripheral i/o area, instructions cannot be fetched from this area. therefore, do not execute an operation in which the result of a branch address calculation affects this area. p. 86 ? if a register that can be accessed in byte units is accessed in halfword units, the higher 8 bits are undefined when the register is read, and data is written to the lower 8 bits. p. 95 ? addresses not defined as registers are rese rved for future expansion. the operation is undefined and not guaranteed when these addresses are accessed. p. 95 ? on-chip peripheral i/o area the internal rom/ram area and on-chip peripheral i/o area are assigned to successive addresses. when accessing the internal rom/ram area by incrementing or decrementing addresses using pointer operations and such, therefore, be careful not to access the on-chip peripheral i/o area by mistakenly extending over the internal rom/ram area boundary. p. 95 ? chapter 3 soft cpu function programmable peripheral i/o area the programmable peripheral i/o area exists only in the can controller versions. this area cannot be used with products that are not equipped with the can controller. p. 95 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1539 (2/54) chapter classification function details of function cautions page when using the external memory and ex panded internal ram simultaneously, set the external bus interface and expanded internal ram at the same time. p. 96 ? when accessing the expanded internal ram, all the external bus interface control signals except the csn signal be come active (n = 1 to 3). therefore, when using the expanded internal ram and external memory at the same time, be sure to control access to the external memory by us ing the csn signal output from the chip. p. 96 ? if an external wait is inserted via the wait pi n, an external wait will also be inserted into expanded internal ram access. p. 96 ? expanded internal ram be sure to specify the initial settings for the expanded internal ram before using it. p. 96 ? prdselh, prdsell registers this register cannot be read by the in -circuit emulator (qb-v850esx3h) (an undefined value is read). p. 99 ? bpc register when setting the pa15 bit to 1, be sure to set the bpc register to 8ffbh. when clearing the pa15 bit to 0, be sure to set the bpc register to 0000h. p. 123 ? five nop instructions or more must be in serted immediately after setting the idle1 mode, idle2 mode, or stop mode (by setting the psc.stp bit to 1). p. 125 ? when a store instruction is executed to store data in the command register, interrupts are not acknowledged. for details, see 3.4.8 (1) caution 1. p. 125 ? setting data to special registers although dummy data is written to the prcmd register, use the same general- purpose register used to set the special regi ster (<4> in example) to write data to the prcmd register (<3> in example). the same applies when a general-purpose register is used for addressing. p. 125 ? registers to be set first be sure to set the following registers first. ? system wait control register (vswc) ? on-chip debug mode register (ocdm) ? watchdog timer mode register 2 (wdtm2) ? registers related to expanded internal ram ? bus size configuration register (bsc) ? data wait control register 1 (dwc1) ? address wait control register (awc) ? bus cycle control register (bcc) ? program id register (asid) ? initialization setting registers when using clock modes 2, 3, and 4 ? clock control register (ckc) ? sscg frequency control register 0 (sfc0) ? sscg frequency control register 1 (sfc1) p. 128 ? vswc register three clocks are requi red to access an on-chip peripheral i/o register (without a wait cycle). the v850e/sj3-h and v850e/sk3-h require wait cycles according to the operating frequency. set the following value to the vswc register in accordance with the frequency used. p. 128 ? wdtm2 register the watchdog timer 2 automatically star ts in the reset mode after reset is released. write the wdtm2 register to activate this operation. p. 128 ? chapter 3 soft cpu function related to the expanded internal ram registers the expanded internal ram is accessed via the external bus interface. before accessing the expanded internal ram, be sure to set the registers related to the external bus interface (initial settings for the expanded internal ram). p. 129 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1540 (3/54) chapter classification function details of function cautions page when specific on-chip peripheral i/o register s are accessed, more wait states may be required in addition to the wait states set by the vswc register. p. 129 ? chapter 3 soft cpu function accessing specific on-chip peripheral i/o registers accessing the above registers is prohibited in the following statuses. if a wait cycle is generated, it can only be cleared by a reset. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock p. 131 ? hard, soft port 0 the drst pin is for on-chip debugging. if on-chip debugging is not used, fix the p05/intp2/drst pin to low level between when the reset signal of the reset pin is released and when the ocdm.ocdm0 bit is cleared (0). for details, see 4.6.3 cautions on on-chip debug pins. p. 141 ? pmc0 register the p05/intp2/drst pin becomes the drst pin regardless of the value of the pmc05 bit when the ocdm.ocdm0 bit = 1. p. 142 ? pf0 register to pull up an output pin at ev dd or higher, be sure to set the appropriate pf0n bit to 1. p. 144 ? p1 register do not read/write the p1 regist er during d/a conversion (see 15.4.3 cautions). p. 145 ? when using p1n as alternate functions (ano n pin output), set the pm1n bit to 1. p. 145 ? pm1 register when using one of the pm10 and pm11 pins as an i/o port and the other as a d/a output pin, do so in an application where the port i/o level does not change during d/a output. p. 145 ? pf2 register to pull up an output pin at ev dd or higher, be sure to set the appropriate pf2n bit to 1. p. 147 ? p312 to p310 bits are valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. however, the read value becomes undefined. p. 149 ? p3 register be sure to clear bits 13 to 15 to ?0?. p. 149 ? pm312 to pm310 bits are valid for the v850e/sk3-h only. be sure to set this bit to 1 in the v850e/sj3-h. p. 150 ? pm3 register be sure to set bits 13 to 15 to ?1?. p. 150 ? pmc312 to pmc310 bits are valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. p. 151 ? pmc3 register be sure to clear bits 13 to 15 to ?0?. p. 151 ? pfc310 bit is valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. p. 153 ? pfc3 register be sure to clear bits 11 to 15 to ?0?. p. 153 ? pfce310 bit is valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. p. 153 ? pfce3 register be sure to clear bits 0, 1, 5 to 7, and 11 to 15 to ?0?. p. 153 ? port 3 alternate function specifications the intp7 pin and rxda0 pin are alternate- function pins. when using the pin as the rxda0 pin, disable edge detection for the intp 7 alternate-function pin. (clear the intf3.intf31 bit and the intr3.intr31 bit to 0.) when using the pin as the intp7 pin, stop uarta0 reception. (clear the ua0ctl0.ua0rxe bit to 0.) p. 155 ? pf312 to pf310 bits are valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. p. 156 ? to pull up an output pin at ev dd or higher, be sure to set the appropriate pf3n bit to 1. p. 156 ? chapter 4 soft port functions pf3 register be sure to clear bits 13 to 15 to ?0?. p. 156 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1541 (4/54) chapter classification function details of function cautions page p45 to p43 bits are valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. however, the read value becomes undefined. p. 158 ? p4 register be sure to clear bits 6 and 7 to ?0?. p. 158 ? pm45 to pm43 bits are valid for the v850e/sk3-h only. be sure to set this bit to 1 in the v850e/sj3-h. p. 158 ? pm4 register be sure to set bits 6 and 7 to ?1?. p. 158 ? pmc45 to pmc44 bits are valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. p. 159 ? pmc4 register be sure to clear bits 3, 6 and 7 to ?0?. p. 159 ? pfc4 register be sure to clear bits 3 to 7 to ?0?. p. 160 ? pf45 to pf43 bits are valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. p. 160 ? to pull up an output pin at ev dd or higher, be sure to set the appropriate pf4n bit to 1. p. 160 ? soft pf4 register be sure to clear bits 6 and 7 to ?0?. p. 160 ? hard, soft the ddi, ddo, dck, and dms pins are for on-chip debugging. if on-chip debugging is not used, fix the p05/intp2/drst pin to low level between when the reset signal of the reset pin is released and when the ocdm.ocdm0 bit is cleared (0). for details, see 4.6.3 cautions on on-chip debug pins. p. 161 ? hard port 5 when the power is turned on, the p53 pin may momentarily output an undefined level. p. 161 ? p5 register p57 and p56 bits are valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. however, the read value becomes undefined. p. 162 ? pm5 register pm57 and pm56 bits are valid for the v850e/sk3-h only. be sure to set this bit to 1 in the v850e/sj3-h. p. 162 ? pmc5 register pmc57 and pmc56 bits are valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. p. 163 ? port 5 alternate function specifications the krn pin and tiq0m pin are alternate-fu nction pins. when using the pin as the tiq0m pin, disable krn pin key return detec tion, which is the alternate function. (clear the krm.krmn bit to 0.) also, w hen using the pin as the krn pin, disable tiq0m pin edge detection, which is the alternate function (n = 0 to 3, m = 0 to 3). p. 165 ? pf57 and pf56 bits are valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. p. 166 ? pf5 register to pull up an output pin at ev dd or higher, be sure to set the appropriate pf5n bit to 1. p. 166 ? the pfc62 bit is not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). be sure to clear this bit to 0 in the pd70f3931 (v850e/s j3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). p. 171 ? pfc6 register be sure to clear bit 15 to ?0?. p. 171 ? the pfce68, pece67, and pfce62 to pfce60 bits are not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) only. be sure to clear this bit to 0 in the pd70f3931 (v850e/s j3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h). p. 171 ? chapter 4 soft port functions pfce6 register be sure to clear bit 15 to ?0?. p. 171 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1542 (5/54) chapter classification function details of function cautions page port 6 alternate function specifications the krn pin and tiq0m pin are alternate-fu nction pins. when using the pin as the tiq0m pin, disable krn pin key return detec tion, which is the alternate function. (clear the krm.krmn bit to 0.) also, w hen using the pin as the krn pin, disable tiq0m pin edge detection, which is the alternate function (n = 2, 3, m = 0, 3). p. 174 ? pf6 register to pull up an output pin at ev dd or higher, be sure to set the appropriate pf6n bit to 1. p. 174 ? p7h register, p7l register do not read/write the p7h and p7l registers during a/d conversion (see 13.6 (4) alternate i/o). p. 176 ? pm7h register, pm7l register when using the p7n pin as its alternate fu nction (anin pin), set the pm7n bit to 1. p. 176 ? p85 to p82 bits are valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. however, the read value becomes undefined. p. 177 ? p8 register be sure to clear bits 6 and 7 to ?0?. p. 177 ? pm85 to pm82 bits are valid for the v850e/sk3-h only. be sure to set this bit to 1 in the v850e/sj3-h. p. 178 ? pm8 register be sure to set this bit to 1 in the v850e/sj3-h. p. 178 ? pmc85 to pmc82 bits are valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. p. 179 ? the intp8 and rxda3 pins are alternate-func tion pins. when using the rxda3 pin, disable detection of the edge of the intp8 pin (intf8.intf80 bit = 0 and intr8.intr80 bit = 0). when using the in tp8 pin, stop the reception operation of uarta3 (ua3ctl0.ua3rxe bit = 0). p. 179 ? pmc8 register be sure to clear bits 6 and 7 to ?0?. p. 179 ? pf85 to pf82 bits are valid for the v850e/sk3-h only. be sure to clear this bit to 0 in the v850e/sj3-h. p. 181 ? to pull up an output pin at ev dd or higher, be sure to set the appropriate pf8n bit to 1. p. 181 ? pf8 register be sure to clear bits 6 and 7 to ?0?. p. 181 ? pmc9 register port 9 pins cannot be used as port pi ns or other alternate-function pins if even one of the a0 to a15 pins is used in the separate bus mode. after setting the pfc9 and pfce9 registers to 0000h, therefore, set all 16 bits of the pmc9 register to ffffh at once. if none of the a0 to a15 pins is used in the separate bus mode, port 9 pins can be used as port pins or ot her alternate-function pins. p. 185 ? pfc9 register port 9 pins cannot be used as port pi ns or other alternate-function pins if even one of the a0 to a15 pins is used in the separate bus mode. after setting the pfc9 and pfce9 registers to 0000h, therefore, set all 16 bits of the pmc9 register to ffffh at once. if none of the a0 to a15 pins is used in the separate bus mode, port 9 pins can be used as port pins or ot her alternate-function pins. p. 186 ? port 9 alternate function specifications the rxda1 and kr7 pins must not be used at the same time. when using the rxda1 pin, do not use the kr7 pin (clear the krm.krm7 bit to 0). when using the kr7 pin, do not use the rxda1 pin (it is recommended to set the pfc91 bit to 1 and clear the pfce91 bit to 0). when the pfc 91 bit is cleared to 0 and the pfce91 bit is set to 1, clear the ua1ctl0.ua1rxe bit to 0. p. 188 ? pf9 register to pull up an output pin at ev dd or higher, be sure to set the appropriate pf9n bit to 1. p. 189 ? p13 register be sure to clear bits 4 to 7 to ?0?. p. 190 ? pm13 register be sure to set bits 4 to 7 to ?1?. p. 190 ? p14 register be sure to clear bits 6 and 7 to ?0?. p. 191 ? chapter 4 soft port functions pm14 register be sure to set bits 6 and 7 to ?1?. p. 191 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1543 (6/54) chapter classification function details of function cautions page p15 register be sure to clear bits 4 to 7 to ?0?. p. 192 ? pm15 register be sure to set bits 4 to 7 to ?1?. p. 192 ? be sure to clear bits 4 to 7 to ?0?. p. 193 ? pmc15 register the rxda1 and kr7 pins must not be used at the same time. when using the rxda1 pin, do not use the kr7 pin (clear the krm.krm7 bit to 0). when using the kr7 pin, do not use the rxda1 pin (clear the ua1ctl0.ua1rxe bit to 0). p. 193 ? to pull up an output pin at ev dd or higher, be sure to set the appropriate pf15n bit to 1. p. 193 ? pf15 register be sure to clear bits 4 to 7 to ?0?. p. 193 ? pcd register be sure to clear bits 4 to 7 to ?0?. p. 194 ? pmcd register be sure to set bits 4 to 7 to ?1?. p. 194 ? pmccd register be sure to clear bits 4 to 7 to ?0?. p. 195 ? pfccd register be sure to clear bits 4 to 7 to ?0?. p. 195 ? pmccs register be sure to cl ear bits 0 and 4 to 7 to ?0?. p. 199 ? soft pmcdl register when the eximc.smsel bit = 1 (separate mode) and the bsc.bs30 to bsc.bs00 bits = 0 (8-bit bus width), do not specify the ad8 to ad15 pins. p. 206 ? hard port register settings when alternate function is used between the p10 and p11 pins, when one pin is used as the i/o port, and the other pin is used as the d/a output pin (ano0, ano1), make sure that the port i/o level does not change during d/a output. p. 271 ? to switch from the port mode to alternate-function mode in the following order. <1> set the pfn register note : n-ch open-drain setting <2> set the pfcn and pfcen registers: alternate-function selection <3> set the corresponding bit of the pmcn regist er to 1: switch to alternate-function mode if the pmcn register is set first, note with caution that, at that moment or depending on the change of the pin states in accordance with the setting of the pfn, pfcn, and pfcen registers, unexpected operations may occur. p. 284 ? cautions on switching from port mode to alternate- function mode regardless of the port mode/alternate-functi on mode, the pn register is read and written as follows. ? pn register read: read the port output latch value (when pmn.pmnm bit = 0), or read the pin states (pmn.pmnm bit = 1). ? pn register write: write to the port output latch p. 284 ? cautions on alternate- function mode (input) switch between the port mode and alternate-function mode in the following sequence. ? to switch from port mode to alternate-function mode (input) set the pins to the alternate-function mode using the pmcn register and then enable the alternate-function operation. ? to switch from alternate-function mode (input) to port mode stop the alternate-function operation and then switch the pins to the port mode. p. 285 ? in port mode, pfn.pfnm bit in port mode, the pfn.pfnm bit is valid only in the output mode (pmn.pmnm bit = 0). in the input mode (pmnm bit = 1), the value of the pfnm bit is not reflected in the buffer. p. 286 ? chapter 4 soft port functions cautions on bit manipulation instruction for port n register (pn) when a 1-bit manipulation instruction is ex ecuted on a port that provides both input and output functions, the value of the output latch of an input port that is not subject to manipulation may be written in addition to the targeted bit. therefore, it is recommended to rewrite the output latch when switching a port from input mode to output mode. p. 287 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1544 (7/54) chapter classification function details of function cautions page hard, soft the following action must be taken if on-chip debugging is not used. ? clear the ocdm0 bit of the ocdm register (special register) (0) at this time, fix the p05/intp2/drst pin to low level from when reset by the reset pin is released until t he above action is taken. if a high level is input to the drst pin befor e the above action is taken, it may cause a malfunction (cpu deadlock). handle the p05 pin with the utmost care. p. 288 ? cautions on on- chip debug pins the p05/intp2/drst pin is not initia lized to function as an on-chip debug pin (drst) when a reset signal (wdt2res) is generated due to a watchdog timer overflow, a reset signal (lvires) is generated by the low-voltage detector (lvi), or a reset signal (clmres) is generated by the cl ock monitor (clm). the ocdm register holds the current value. p. 288 ? cautions on p05/intp2/ drst pin the p05/intp2/drst pin has an internal pull-down resistor (30 k typ.). after a reset by the reset pin, a pull-down resistor is connected. the pull-down resistor is disconnected when the ocdm0 bit is cleared (0). p. 288 ? cautions on p53 pin when power is turned on when the power is turned on, the following pins may momentarily output an undefined level. ? p53/sib2/kr3/tiq00/toq00/rtp03/ddo pin p. 288 ? hard hysteresis characteristics in port mode, the following port pins do not have hysteresis characteristics. p00 to p06 p20 note , p21 note p31 to p35, p37 to p39, p312 note p40 to p42, p45 note p50 to p55, p56 note p60, p62 to p615 p80, p82 to p84 note p90 to p97, p99, p910, p912 to p915 p150 note , p152 note , p153 note pcd0, pcd2 note v850e/sk3-h only p. 288 ? cautions on separate bus mode port 9 pins cannot be used as port pins or other alternate-function pins if even one of the a0 to a15 pins is used in the separate bus mode. after setting the pfc9 and pfce9 registers to 0000h, therefore, set all 16 bits of the pmc9 register to ffffh at once. if none of the a0 to a15 pins is used in the separate bus mode, port 9 pins can be used as port pins or ot her alternate-function pins. p. 289 ? cautions on reading port n registers (pn: n = 3 to 5, 8) (v850e/sj3-h only) in the v850e/sj3-h, the bit values of the following port n registers become undefined when read. port 3 register: p310 to p312 port 4 register: p43 to p45 port 5 register: p56, p57 port 8 register: p82 to p85 p. 289 ? chapter 4 soft port functions cautions on setting port n mode control registers (pmcn: n = 3 to 5, 8) in the v850e/sj3-h, be sure to set the bits of the following port n mode control registers to 0. port 3 mode control register: pmc310 to pmc312 port 4 mode control register: pmc44, pmc45 port 5 mode control register: pmc56, pmc57 port 8 mode control register: pmc82 to pmc85 p. 289 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1545 (8/54) chapter classification function details of function cautions page pin status when internal rom when the internal rom is written, as we ll as when the external memory area is accessed, the address bus, address/data bus, and control signals are activated, but write access is prohibited. p. 292 ? pin status when the expanded internal ram is accessed when the expanded internal ram is access ed, control signals (rd, wr0, wr1, astb) are activated. therefore, accesses to the external memory or external i/o must be controlled by the csn signal (n = 1 to 3). p. 292 ? write to the csc0 and csc1 registers a fter reset, and then do not change the set values. also, do not access an external memo ry area until the initial settings of the csc0 and csc1 registers are complete. p. 296 ? csc0 and csc1 registers in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h), expanded internal ram is not provided. therefore, the setting shown in ?5.3.1 (1) (a) when using expanded internal ram? cannot be used. be sure to use the setting shown in ?5.3.1 (1) (b) when not using expanded internal ram?. p. 296 ? write to the eximc register after reset, and then do not change the set values. also, do not access an external memory area until the initial settings of the eximc register are complete. p. 301 ? eximc register set the eximc register from the internal rom or internal ram area before making an external access. after setting the eximc register, be sure to insert a nop instruction. p. 301 ? write to the bsc register after reset, and then do not change the set values. also, do not access an external memory area until the initial settings of the bsc register are complete. p. 303 ? bsc register be sure to clear bits 7, 5, and 3 to ?0?. p. 303 ? write to the dwc0 and dwc1 registers after reset, and then do not change the set values. also, do not access an external memory area until the initial settings of the dwc0 and dwc1 registers are complete. pp. 311, 313 ? when the v850e/sj3-h and v850e/sk3-h are used in separate bus mode and operated at f cpu > 20 mhz, be sure to insert one or more wait. pp. 311, 313 ? dwc0, dwc1 registers when the v850e/sj3-h and v850e/sk3-h are used in multiplexed bus mode and operated at f cpu > 32 mhz, be sure to insert one or more wait. pp. 311, 313 ? dwc0 register be sure to clear bits 15, 11, 7, and 3 to ?0?. p. 312 ? in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h), expanded internal ram is not provided. therefore, the setting shown in ?5.6.1 (2) (a) when using expanded internal ram? cannot be used. be sure to use setting shown in ?5.6.1 (2) (b) not using expansion internal ram?. p. 312 dwc1 register be sure to clear bits 15, 11, 7, and 3 to ?0?, and set bits 14 to 12, 10 to 8, 2 to 0 to ?1?. p. 313 ? write to the awc register after reset, and then do not change the set values. also, do not access an external memory area until the initial settings of the awc register are complete. p. 316 ? awc register when the v850e/sj3-h and v850e/sk3-h are operated at f cpu > 20 mhz, be sure to insert the address hold wait and the address setup wait. p. 316 ? write to the bcc register after reset, and then do not change the set values. also, do not access an external memory area until the initial settings of the bcc register are complete. p. 318 ? chapter 5 soft bus control function bcc register be sure to clear bits 6, 4, 2, and 0 to ?0?. p. 318 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1546 (9/54) chapter classification function details of function cautions page clock mode the clock mode is set using the op tion byte, and therefore cannot be switched during operation. consequently, it is important to determi ne which clock mode is to be used, before starting operation. p. 329 ? in clock mode 1, the main clock (f xx ) is supplied as the source of the peripheral clock (f xp , f ie , f can ). in this mode, the sscg output clock cannot be used as the main clock. p. 330 ? clock mode 1 enable operation of the on-chip peripheral fu nctions that operate on the main clock (= peripheral clock) after ensuring that main clock oscillation is stable. if operation of these functions is enabled before the main clock?s oscillation stabilization time has elapsed, a malfunction may occur. p. 359 ? in clock modes 3 and 4, the sscg output clock is used as the main clock and the pll output is used as the peripheral clock. in these modes, the pll output clock cannot be used as the main clock. also, when clock-through mode is selected for the main clock, the source of the peripheral clock will be the pll output clock. p. 331 ? the pll starts operating and enters the locked state after reset release (pllctl.pllon bit = 1, lockr.lock bit = 0) . do not subsequently stop the pll by software (i.e., do not set the pllctl.pllon bit to 0). under any of the following conditions, however, the pll will stop automatically. ? when a system reset is applied ? when the system enters idle2 or stop mode ? when the cpu is operating on the subclock and the main clock is stopped (pcc.ck3 bit = 1, pcc.mck bit = 1) the pll starts operation again when the condition is released. be sure to set the oscillation stabilization time and setup ti me to be inserted after conditions are released to over the lockup time of pll. pp. 335, 338, 341 ? in clock modes 2, 3, and 4, the pll output clock (f pllo ) cannot be selected as the main clock (f xx ). however, when the sscg is stopped by setting the sscgctl.sscgon bit to 0, the sscgctl.selsscg bit automatically becomes 0, causing f pllo to be selected as the main clock. consequently, when switching from sscg mode to clock-through mode, be sure to first set the pllctl.selpll bit to 0, and then stop the sscg by setting the sscgon bit to 0 after switching modes. similarly, when switching from clock- through mode to sscg mode, first set the sscgon bit to 1 to start up the sscg, wait for the lockup time to elapse, then set the selsscg bit to 1 to select f sscgo before finally setting the selpll bit to 1. pp. 335, 338, 341 ? in clock mode 2 to 4, be sure to set the ckc.ckdiv0 bit to 1 (no division). pp. 336, 339, 342 ? in clock modes 2, 3, and 4, always set the ckc, sfc0 and sfc1 registers in the status immediately after reset rel ease; that is, in clock-through mode (pllctl.selpll bit = 0) and with sscg operation stopped. p. 361 ? set the ckc, sfc0, and sfc1 registers only once after reset is released. these settings cannot be changed during operation. p. 361 ? be sure to insert a 1 s wait time after setting the ckc, sfc0, and sfc1 registers. p. 361 ? when the sscgctl.sscgon bit is set to 0, the sscgctl.selsscg bit is also cleared to 0, automatically. p. 362 ? chapter 6 soft clock generation function clock mode 2 to 4 when switching the system to subclock ope ration, first switch to clock-through mode and stop operation of the sscg. p. 362 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1547 (10/54) chapter classification function details of function cautions page do not stop operation of the pll by software. when the main clock oscillator is stopped, the pll automatically stops with the pllctl.pllon bit still set to 1 (pll operable). do not clear (0) the pllctl .pllon bit after stopping the pll. p. 362 ? enable operation of the on-chip peripheral functions that operate on the peripheral clock (f xp , f ie , and f can ) after ensuring that main clock oscillation is stable. if operation of these functions is enabled before the main clock?s oscillation stabilization time has elapsed, a malfunction may occur. p. 363 ? clock mode 2 to 4 enable operation of the sscg after sw itching to main clock operation. p. 363 ? clock mode 4 in clock mode 4, be sure to set the plli0 bit of the option byte 0000007bh to 0 (no division). p. 342 ? do not change the cpu clock (by using the ck3 to ck0 bits) while clkout is being output. p. 346 ? when manipulating the ck3 bit, do not change th e set values of the ck2 to ck0 bits. p. 346 ? when the main clock oscillator is stopped, be sure to stop operation of the on-chip peripheral functions that are ope rating on the peripheral clock (f xp , f ie , f can ). p. 346 ? pcc register if the following condition is not satisfied, ma ke sure to satisfy it by changing the ck2 to ck0 bit settings before shifting to subclock operation mode. internal system clock (f clk ) > subclock (f xt : 32.768 khz) 4 p. 346 ? the internal oscillator cannot be stopped while the cpu is operating on the internal oscillation clock (ccls.cclsf bit = 1). do not set the rstop bit to 1. p. 347 ? the internal oscillator oscillates if t he ccls.cclsf bit is set to 1 (when wdt overflow occurs during oscillation stabilization) even when the rstop bit is set to 1. at this time, the rstop bit remains being set to 1. p. 347 ? the setting of the rstop bit is only valid when stopping the on-chip oscillator has been enabled by setting the rmopin bit of the option byte 0000007ah (see chapter 33 option byte function for details) to 0. if stopping the on-chip oscillator has been disabled by setting the rmopin bit of the option byte 0000007ah to 1, the rstop bit setting is invalid. p. 347 ? rcm register be sure to set bits 1 to 7 to ?0?. p. 347 ? in clock modes 2, 3, and 4, do not stop the pll by software (i.e., do not set the pllctl.pllon bit to 0). p. 348 ? when stopping pll operation in clock mode 1, first set the clock through mode (selpll bit = 0), wait for at least 8 cl ocks, and then stop the pll (pllon bit = 0). when the pllon bit is cleared to 0, the selpll bit is automatically cleared to 0 (clock-through mode), but be sure to stop the pll in the above procedure. p. 348 ? when stopping sscg operation in clock modes 2, 3, and 4, first set the clockthrough mode (selpll bit = 0), then stop the sscg (by setting the sscgctl.sscgon bit to 0) after waiting for at least 8 clocks to elapse. p. 348 ? pllctl register set the selpll bit to 1 after the pll clock frequency or sscg clock frequency has stabilized (locked state). if the pll frequency is not stable (lockr.lock bit = 1 (unlocked state)), even if 1 is written to the selpll bit, 0 will end up being written. also, be sure to properly secure the sscg lockup time by software. p. 348 ? chapter 6 soft clock generation function ckc register the ckc.ckdiv0 bit can be switc hed in clock mode 1. however, when setting the ckdiv0 bit, be sure to set the clock-through mode and stop the pll. p. 349 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1548 (11/54) chapter classification function details of function cautions page in clock modes 2, 3, and 4, be sure to set the ckdiv0 bit to 1 (no division) immediately after reset is released, while the clock modes are still in clock-through mode (pllctl.selpll bit = 0). set the ck c register only once after reset is released. these settings cannot be changed dur ing operation. for details of the initial settings, see 6.4.4 (1) initial settings for using clock modes 2, 3, and 4. p. 349 ? ckc register be sure to set bits 1 and 3 to ?1? and set bits 2 and 4 to 7 to ?0?. p. 349 ? lockr register the lock register does not refl ect the lock status of the pll in real time. p. 350 ? set so that the lockup time is 800 s or longer. p. 351 ? do not change the plls register setting during the lockup period. p. 351 ? plls register be sure to set bits 2 to 7 to ?0?. p. 351 ? the sscg cannot be used in clock mode 1. do not change the initial settings of the sscgctl register in this mode. p. 352 ? in clock modes 2, 3, and 4, the pll output clock (f pllo ) cannot be selected for the multiplication clock (f pll ). however, when the sscg is stopped by setting the sscgctl.sscgon bit to 0, the sscgctl.selsscg bit automatically becomes 0, causing f pllo to be selected as the multiplication clock. consequently, when switching from sscg mode to clock- through mode, be sure to first set the pllctl.selpll bit to 0, and then stop the sscg by setting the sscgon bit to 0 a fter switching modes. similarly, when switching from clock-through mode to sscg mode, first set the sscgon bit to 1 to start up the sscg, wait for the lockup time to elapse, then set the selsscg bit to 1 to select f sscgo before finally setting the selpll bit to 1. p. 352 ? when the pll is stopped (pllctl.pllon bit = 0), the sscg will not operate even if the sscgctl.sscgon bit is set to 1. note, however, that the pll cannot be stopped in clock modes 2, 3, and 4. p. 352 ? sscgctl register be sure to set bits 2 to 7 to ?0?. p. 352 ? the sscg cannot be used in clock mode 1. do not change the initial settings of the sfc0 register in this mode. p. 353 ? sfc0 register in clock modes 2, 3, and 4, be sure to ma ke the sfc0 register settings immediately after reset is released, while the clock modes are still in clock-through mode (pllctl.selpll bit = 0) and the sscg is stopped (sscgctl.sscgon bit = 0). in addition, be sure to set the sfc0 register only once after reset is released. these settings cannot be changed during operation. fo r details, see 6.4.4 (1) initial settings for using clock modes 2, 3, and 4. p. 353 ? the sscg cannot be used in clock mode 1. do not change the initial settings of the sfc1 register in this mode. p. 354 ? in clock modes 2, 3, and 4, be sure to ma ke the sfc1 register settings immediately after reset is released, while the clock modes are still in clock-through mode (pllctl.selpll bit = 0) and the sscg is stopped (sscgctl.sscgon bit = 0). in addition, be sure to set the sfc1 register only once after reset is released. these settings cannot be changed during operation. fo r details, see 6.4.4 (1) initial settings for using clock modes 2, 3, and 4. p. 354 ? sfc1 register be sure to set bits 2, 3, and 6 to ?0?. p. 354 ? chapter 6 soft clock generation function procedure for setting clock generation function for using clock mode 1 set the clock generation function in accordan ce with 6.4.3 procedure for setting clock generation function for using clock mode 1 p. 357 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1549 (12/54) chapter classification function details of function cautions page chapter 6 soft clock generation function procedure for setting clock generation function for using clock modes 2, 3, and 4 set the clock generation function in accordan ce with 6.4.4 procedure for setting clock generation function for using clock modes 2, 3, and 4 p. 360 ? set the tpncks2 to tpncks0 bits when the tpnce bit = 0. when the value of the tpnce bit is changed from 0 to 1, the tpncks2 to tpncks0 bits can be set simultaneously. p. 373 ? tp0ctl0 to tp8ctl0 registers be sure to clear bits 3 to 6 to ?0?. p. 373 ? set the tpneee and tpnmd3 to tpnmd0 bits when the tpnctl0.tpnce bit = 0. (the same value can be written when the tpnce bit = 1.) the operation is not guaranteed when rewriting is performed with the tpnce bit = 1. if rewriting was mistakenly performed, clear the tpnce bit to 0 and then set the bits again. p. 375 ? tp0ctl1 to tp8ctl1 registers be sure to clear bits 3, 4, and 7 to ?0? for tmp0 to tmp6 and bits 4 and 7 to ?0? for tmp7 and tmp8. p. 375 ? the tpmlde bit is valid only when the tpmecm1 and tpmecm0 bits = 00, 01. writing ?1? to this bit is ignored when the tpmecm1 and tpmecm0 bits = 10, 11. p. 377 ? the edge detection of the tencm0 and tencm1 inputs specified by the tpmioc3.tpmeis1 and tpmioc3.tpmeis0 bits is invalid and fixed to both the rising and falling edges when the tpmuds1 and tpmuds0 bits = 10, 11. p. 377 ? set the tpmlde, tpmecm1, tpmecm0, tp muds1, and tpmuds0 bits when the tpmctl0.tpmce bit = 0 (the same value can be written to these bits when the tpmce bit = 1). if the value of these bits is changed when the tpmce bit = 1, the operation cannot be guaranteed. if it is changed by mistake, clear the tpmce bit and then set the correct value. p. 377 ? tp7ctl2 to tp8ctl2 registers be sure to clear bits 5 and 6 to ?0?. p. 377 ? the pin output changes if the setting of t he tpnioc0 register is rewritten when the port is set to topn0 and topn1 outputs. therefore, note changes in the pin status by setting the port to the input mode and making the output status of the pins a high- impedance state. p. 379 ? rewrite the tpnol1, tpnoe1, tpnol0, and tpnoe0 bits when the tpnctl0.tpnce bit = 0. (the same value can be written when the tpnce bit = 1.) if rewriting was mistakenly performed, clear the tpnce bit to 0 and then set the bits again. p. 379 ? tp0ioc0 to tp8ioc0 registers even if the tpnola bit is manipulated when the tpnce and tpnoea bits are 0, the topna pin output level varies (a = 0, 1). p. 379 ? rewrite the tpnis3 to tpnis0 bits when the tpnctl0.tpnce bit = 0. (the same value can be written when the tpnce bit = 1.) if rewriting was mistakenly performed, clear the tpnce bit to 0 and then set the bits again. p. 380 ? tp0ioc1 to tp8ioc1 registers be sure to clear bits 4 to 7 to ?0?. p. 380 ? rewrite the tpnees1, tpnees0, tpnets1, and tpnets0 bits when the tpnctl0.tpnce bit = 0. (the same value can be written when the tpnce bit = 1.) if rewriting was mistakenly performed, clear the tpnce bit to 0 and then set the bits again. p. 381 ? chapter 7 soft 16-bit timer/event counter p (tmp) tp0ioc2 to tp8ioc2 registers be sure to clear bits 4 to 7 to ?0?. p. 381 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1550 (13/54) chapter classification function details of function cautions page tp7ioc3 to tp8ioc3 registers rewrite the tpmsce, tpmzcl, tpmbcl, tpmacl, tpmecs1, tpmecs0, tpmeis1, and tpmeis0 bits when the tpmctl0.tpmce bit = 0. (the same value can be written to these bits when the tpmc e bit = 1.) if rewriting was mistakenly performed, clear the tpmce bit to 0 and then set these bits again. p. 383 ? rewrite the tpnccs1 and tpnccs0 bits when the tpnce bit = 0. (the same value can be written when the tpnce bit = 1.) if rewriting was mistakenly performed, clear the tpnce bit to 0 and then set the bits again. p. 384 ? tp0opt0 to tp8opt0 registers be sure to clear bits 1 to 3, 6, and 7 to ?0?. p. 384 ? tp7opt1 to tp8opt1 registers be sure to clear bits 3 to 7 to ?0?. p. 386 ? tp0ccr0 to tp8ccr0 tp0ccr1 to tp8ccr1 tp0cnt to tp8cnt registers accessing the tpnccr0, tpnccr1 and tpn cnt register are prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-chip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock pp. 387, 389, 391 ? en0nfc to en1nfc registers when using the tmpm encoder count functi on, enable tmpm after 2 or 3 sampling clocks have elapsed. p. 392 ? to use the external event count mode, specify that the valid edge of the tipk0 pin capture trigger input is not detected (by clearing the tpkioc1.tpkis1 and tpkioc1.tpkis0 bits to ?00?). p. 395 ? operation (tmp0 to tmp6 registers) when using the external trigger pulse out put mode, one-shot pulse output mode, and pulse width measurement mode, select the internal clock as the count clock (by clearing the tpkctl1.tpkeee bit to 0). p. 395 ? to use the external event count mode, specify that the valid edge of the tipm0 pin capture trigger input is not detected ((by clearing the tpmioc1.tpmis1 and tpmioc1.tpmis0 bits to ?00?). p. 395 ? operation (tmp7 to tmp8 registers) when using the external trigger pulse out put mode, one-shot pulse output mode, and pulse width measurement mode, select the internal clock as the count clock (by clearing the tpmctl1.tpmeee bit to 0). p. 395 ? overflow operation (tmp0 to tmp6 registers) after the overflow interrupt request si gnal (inttpkov) has been generated, be sure to check that the overflow flag (tpkovf bit) is set to 1. p. 396 ? overflow operation (tmp7 to tmp8 registers) after the overflow interrupt request si gnal (inttpmov) has been generated, be sure to check that the overflow flag (tpm ovf, tpmeof bits) is set to 1. p. 397 ? batch write writing to the tpnccr1 register incl udes enabling of batch write. thus, rewrite the tpnccr1 register after rewriting the tpnccr0 register. p. 402 ? chapter 7 soft 16-bit timer/event counter p (tmp) notes on rewriting tpnccr0 register when the value of the tpnccr0 register is rewritten to a smaller value during counting, the 16-bit counter may overflow. if there is a possibility of overflow, stop counting and then change the set value. pp. 411, 422, 442 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1551 (14/54) chapter classification function details of function cautions page external event count mode in the external event count mode, the tpnccr0 and tpnccr1 registers must not be cleared to 0000h. p. 416 ? set the tpnioc0 register to 00h. p. 419 ? register setting for operation in external event count mode when an external clock is used as the count clock, the external clock can be input only from the tipn0 pin. at this time, set the tpnioc1.tpnis1 and tpnioc1.tpnis0 bits to 00 (capture trigger input (tipn0 pin): no edge detection). p. 419 ? in the external event count mode, sett ing the tpnccr0 and tpnccr1 registers to 0000h is disabled. p. 421 ? operation timing in external event count mode in the external event count mode, use of the timer output (topn0, topn1) is disabled. p. 421 ? external trigger pulse output mode in external trigger pulse output mode, sele ct the internal clock (set tpnctl1.tpneee bit = 0) as the count clock. p. 425 ? notes on changing pulse width during operation to change the pwm waveform while the counter is operating, write the tpnccr1 register last. rewrite the tpnccrm register after writing the tpnccr1 register after the inttpncc0 signal is detected. p. 431 ? one-shot pulse output mode in one-shot pulse output mode, select the internal clock (set tpnctl1.tpneee bit = 0) as the count clock. p. 437 ? soft setting of registers in one- shot pulse output mode one-shot pulses are not output even in the one-shot pulse output mode, if the value set in the tpnccr1 register is greater than that set in the tpnccr0 register. p. 440 ? hard processing of overflow if capture trigger interval is long if the pulse width is greater than one cycle of the 16-bit counter, care must be exercised because an overfl ow may occur more than once from the first capture trigger to the next. p. 468 ? note on capture operation when the capture operation is used and a slow clock is selected as the count clock, ffffh, not 0000h, may be captured in the tpnccra register, or the capture operation may not be performed (capture interrupt does not occur) if the capture trigger is input immediately after the tpnctl0.tpnce bit is set to 1. the same operation results during the period in which no external event counts are input while the capture operation is used and an external event count input is used as a count clock. p. 470 ? when in pulse width measurement mode, select the internal clock (set tpnctl1.tpneee bit = 0) as the count clock. p. 471 ? pulse width measurement mode if a slow clock is selected as the count clock, ffffh, not 0000h, may be captured to the tpnccra register, or the capture operation may not be performed (capture interrupt does not occur) if the capture trigger is input immediately after the tpnctl0.tpnce bit has been set to 1. p. 476 ? when tpmuds1 and tpmuds0 bits = 10, specification of the valid edge of the tencm0 and tencm1 pins is invalid. p. 481 ? when tpmuds1 and tpmuds0 bits = 11, specification of the valid edge of the tencm0 and tencm1 pins is invalid. p. 482 ? chapter 7 soft 16-bit timer/event counter p (tmp) encoder count function (only for tmp7 and tmp8) the 16-bit counter is cleared to 0000h when the clear level condition of the tpmzcl, tpmbcl, and tpmacl bits match the input level of the tecrm, tencm1, or tencm0 pin. p. 487 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1552 (15/54) chapter classification function details of function cautions page when using the selector function, set the capture trigger input of tmp or tmq before connecting the timer. p. 499 ? selector function when setting the selector function, first di sable the peripheral i/o to be connected (tmp/uarta or tmq/can controller). p. 499 ? selcnt0 register to set the isel0, isel1, isel3, isel4, and isel6 bits to 1, set the corresponding pin in the capture trigger input mode. p. 500 ? chapter 7 soft 16-bit timer/event counter p (tmp) switching of dma transfer start factors in the v850e/sj3-h and v850e/sk3-h, the dma transfer start factors inttp0ov signal and intub0tit signal, inttp1ov signal and intub1tir signal, and inttp2ov signal and intub1tit signal are used alternately and cannot be used simultaneously. to use the inttp0ov, inttp1ov, or inttp2ov signal as dma transfer start factors, set the dtfrob0 bit in the option byte area 0000007ah to 0 (see chapter 33 option byte function). in this case, the intub0tit, intub1tir, and intub1tit signals cannot be used as a dma transfer start factor. for details, see table 22-1 dma transfer start factors. p. 501 ? set the tq0cks2 to tq0cks0 bits when the tq0ce bit = 0. when the value of the tq0ce bit is changed from 0 to 1, the tq0cks2 to tq0cks0 bits can be set simultaneously. p. 507 ? tq0ctl0 register be sure to clear bits 3 to 6 to ?0?. p. 507 ? set the tq0eee and tq0md2 to tq0md0 bits when the tq0ctl0.tq0ce bit = 0. (the same value can be written when the tq0ce bit = 1.) the operation is not guaranteed when rewriting is performed with the tq0ce bit = 1. if rewriting was mistakenly performed, clear the tq0ce bit to 0 and then set the bits again. p. 508 ? tq0ctl1 register be sure to clear bits 3, 4, and 7 to ?0?. p. 508 ? the pin output changes if the setting of the tq0ioc0 register is rewritten when the port is set to output toq0m. therefore, note changes in the pin status by setting the port in the input mode and making the output status of the pins a highimpedance state. p. 509 ? rewrite the tq0olm and tq0oem bits when the tq0ctl0.tq0ce bit = 0. (the same value can be written when the tq0ce bit = 1.) if rewriting was mistakenly performed, clear the tq0ce bit to 0 and then set the bits again. p. 509 ? tq0ioc0 register even if the tq0olm bit is manipulated w hen the tq0ce and tq0oem bits are 0, the toq0m pin output level varies. p. 509 ? tq0ioc1 register rewrite the tq0is7 to tq0is0 bits when the tq0ctl0.tq0ce bit = 0. (the same value can be written when the tq0ce bit = 1.) if rewriting was mistakenly performed, clear the tq0ce bit to 0 and then set the bits again. p. 510 ? tq0ioc2 register rewrite the tq0ees1, tq0ees0, tq0ets1, and tq0ets0 bits when the tq0ctl0.tq0ce bit = 0. (the same value can be written when the tq0ce bit = 1.) if rewriting was mistakenly performed, clear the tq0ce bit to 0 and then set the bits again. p. 511 ? rewrite the tq0ccs3 to tq0ccs0 bits when the tq0ctl0.tq0ce bit = 0. (the same value can be written when the tq0ce bi t = 1.) if rewriting was mistakenly performed, clear the tq0ce bit to 0 and then set the bits again. p. 512 ? chapter 8 soft 16-bit timer/event counter q (tmq) tq0opt0 register be sure to clear bits 1 to 3 to ?0?. p. 512 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1553 (16/54) chapter classification function details of function cautions page tq0ccr0 to tq0ccr3, tq0cnt registers accessing the tq0ccr0 to tq0ccr3, and tq0cnt registers is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-chip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock pp. 513, 515, 517, 519, 521 ? to use the external event count mode, specify that the valid edge of the tiq00 pin capture trigger input is not detected (by clearing the tq0ioc1.tq0is1 and tq0ioc1.tq0is0 bits to ?00?). p. 522 ? operation when using the external trigger pulse out put mode, one-shot pulse output mode, and pulse width measurement mode, select the internal clock as the count clock (by clearing the tq0ctl1.tq0eee bit to 0). p. 522 ? overflow operation after the overflow interrupt request si gnal (inttq0ov) has been generated, be sure to check that the overflow fl ag (tq0ovf bit) is set to 1. p. 523 ? batch write writing to the tq0ccr1 register includes enabling of batch write. thus, rewrite the tq0ccr1 register after rewriting the tq0ccr0, tq0ccr2, and tq0ccr3 registers. p. 528 ? notes on rewriting tq0ccr0 register if the value of the tq0ccr0 register is re written to a smaller value during counting, the 16-bit counter may overflow. if there is a possibility of overflow, stop counting and then change the set value. pp. 536, 547, 571 ? in the external event count mode, the tq0ccr0 to tq0ccr3 registers must not be cleared to 0000h. p. 541 ? set the tq0ioc0 register to 00h. p. 544 ? external event count mode when an external clock is used as the count clock, the external clock can be input only from the tiq00 pin. at this time, set the tq0ioc1.tq0is1 and tq0ioc1.tq0is0 bits to 00 (capture tri gger input (tiq00 pin): no edge detection). p. 544 ? in the external event count mode, setting the tq0ccr0 to tq0ccr3 registers to 0000h is disabled. p. 546 ? operation timing in external event count mode in the external event count mode, use of the timer output (toq00 to toq03) is disabled. p. 546 ? external trigger pulse output mode in external trigger pulse output mode, select the internal clock (set the tq0ctl1.tq0eee bit = 0) as the count clock p. 551 ? note on changing pulse width during operation to change the pwm waveform while the counter is operating, write the tq0ccr1 register last. rewrite the tq0ccrk register after writing the tq0ccr1 register after the inttq0cc0 signal is detected. p. 558 ? in one-shot pulse output mode, select the internal clock (set the tq0ctl1.tq0eee bit = 0) as the count clock. p. 564 ? soft one-shot pulse output mode one-shot pulses are not output even in the one-shot pulse output mode, if the value set in the tq0ccr0 register is greater than that set in the tq0ccrk register. p. 568 ? chapter 8 hard 16-bit timer/event counter q (tmq) processing of overflow if capture trigger interval is long if the pulse width is greater than one cycle of the 16-bit counter, care must be exercised because an overfl ow may occur more than once from the first capture trigger to the next. p. 602 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1554 (17/54) chapter classification function details of function cautions page capture operation if the capture operation is used and if a slow clock is selected as the count clock, ffffh, not 0000h, may be captured to the tq0ccrm register, or the capture operation may not be performed (capture interrupt does not occur) if the capture trigger is input immediately after the tq0c tl0.tq0ce bit is set to 1 (m = 0 to 3) the same operation results during the period in which no external event counts are input while the capture operation is used and an external event count input is used as a count clock. p. 604 ? in the pulse width measurement mode, select the internal clock (set the tq0ctl1.tq0eee bit = 0) as the count clock. p. 605 ? pulse width measurement mode if a slow clock is selected as the count clock, ffffh, not 0000h, may be captured to the tq0ccrm register, or the capture operation may not be performed (capture interrupt does not occur) if the capture trigger is input immediately after the tq0ctl0.tq0ce bit is set to 1 (m = 0 to 3). p. 610 ? soft switching of dma transfer start factor in the v850e/sj3-h and v850e/sk3-h, the inttq0ov and intub0tir signals, which are the dma transfer start factors, share the same pin, and they cannot be used at the same time. to use the inttq0ov signal as the dma transfer start factor, set the dtfrob0 bit of the option byte 0000007ah to 0 (refer to chapter 33 option byte function). in this case, the intub0tir signal cannot be used as the dma transfer start factor. for details, see table 22-1 dma transfer start factors. p. 611 ? chapter 8 hard 16-bit timer/event counter q (tmq) using tiq0m pin and krn pin at the same time the tiq0m pin and the krn pin cannot be used at the same time (m = 0 to 3, n = 0 to 3). although the tiq00/kr3 pin and the tiq 03/kr2 pin are assigned to two different ports each, the pins cannot be used at the same time at different ports. p. 611 ? set the tmncks2 to tmncks0 bits when tmnce bit = 0. when changing the value of tmnce from 0 to 1, it is not possible to set the value of the tmncks2 to tmncks0 bits simultaneously. p. 615 ? tm0ctl0 to tm2ctl0 register be sure to clear bits 3 to 6 to ?0?. p. 615 ? interval timer mode operation timing do not set the tmncmp0 register to ffffh. pp. 616, 619, 620 ? count operation it might take some time to start counting after the tmnctl0.tmnce bit is set to 1. refer to 9.4.2 (1) maximum time before counting start. p. 620 ? tm0cmp0, tm0ctl0 registers rewriting the tmncmp0 and tmnctl0 registers is prohibited while tmmn is operating. if these registers are rewritten while the tmnce bit is 1, the operation cannot be guaranteed. if they are rewritten by mistak e, clear the tmnctl0.tmnce bit to 0, and re-set the registers p. 620 ? chapter 9 soft 16-bit interval timer m (tmm) switching dma transfer start factor in the v850e/sj3-h and v850e/sk3-h, the inttm1eq0 and intkr signals and the inttm2eq0 and intp8 signals, which are the dma transfer start factors, respectively share the same pin, and they cannot be used at the same time. to use inttm1eq0 or inttm2eq0 signal as t he dam transfer start factor, set the dtfrob0 bit of the option byte 0000007ah to 1. (refer to chapter 33 option byte function.) in this case, the intkr and intp8 signals cannot be used as the dma transfer start factor. remark for details, see table 22-1 dma transfer start factors. p. 620 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1555 (18/54) chapter classification function details of function cautions page do not change the values of the bgcs 00 and bgcs01 bits during watch timer operation. p. 624 ? set the prsm0 register before setting the bgce0 bit to 1. p. 624 ? to realize the watch function by the watch timer or the real-time counter (rtc), set the prsm0 and prscm0 registers according to the main oscillation clock frequency (f x ) to be used so as to obtain an f brg frequency of 32.768 khz. p. 624 ? prsm0 register be sure to set bits 2, 3, and 5 to 7 to ?0?. p. 624 ? do not rewrite the prscm0 register during watch timer operation. p. 625 ? set the prscm0 register before setting the prsm0.bgce0 bit to 1. p. 625 ? prscm0 register to realize the watch function by the watch timer or the real-time counter (rtc), set the prsm0 and prscm0 registers according to the main oscillation clock frequency (f x ) to be used so as to obtain an f brg frequency of 32.768 khz. p. 625 ? soft wtm register rewrite the wtm2 to wtm7 bits while both the wtm0 and wtm1 bits are 0. p. 629 ? hard intwt signal some time is required before the first watch timer interrupt request signal (intwt) is generated after operation is enabled (w tm.wtm1 and wtm.wtm0 bits = 1). p. 631 ? stop the real-time counter (rc1pwr bit = 1 0) during operation as described in 10.5.4 (8) initializing real-time counter. p. 636 ? the rc1cks bit can be rewritten only when t he operation of the realtime counter is stopped (rc1pwr bit = 0). rewriting the rc1cks bit as soon as setting the rc1pwr bit from ?0? to ?1? is prohibited. p. 636 ? rc1cc0 register be sure to set bits 0 to 5 to ?0?. p. 636 ? writing ?0? to the rtce bit is prohibited while the rtce bit = 1. clear (0) the rtce bit by clearing (0) the rc1pwr bit as described in 10.5.4 (8) initializing real-time counter. p. 637 ? the rc1ck1hz output pin operates as follows when the setting of the cloe1 bit is changed. ? if cloe1 bit is changed from 0 to 1: rc1ck1hz outputs a pulse of 1 hz after up to 2 clocks. ? if cloe1 bit is changed from 1 to 0: rc1ck1hz output is stopped after up to 2 clocks (fixed to low level). p. 637 ? for how to set or change the ampm bit, refer to 10.5.4 (1) initialization and 10.5.4 (2) rewriting each counter during clock oper ation. when the ampm bit has been rewritten, re-set the rc1hour register. p. 637 ? to rewrite the ct2 to ct0 bits while the real-time counter is operating (rc1pwr bit = 1), refer to 10.5.4 (4) changing setting of intrtc0 interrupt during clock operation. p. 637 ? rc1cc1 register be sure to set bit 6 to ?0?. p. 637 ? to rewrite the wale bit while the real-time counter is operating (rc1cc0.rc1pwr bit = 1), refer to 10.5.4 (5) changing setting of intrtc1 interrupt during clock operation. p. 638 ? to read or write the value of each counter, confirm that the rwst bit is 1. p. 638 ? even if the rwait bit is set to ?0?, the rwst bit is not set to 0 while each counter is being rewritten. it is set to 0 after writing of each counter has been completed. p. 638 ? rc1cc2 register be sure to set bits 2 to 6 to ?0?. p. 638 ? chapter 10 soft watch timer function rc1cc3 register to rewrite the rinte bit while the real-time counter is operating (rcc1cc0.rc1pwr bit = 1), refer to 10.5.4 (7) changing setting of intrtc2 interrupt during clock operation. p. 639 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1556 (19/54) chapter classification function details of function cautions page the rc1ckdiv output pin operates as follows when the setting of the cloe2 bit is changed. ? when cloe2 bit is changed from 0 to 1: the pulse set by the ckdiv bit is output after up to 2 clocks. ? when cloe2 bit is changed from 1 to 0: output by the rc1ckdiv pin is stopped after up to 2 clocks (fixed to low level). p. 639 ? to rewrite the ict2 to ict0 bits while t he real-time counter is operating (rc1pwr bit = 1), refer to 10.5.4 (7) changing setting of intrtc2 interrupt during clock operation. p. 639 ? rc1cc3 register be sure to set bits 3 and 4 to ?0?. p. 639 ? the value of this register may reach or exc eed 8000h if the time is corrected by using the rc1subu register. p. 640 ? the rc1subc register is also cleared by writing the second count register. p. 640 ? rc1subu register the value of the rc1subc register is not guaranteed if it is read during operation because a value that is changing is read. p. 640 ? rc1sec register setting values other than 00 to 59 to the rc1sec register is prohibited. p. 640 ? rc1min register setting a value other than 00 to 59 to the rc1min register is prohibited. p. 641 ? rc1hour register setting a value other than 01 to 12, 21 to 32 (ampm bit = 0) or 00 to 23 (ampm bit = 1) to the rc1hour register is prohibited. p. 641 ? rc1day register setting a value other than 01 to 31 to the rc1day register is prohibited. in addition, setting outside the above count range, such as ?february 30?, is prohibited. p. 643 ? setting a value other than 00 to 06 to the rc1week register is prohibited. p. 644 ? rc1week register a value corresponding to the month count register and day count register is not always stored automatically in the week count register. p. 644 ? rc1month register setting a value other than 01 to 12 to the rc1month register is prohibited. p. 645 ? rc1year register setting a value other than 00 to 99 to the rc1year register is prohibited. p. 645 ? set a bcd code of 00 to 59 (decimal number) to this register. if a value other than this range is set, the alarm is not detected. p. 647 ? rc1alm register to rewrite the rc1alm register while the real-time counter is operating (rc1cc0.rc1pwr bit = 1), refer to 10.5.4 (5) changing setting of intrtc1 interrupt during clock operation. p. 647 ? set a bcd code of 00 to 23, 01 to 12, or 21 to 32 (decimal number) to this register. if a value other than this range is set, the alarm is not detected. p. 647 ? rc1alh register to rewrite the rc1alh register while the real-time counter is operating (rc1cc0.rc1pwr bit = 1), refer to 10.5.4 (5) changing setting of intrtc1 interrupt during clock operation. p. 647 ? rctalw register to rewrite the rc1alw register while the real-time counter is operating (rc1cc0.rc1pwr bit = 1), refer to 10.5.4 (5) changing setting of intrtc1 interrupt during clock operation. p. 648 ? be sure to confirm that the rwst bit = 0 before entering the stop mode. pp. 650, 651 ? chapter 10 soft watch timer function operation clear the rwait bit to 0 within 1 second. if the rwait bit = 1, the rc1sec to rc1year registers stop operation. if the first carry occurs from the rc1subc register wh ile the rwait bit = 1, it is internally retained. if the second carry or those that follow occur, however, the number of times the carry has occurred cannot be retained. pp. 650, 651 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1557 (20/54) chapter classification function details of function cautions page chapter 10 soft watch timer function operation set rc1cc3.ict2 to ict0 bits and rc1cc3.rinte bit at the same time or set ict2 to ict0 bits first in initialization setting of intrtc2 interrupt. if rinte bit is set first, an unintended waveform of the interrupt may be output. p. 654 ? when watchdog timer 2 is not used or when changing the operation mode, be sure to always set the wdtmd1 bit of the option byte 0000007ah to 0. changing modes with the wdtm2 register when the wdtmd1 bit is set to 1 is invalid. p. 661 ? watchdog timer 2 automatically starts in the reset mode following reset release. when watchdog timer 2 is not used, either st op its operation before reset is executed via this function, or clear watchdog timer 2 once and stop it within the next interval time. also, write to the wdtm2 register for ve rification purposes only once, even if the default settings (reset mode, interval time: f r /2 19 ) do not need to be changed. p. 661 ? default start watchdog timer for the non-maskable interrupt servicing due to a non-maskable interrupt request signal (intwdt2), see 24. 2.2 (2) intwdt2 signal. p. 661 ? accessing the wdtm2 register is prohibit ed in the following statuses. for details, refer to 3.4.9 (2) accessing specif ic on-chip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock p. 663 ? when watchdog timer 2 is not used or when changing the operation mode, be sure to always set the wdtmd1 bit of the option byte 0000007ah to 0. changing modes with the wdtm2 register when the wdtmd1 bit is set to 1 is invalid. p. 664 ? although watchdog timer 2 can be stopped just by stopping the operation of the internal oscillator, clear the wdtm2 register to 00h to securely stop the timer (to avoid selection of the main clock or subclock due to an erroneous write operation). p. 664 ? if the wdtm2 register is rewritten twice af ter reset, an overflow signal is forcibly generated and the counter is reset. p. 664 ? to intentionally generate an overflow signal, write to the wdtm2 register only twice or write a value other than ?ach? to the wdte register once. however, when watchdog timer 2 is set to stop operation, an overflow signal is not generated even if data is written to the wdtm2 register only twice, or a value other than ?ach? is written to the wdte register only once. p. 664 ? to stop the operation of watchdog timer 2, set the rcm.rstop bit to 1 (to stop the internal oscillator) and write 00h in the wdtm2 register. if the rcm.rstop bit cannot be set to 1, set the wdcs23 bit to 1 (2 n /f xp is selected and the clock can be stopped in the idle1, idlw2, sub-idle, and subclock operation modes). however, when the wdtmd1 bit of the option byte 0000007ah (see chapter 33 option byte function) is set to 1, the clock cannot be stopped other than be reset. p. 664 ? be sure to clear bit 7 to ?0?. p. 664 ? wdtm2 register when the wdtmd1 bit of the option byte 0000007ah (see chapter 33 option byte function) is set to 1, the clock is fixed to the internal oscillation clock (f r ) (2 12 /f r to 2 19 /f r selectable). p. 665 ? when a value other than ?ach? is written to the wdte register, an overflow signal is forcibly output. p. 666 ? chapter 11 soft functions of watchdog timer 2 wdte register when a 1-bit memory manipulation instructio n is executed for the wdte register, an overflow signal is forcibly output. p. 666 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1558 (21/54) chapter classification function details of function cautions page to intentionally generate an overflow signal, write to the wdtm2 register only twice or write a value other than ?ach? to the wdte register once. however, when the watchdog timer 2 is set to stop operation, an overflow signal is not generated even if data is written to the wdtm2 register only twice, or a value other than ?ach? is written to the wdte register only once. p. 666 ? chapter 11 soft functions of watchdog timer 2 wdte register the read value of the wdte register is ?9ah? (which differs from written value ?ach?). p. 666 ? when writing to bits 6 and 7 of the rtbhn register, always write 0. p. 670 ? rtbln, rtbhn registers accessing the rtbln and rtbhn registers is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing sp ecific on-chip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock p. 670 ? if real-time output is disabled (rtpoen bit = 0), the real-time output pins (rtpn0 to rtpn5) all output 0, regardless of the rtpmn register setting. p. 671 ? rtpmn register be sure to set bits 6 and 7 to ?0?. p. 671 ? rtpcn register set the rtpegn, byten, and extrn bits only when rtpoen bit = 0. p. 672 ? preventing conflicts prevent the following conflicts by software. ? conflict between real-time output disabl e/enable switching (rtpoen bit) and selected real-time output trigger. ? conflict between writing to the rtbhn and rtbln registers in the real-time output enabled status and the selected real-time output trigger. p. 674 ? initialization before performing initialization, disable real-time output (rtpoen bit = 0). p. 674 ? chapter 12 soft real-time output function (rto) if real-time output has been disabled once real-time output has been disabled (rtp oen bit = 0), be sure to initialize the rtbhn and rtbln registers before enabling real-time output again (rtpoen bit = 0 1). p. 674 ? hard ani0 to ani15 pin make sure that the voltages input to the ani0 to ani15 pins do not exceed the rated values. in particular if a voltage of av ref0 or higher is input to a channel, the conversion value of that channel becomes undefined, and the conversion values of the other channels may also be affected. p. 678 ? ada0m0, ada0crn, ada0crnh register accessing the ada0m0, ada0crn, or ada0crnh register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-chip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock pp. 679, 686 ? changing the ada0m1 register is prohi bited while a/d conversion is enabled (ada0ce bit = 1). p. 680 ? in the following modes, write data to the ada0m0, ada0m2, ada0s, ada0pfm, and ada0pft registers while a/d conversion is stopped (ada0ce bit = 0), and then enable the a/d conversion ope ration (ada0ce bit = 1). ? normal conversion mode ? one-shot select mode/one-shot sca n mode of high-speed conversion mode p. 680 ? ada0m0 register to select the external trigger mode/time r trigger mode (ada0tmd bit = 1), set the high-speed conversion mode (ada0m1.ada0hs 1 bit = 1). do not input a trigger during stabilization time that is inserted once after the a/d conversion operation is enabled (ada0ce bit = 1). p. 680 ? chapter 13 soft a/d converter ada0m1 register changing the ada0m1 register is prohi bited while a/d conversion is enabled (ada0m0.ada0ce bit = 1). p. 681 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1559 (22/54) chapter classification function details of function cautions page to select the external trigger mode/time r trigger mode (ada0m0.ada0tmd bit = 1), set the high-speed conversion mode (ada0m 1.ada0hs1 bit = 1). do not input a trigger during stabilization time that is inserted only once after the a/d conversion operation is enabled (ada0ce bit = 1). p. 681 ? be sure to clear bits 6 to 4 to ?0?. p. 681 ? ada0m1 register set as 2.6 s conversion time 10.4 s. pp. 682, 683 ? in the following modes, write data to the ada0m2 register while a/d conversion is stopped (ada0m0.ada0ce bit = 0), and then enable the a/d conversion operation (ada0ce bit = 1). ? normal conversion mode ? one-shot select mode/one-shot scan m ode of the high-speed conversion mode p. 684 ? ada0m2 register be sure to clear bits 7 to 2 to ?0?. p. 684 ? in the following modes, write data to the ada0s register while a/d conversion is stopped (ada0m0.ada0ce bit = 0), and then enable the a/d conversion operation (ada0ce bit = 1). ? normal conversion mode ? one-shot select mode/one-shot scan m ode of the high-speed conversion mode p. 685 ? ada0s register be sure to clear bits 7 to 4 to ?0?. p. 685 ? ada0crn, ada0crnh registers a write operation to the ada0m0 and ada0s registers may cause the contents of the ada0crn register to become undefined. a fter the conversion, read the conversion result before writing to the ada0m0 and ad a0s registers. correct conversion results may not be read if a sequence other than the above is used. p. 686 ? in the following modes, write data to the ad a0pfm register while a/d conversion is stopped (ada0m0.ada0ce bit = 0), and then enable the a/d conversion operation (ada0ce bit = 1). ? normal conversion mode ? one-shot select mode/one-shot scan m ode of the high-speed conversion mode p. 688 ? ada0pfm register be sure to set bits 0 to 5 to ?0?. p. 688 ? ada0pft register in the following modes, write data to the ad a0pft register while a/d conversion is stopped (ada0m0.ada0ce bit = 0), and then enable the a/d conversion operation (ada0ce bit = 1). ? normal conversion mode ? one-shot select mode/one-shot scan m ode of the high-speed conversion mode p. 689 ? external trigger mode to select the external trigger mode, se t the high-speed conversion mode. do not input a trigger during stabilization time that is inserted once after the a/d conversion operation is enabled (ada0m0.ada0ce bit = 1). p. 692 ? timer trigger mode to select the timer trigger mode, set the high-speed conversion mode. do not input a trigger during stabilization time that is inserted once after the a/d conversion operation is enabled (ada0m0.ada0ce bit = 1). p. 693 ? chapter 13 soft a/d converter input range of ani0 to ani15 pins input the voltage within the specified range to the ani0 to ani15 pins. if a voltage equal to or higher than av ref0 or equal to or lower than av ss (even within the range of the absolute maximum ratings) is input to any of these pins, the conversion value of that channel is undefined, and the conver sion value of the other channels may also be affected. p. 703 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1560 (23/54) chapter classification function details of function cautions page countermeasures against noise to maintain the 10-bit resolution, the ani0 to ani15 pins must be effectively protected from noise. the influence of noise increases as the output impedance of the analog input source becomes higher. to lower the noise, connecting an external capacitor is recommended. p. 703 ? hard alternate i/o the analog input (ani0 to ani15) pins are multiplexed wi th port pins. the av ref0 power pin is multiplexed with the reference power supply to the a/d converter and the i/o buffer power supply of port 7. if any of the processings described in 13.6 (4) (a) to (c) is performed during a/d conversion, therefore, the expected a/d conversion value may not be obtained. p. 704 ? soft interrupt request flag (adif) the interrupt request flag (adif) is not cleared even if the contents of the ada0s register are changed. if the analog input pin is changed during a/d conversion, therefore, the result of converting the previously selected analog input signal may be stored and the conversion end interrupt r equest flag may be set immediately before the ada0s register is rewritten. if the ad if flag is read immediately after the ada0s register is rewritten, the adif flag may be set even though the a/d conversion of the newly selected analog input pin has not b een completed. when a/d conversion is stopped, clear the adif flag before resuming conversion. p. 705 ? the av ref0 pin is used as the power supply pin of the a/d converter and also supplies power to the alternate-function ports. in an application where a backup power supply is used, be sure to supply the same voltage as v dd to the av ref0 pin. p. 706 ? the av ref0 pin is also used as the reference voltage pin of the a/d converter. if the source supplying power to the av ref0 pin has a high impedance or if the power supply has a low current supply capability, the reference voltage may fluctuate due to the current that flows during conversion (esp ecially, immediately after the conversion operation enable bit ada0ce has been set to 1). as a result, the conversion accuracy may drop. to avoid this, it is recommended to connect a capacitor across the av ref0 and av ss pins to suppress the reference voltage fluctuation as shown in figure 13-15. p. 706 ? hard av ref0 pin if the source supplying power to the av ref0 pin has a high dc resistance (for example, because of insertion of a diode), the voltage when conversion is enabled may be lower than the voltage when conversion is stopped, because of a voltage drop caused by the a/d conversion current. p. 706 ? chapter 13 soft a/d converter reading ada0crn register when the ada0m0 to ada0m2, ada0s, ada0pf m, or ada0pft register is written, the contents of the ada0crn register may be undefined. read the conversion result after completion of conversion and before writing to the ada0m0 to ada0m2, ada0s, ada0pfm, or ada0pft register. also, when an exter nal/timer trigger is acknowledged, the contents of the ada0crn register may be undefined. read the conversion result after completion of conversion and before the next external/timer trigger is acknowledged. the correct conver sion result may not be read at a timing different from the above. p. 706 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1561 (24/54) chapter classification function details of function cautions page standby mode because the a/d converter stops operating in the stop mode, conversion results are invalid, so power consumption can be reduced. operations are resumed after the stop mode is released, but the a/d conversion results after the stop mode is released are invalid. when using the a/d converter after the stop mode is released, before setting the stop mode or releasing the stop mode, clear the ada0m0.ada0ce bit to 0 then set the ada0ce bit to 1 after releasing the stop mode. in the idle1, idle2, or subclock operation mode, operation continues. to lower the power consumption, therefore, clear the ada0m0.ada0ce bit to 0. in the idle1 and idle2 modes, since the analog input voltage value cannot be retained, the a/d conversion results after the idle1 and idle2 modes are released are invalid. the results of conversions before the idle1 and idle2 modes were set are valid. p. 706 ? restriction for each mode to select the external trigger mode/timer trigger mode, set the high-speed conversion mode. do not input a trigger during stabilizat ion time that is inserted once after the a/d conversion operation is ena bled (ada0m0.ada0ce bit = 1). p. 707 ? soft variation of a/d conversion results the results of the a/d conversion may vary depending on the fluctuation of the supply voltage, or may be affected by noise. to reduce the variation, take counteractive measures with the program such as averaging the a/d conversion results. p. 707 ? chapter 13 hard a/d converter a/d conversion result hysteresis characteristics the successive comparison type a/d conv erter holds the analog input voltage in the internal sample & hold capacitor and then performs a/d conversion. after the a/d conversion has finished, the analog input volt age remains in the internal sample & hold capacitor. as a resul t, the following phenomena may occur. ? when the same channel is used for a/d conversions, if the voltage is higher or lower than the previous a/d conversion, then hysteresis characteristics may appear where the conversion result is affected by the previous value. thus, even if the conversion is performed at the same potential, the result may vary. ? when switching the analog input channel, hysteresis characteristics may appear where the conversion result is affected by the previous channel value. this is because one a/d converter is used for the a/d conversions. thus, even if the conversion is performed at the same potential, the result may vary. p. 707 ? da0m register be sure to set bits 2, 3, 6, and 7 to ?0?. p. 713 ? da0cs0, da0cs1 registers in the real-time output mode (da0m.da0mdn bit = 1), set the da0csn register before the inttp2cc0/inttp3cc0 signals are generated. d/a conversion starts when the inttp2cc0/inttp3cc0 signals are generated. p. 714 ? do not change the set value of the da0csn register while the trigger signal is being issued in the real-time output mode. p. 716 ? before changing the operation mode, be sure to clear the da0m.da0cen bit to 0. p. 716 ? soft when using one of the p10/an00 and p11/an01 pins as an i/o port and the other as a d/a output pin, do so in an application where the port i/o level does not change during d/a output. p. 716 ? make sure that av ref0 = v dd = av ref1 = 3.0 to 3.6 v. p. 716 ? apply and cut power to av ref1 at the same timing as av ref0 . p. 716 ? hard no current can be output from the anon pin (n = 0, 1) because the output impedance of the d/a converter is high. when connecting a resistor of 2 m or less, insert a jfet input operational amplifier betw een the resistor and the anon pin. p. 716 ? chapter 14 soft d/a converter cautions because the d/a converter stops operation in the stop mode, the ano0 and ano1 pins go into a high-impedance state, and the power consumption can be reduced. in the idle1, idle2, or subclock operati on mode, however, the operation continues. to lower the power consumption, theref ore, clear the da0m.da0cen bit to 0. p. 716 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1562 (25/54) chapter classification function details of function cautions page port settings during operation do not switch port settings during operation. also, be sure to disable operation of unused units for which port settings are not made. pp. 718, 720 ? ua0opt0 to ua0opt5 registers do not set the uansrt and uanstt bits (t o 1) during sbf reception (uansrf bit = 1). p. 727 ? be sure to read the error flags of the uanpe, uanfe, and uanove bits to check the flag status, and then clear the flags by writing ?0? to them. p. 729 ? ua0str to ua5str register be sure to set bits 3 to 6 to ?0?. p. 730 sbf reception the lin function does not assume that sbf is transmitted while data is being received. consequently, if sbf is transmi tted while data is being received, a framing error occurs (uanstr.uanfe bit = 1). p. 738 ? continuous transmission procedure when initializing transmissions during the execution of continuous transmissions, make sure that the uanstr.uantsf bit is 0, then perform the initialization. transmit data that is initialized when the uant sf bit is 1 cannot be guaranteed. p. 740 ? be sure to read the uanrx register even when a reception error occurs. if the uanrx register is not read, an overrun error occurs during reception of the next data, and reception errors continue occurring indefinitely. p. 742 ? when reception is completed, read the uanrx register after the reception completion interrupt request signal (intuanr) has been generated, and clear the uanpwr or uanrxe bit to 0. if the uanpwr or uanrxe bit is cleared to 0 before the intuanr signal is generated, the read value of the uanrx register cannot be guaranteed. p. 742 ? uart reception if receive completion processing (intuanr signal generation) of uartan and the uanpwr bit = 0 or uanrxe bit = 0 conflict, the intuanr signal may be generated in spite of these being no data stored in the uanrx register. to complete reception without waiting in tuanr signal generation, be sure to clear (0) the interrupt request flag (uanrif) of the uanric register, after setting (1) the interrupt mask flag (uanrmk) of the interrupt control register (uanric) and then set (1) the uanpwr bit = 0 or uanrxe bit = 0. p. 742 ? when an intuanr signal is generated, the uanstr register must be read to check for errors. p. 743 ? reception errors if a receive error interrupt occurs during c ontinuous reception, read the contents of the uanstr register must be read befor e the next reception is completed, then perform error processing. p. 744 ? lin function when using the lin function, fix the uanps1 and uanps0 bits of the uanctl0 register to 00. p. 745 ? baud rate generator configuration uartan cannot be used if the cpu clock (f cpu ) is slower than f uclk . p. 747 ? ua0ctl1 to ua5ctl1 register clear the uanctl0.uanpwr bit to 0 before rewriting the uanctl1 register. p. 749 ? ua0ctl2 to ua5ctl2 register clear the uanctl0.uanpwr bit to 0 or clear the uantxe and uanrxe bits to 00 before rewriting the uanctl2 register. p. 750 ? chapter 15 soft asynchronous serial interface a (uarta) baud rate error the baud rate error during transmission must be within the error tolerance on the receiving side. p. 752 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1563 (26/54) chapter classification function details of function cautions page baud rate error the baud rate error during reception must satisfy the range indicated in (5) allowable baud rate range during reception. p. 752 ? when the clock supply to uartan is stopped when the clock supply to uartan is stopped (for example, in idle1, idle2, or stop mode), the operation stops with each register retaining the value it had immediately before the clock supply was stopped. the txdan pin output also holds and outputs the value it had immediately before the clock supply was stopped. however, the operation is not guaranteed after the clock supply is resumed. therefore, after the clock supply is resu med, the circuits should be initialized by setting the uanctl0.uanpwr, uanctl0.uanrxen, and uanctl0.uantxen bits to 000. p. 757 ? rxda1 pin kr7 pin the rxda1 and kr7 pins must not be used at the same time. in the v850e/sk3-h, the rxda1 and kr7 pins are assigned to two ports each, and cannot be used at the same time at different ports. to use the rxda1 pin, set the krm.krm7 bit of the kr7 pin to 0. to use the kr7 pin, set the ua1ctl0.ua1rxe bit to 0 (it is recommended to set the pfc91 bit to 1 and pfce91 bit to 0 when using the kr7 pin at p91). p. 757 ? error during dma transfer in uartan, the interrupt caused by a communication error does not occur. when performing the transfer of transmit data and receive data using dma transfer, error processing cannot be performed even if errors (parity, overrun, framing) occur during transfer. either read the uanstr register after dma transfer has been completed to make sure that there are no errors, or read the uanstr register during communication to check for errors. p. 757 ? uartan startup sequence start up the uartan in the following sequence. <1> set the uanctl0.uanpwr bit to 1. <2> set the ports. <3> set the uanctl0.uantxe bit to 1, uanctl0.uanrxe bit to 1. p. 757 ? uartan stop sequence stop the uartan in the following sequence. <1> set the uanctl0.uantxe bit to 0, uanctl0.uanrxe bit to 0. <2> set the ports and set the uanctl0.uanpwr bit to 0 (it is not a problem if port setting is not changed). p. 757 ? writing the same value to the uantx register in transmit mode in transmit mode (uanctl0.uanpwr bit = 1 and uanctl0.uantxe bit = 1), do not overwrite the same value to the uantx r egister by software because transmission starts by writing to this register. to transmit the same value continuously, overwrite the same value. p. 757 ? continuous transmission in continuous transmission, the communication rate from the stop bit to the next start bit is extended 2 base clocks mo re than usual. however, the reception side initializes the timing by detecting the start bit, so the reception result is not affected. p. 757 ? (a) switching dma transfer start factor between intua1r and intiic2 signals setting the dma transfer start factor to other than the combinations described in 15.8 (8) (a) <1> to <3> is prohibited. for details, see table 22-1 dma transfer start factors. p. 758 ? chapter 15 soft asynchronous serial interface a (uarta) switching dma transfer start factor (b) switching dma transfer start factor between intua2r and intiic0 signals setting the dma transfer start factor to other than the combinations described in 15.8 (8) (b) <1> to <3> is prohibited. for details, see table 22-1 dma transfer start factors. p. 758 ? chapter 16 soft asynchronous serial interface b (uartb) ub0ctl0 and ub1ctl0 registers when using uartbn, set the external pins related to the uartbn function in the alternate-function mode, set uartbn control register 2 (ubnctl2). then set the ubnpwr bit to 1 before setting the other bits. p. 764 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1564 (27/54) chapter classification function details of function cautions page ub0ctl0 and ub1ctl0 registers be sure to input a high level to the rxdbn pin when setting the external pins related to the uartbn function in the alternate-function mode. if a low level is input, it is judged that a falling edge is input after the ubnrxe bit has been set to 1, and reception may be started. p. 764 ? ub0str and ub1str registers be sure to set bits 4 to 6 to ?0?. p. 768 ? ub0ctl2 and ub1ctl2 registers when rewriting the ubnbrs15 to ubnbrs 0 bits of this register, set the ubnctl0.ubntxe and ubnctl0.ubnrxe bits to 0 or clear the ubnctl0.ubnpwr bit to 0. p. 770 ? ub0tx and ub1tx, ub0rxap and ub1rxap, ub0rx and ub1rx, ub0fis0, and ub1fis0, ub0fis1, and ub1fis1 registers accessing the ubntx, ubnrxap, ubnrx, ubnfis0, or ubnfis1 register is prohibited in the following statuses. for deta ils, refer to 3.4.9 (2 ) accessing specific on-chip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock pp. 771, 772, 781, 782 ? ub0rxap, ub1rxap, ub0rx, ub1rx registers when no reception error has occurred in the fifo mode, the receive data of the ubnrxap register can be read successively by reading the lower 8 bits of the ubnrxap register in 8-bit (byte) units. an 8-bit access to the higher 8 bits is prohibited. if they are accessed, the operation is not guaranteed. p. 772 ? ub0fic0, ub1fic0 registers after transmit fifon is cleared (ubntfc bit = 1), accessing the registers related to uartbn is prohibited for the duration of four cycles of f xp or until clearing the ubntfc bit (automatic recovery) is conf irmed by reading the ubnfic0 register. if these registers are accessed, the operation is not guaranteed. p. 775 ? be sure to select the single mode when writing a transmit data or reading a received data by using the dma control. in fifo mode, the use of the dma control is prohibited. p. 775 ? be sure to set bits 4 to 6 to ?0?. p. 775 ? ub0fic0, ub1fic0 registers after receive fifon (ubnrxap) is cleared (ubnrfc bit = 1), accessing the registers related to uartbn is prohibited for the duration of four cycles of f xp or until clearing the ubnrfc bit (automatic recovery) is co nfirmed by reading the ubnfic0 register. if these registers are accessed, the operation is not guaranteed. p. 776 ? ub0fic1 and ub1fic1 registers be sure to set bits 5 and 6 to ?0?. p. 778 ? be sure to set the ubnctl0.ubntxe bit (to disable transmission) and ubnctl0.ubnrxe bit (to disable reception) to 0 before writing data to the ubnfic2 register. if data is written to the ubnfic2 register with the ubntxe or ubnrxe bit set to 1, the operation is not guaranteed. p. 779 ? ub0fic2 and ub1fic2 registers be sure to set bits 4 to 7 and 12 to 15 to ?0?. p. 779 ? chapter 16 soft asynchronous serial interface b (uartb) ub0fis1 and ub1fis1 registers the values of the ubntb4 to ubntb0 bits are reflected after transmit data has been written to the ubntx register and then time of two cycles of f xp has passed. therefore, care must be exercised when referencing the ubnfis1 register after transmit data has been written to the ubntx register. p. 782 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1565 (28/54) chapter classification function details of function cautions page fifo transmission completion interrupt request signal (intubntif) if the fifo transmission completion interrupt request signal is generated (all transmit data are not transmitted) because writing the next transmit data to transmit fifon is delayed, do not clear the fifo. p. 785 ? single mode/ fifo mode be sure to select the single mode when writing a transmit data or reading a received data by using the dma control. in fifo mode, the use of the dma control is prohibited. p. 787 ? transmit operation setting the ubnctl0.ubntxe bit to 1 before writing transmit data to transmit fifon in the fifo mode is prohibited. the operati on is not guaranteed if this setting is made. p. 792 ? be sure to check whether the transmission has been completed before performing initialization during the trans mission processing (ubnstr.ub ntsf bit = 0, but it can be checked by the generation of the fifo transmission completion interrupt request signal (intubntif) in the fifo mode.) p. 795 ? continuous transmission operation be sure to select the single mode when writing a transmit data or reading a received data by using the dma control. in fifo mode, the use of the dma control is prohibited. pp. 795, 818 ? if the pointer mode is specified in the fifo mode and if as many data as the number of bytes stored in receive fifon are read by referencing the ubnfis0 register, no data may be stored in receive fifon (ubnfis0.ubnrb4 to ubnfis0.ubnrb0 bits = 00000) even though the reception completion interrupt request signal (intubntir) has occurred. in this case, do not read data from receive fifon. be sure to read data from receive fifon after confirming that the number of bytes stored in receive fifon = 1 byte or more (ubnrb4 to ubnrb0 bits = other than 00000). pp. 796, 819 ? receive operation be sure to select the single mode when reading a received data by using the dma control. in fifo mode, use of the dma control is prohibited. pp. 796, 818 ? reception completion interrupt request signal (intubntir) be sure to read all the data (the number of data indicated by the ubnfis0.ubnrb4 to ubnfis0.ubnrb0 bits) stored in the receive data register n (ubnrx register in the single mode or receive fifon in the fifo mode (ubnrxap register)) even when a reception error occurs. unless the receive data register is read, an overrun error occurs when the next data is received, causi ng the reception error status to persist. if the pending mode is specified in the fifo mode, however, be sure to clear the fifo (ubnfic0.ubnrfc bit = 1) after reading the data stored in receive fifon. in the fifo mode, the fifo can be cleared even without reading the data stored in receive fifon. if a parity error or framing error occurs in the fifo mode, the ubnrxap register can be read in 16-bit (halfword) units. p. 798 ? make sure that the baud rate error during transmission does not exceed the allowable error of the reception destination. p. 804 ? baud rate error make sure that the baud rate error during reception is within the allowable baud rate range during reception, which is described in paragraph (4). pp. 804 , 806 ? chapter 16 soft asynchronous serial interface b (uartb) example of reception error processing flow in fifo mode reception can be continued by completing this control flow before reception of the next data is completed. extract the receive data and check if a reception error has occurred before receive fifon becomes empty. note that this control flow is valid only when a parity error or a framing error o ccurs. if an overflow error occurs, receive fifon must be cleared (ubnfic0.ubnrfc bit = 1). if the next data is received before this c ontrol flow is completed, a reception error interrupt request signal (intubntire) may occur even if the data has been received correctly. p. 817 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1566 (29/54) chapter classification function details of function cautions page when supply clock to uartbn is stopped when the supply of clocks to uartbn is stopped (for example, idle and stop modes), operation stops with each register retaining the value it had immediately before the supply of clocks was stopped. the txdbn pin output also holds and outputs the value it had immediately before the supply of clocks was stopped. however, operation is not guaranteed after the supply of clocks is restarted. therefore, after the supply of clocks is re started, the circuits should be initialized by setting the ubnpwr bit = 0, ubnrxe bit = 0, and ubntxe bit = 0. p. 818 ? initialization during continuous transmission in single mode and during continuous transmission (pending mode/pointer mode) in fifo mode confirm that the ubnstr.ubntsf bit is 0 before executing initialization during transmission processing. (initializati on during continuous transmission (pending mode/pointer mode) in fifo mode this can also be done by checking the fifo transmission completion interrupt request si gnal (intubntif)). if initialization is executed while the ubntsf bit is 1, the transmit data is not guaranteed. pp. 818, 819 ? chapter 16 soft asynchronous serial interface b (uartb) switching dma transfer start factor in the v850e/sj3-h and v850e/sk3-h, the intub0tir and inttq0ov signals, intub0tit and inttp0ov signals, intub1tir and inttp1ov signals, and intub1tit and inttp2ov signals, which are the dma transfer start factors, share the same pin, respectively, and they cannot be used at the same time. to use the intub0tir, intub0tit, intub1tir, or intub1tit signal as the dma transfer start factor, set the option byte (0000007ah) (see chapter 33 option byte function) dtfrob0 bit = 1. in this case, the inttq0ov, inttp0ov, inttp1ov, and inttp2ov signals cannot be used as the dma transfer start factor. for details, see table 22-1 dma transfer start factors. p. 819 ? port settings during operation do not switch port settings during operation. also, be sure to disable operation of unused units for which port settings are not made. pp. 821, 823 ? to forcibly suspend transmission/reception, clear the cbnpwr bit instead of the cbntxe and cbnrxe bits to 0. at this time, the clock output is stopped. p. 828 ? cb0ctl0 to cb5ctl0 registers be sure to set bits 3 and 2 to ?0?. p. 828 ? cb0ctl1 to cb5ctl1 registers the cbnctl1 register can be rewritten only when the cbnctl0.cbnpwr bit = 0. p. 831 ? cb0ctl1 to cb5ctl1 registers the cbnctl2 register can be rewritten only when the cbnctl0.cbnpwr bit = 0 or when both the cbntxe and cbnrxe bits = 0. p. 833 ? cb0str to cb5str registers in single transfer mode, writing to the cbntx register with the cbntsf bit set to 1 is ignored. this has no influence on the operation during transfer. p. 835 ? continuous transfer mode (master mode, transmission mode) in continuous transmission mode, the rec eption completion interrupt request signal (intcbnr) is not generated. p. 853 ? chapter 17 soft 3-wire variable- length serial i/o b (csib) continuous transfer mode (slave mode, transmission mode) in continuous transmission mode, the rec eption completion interrupt request signal (intcbnr) is not generated. p. 862 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1567 (30/54) chapter classification function details of function cautions page clock timing in single transfer mode, writing to the cbntx register with the cbntsf bit set to 1 is ignored. this has no influence on the operation during transfer. pp. 871, 872 ? do not rewrite the prsmm register during operation. p. 875 ? set the prsmm register before setting the bgcem bit to 1. p. 875 ? prsm1 to prsm3 registers be sure to set bits 2, 3, and 5 to 7 to ?0?. p. 875 ? do not rewrite the prscmm register during operation. p. 876 ? prscm1 to prscm3 registers set the prscmm register before setting the prsmm.bgcem bit to 1. p. 876 ? baud rate generation set f brgm to 8 mhz or lower. p. 876 ? when transferring transmit data and receive data using dma transfer when transferring transmit data and receiv e data using dma transfer, error processing cannot be performed even if an over run error occurs during serial transfer. check that the no overrun error has oc curred by reading the cbnstr.cbnove bit after dma transfer has been completed. p. 877 ? cbnctl0 to cbnctl2 registers in regards to registers that are forbi dden from being rewritten during operations (cbnctl0.cbnpwr bit is 1), if rewriting has been carried out by mistake during operations, set the cbnctl0.cbnpwr bit to 0 once, then initialize csibn. registers to which rewriting during oper ation are prohibit ed are shown below. ? cbnctl0 register: cbntxe, cb nrxe, cbndir, cbntms bits ? cbnctl1 register: cbnckp, cbndap, cbncks2 to cbncks0 bits ? cbnctl2 register: cbncl3 to cbncl0 bits p. 877 ? chapter 17 soft 3-wire variable- length serial i/o b (csib) communication type 2 or 4 when using the single transfer mode with communication type 2 or 4 (cbndap bit = 1), pay particular attention to the following. ? to start the next transmission, confir m that cbntsf bit = 0 and then write the transmit data to the cbntx register. ? to perform the next reception continuous ly when reception-only communication (cbntxe bit = 0, cbnrxe bit = 1) is set, confirm that cbntsf bit = 0 and then read the cbnrx register. or, use the continuous transfer mode instead of the single transfer mode. use of the continuous transfer mode is recommended especially when using dma. p. 877 ? port settings during operation do not switch port settings during operation. be sure to disable operation of the unit which does not perform the port setting and is not being used. p. 879 ? ce0rx0, ce1rx0 registers because the values of the cenflf, cene mf, centsf, censfp3 to censfp0 bits may change at any time during transfer, thei r values during transfer may differ from the actual values. especially, use the cent sf bit independently (do not use this bit in relation with the other bits). to detect t he end of transfer by the censtr register, check to see if the cenemf bit is 1 after the data to be transferred has been written to the csibufn register. p. 883 ? ce0tx0, ce1tx0, ce0ctl0, ce1ctl0, ce0str, ce1str registers accessing the centx0, cenctl0, or censtr register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-chip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock pp. 884, 886, 892 ? chapter 18 soft 3-wire variable- length serial i/o e (csie) ce0ctl0, ce1ctl0 registers be sure to clear bits 0 and 1 to ?0?. p. 886 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1568 (31/54) chapter classification function details of function cautions page ce0ctl2, ce1ctl2 registers be sure to clear bits 7 to 4 to ?0?. p. 890 ? ce0ctl3, ce1ctl3 registers be sure to clear bits 7 to 4 to ?0?. p. 891 ? ce0str, ce1str registers because the values of the cenflf, cene mf, centsf, censfp3 to censfp0 bits may change at any time during transfer, thei r values during transfer may differ from the actual values. especially, use the cent sf bit independently (do not use this bit in relation with the other bits). to detect t he end of transfer by the censtr register, check to see if the cenemf bit is 1 after the data to be transferred has been written to the csibufn register. p. 892 ? baud rate if the cenctl1.cencks2 to cenctl1.ce ncks0 bits are cleared to 000, setting the cenctl1.cenmdl2 to cenctl1.cenm dl0 bits to 001 is prohibited. p. 896 ? single mode be sure to confirm that the censtr.c enflf register is 0 when writing data to the centx0 register. even if data is written to this register when cenflf bit is 1, the csibufn overflow interrupt (intcentiof) is output, and the written data is ignored. pp. 908, 925 ? continuous mode the censtr register is in the same status when transfer data is written (before start of transfer) after the csibufn pointer is cleared (censtr.cenpct bit = 1) and when 16 data have been transferred (censtr.cenflf bit = 0, censtr.cenemf bit = 1, censtr.censfp3 to censtr.censfp0 bits = 0000). pp. 911, 925 ? delay control of transmission/ reception completion interrupt (intcent) if the cenctl0.censit bit is set to 1 in the continuous mode (cenctl0.centms bit = 1), the intcent interrupt is not output at the end of data other than the last data set by the cenctl3.censfn3 to cenctl3.censfn0 bits, but a delay of half a clock (1/2 serial clock) can be inserted between each data transfer. p. 915 ? scken pin output if the cenckp bit is set to 1 in the master mode (cencks2 to cencks0 bits are other than 111), the scken pin outputs a low level when it is inactive. if the cenctl0.centxe bit is cleared to 0 (d isabling transmission) and cenrxe bit is cleared to 0 (disabling reception), the scken pin outputs a high level. therefore, take the measures described in <1> to <7> in the caution of table 18-9 to fix the scken pin to low level when csien is not used. because the register set values <1> and <2 > are retained, control can be performed only by <3> to <7>bonce they have been set. p. 916 ? stopping csien the csien unit is reset and csien is stopped when the cenctl0.cenpwr bit is cleared to 0. to operate csien, first set the cenpwr bit to 1. usually, before clearing the cenpwr bit to 0, clear both the centxe and cenrxe bits to 0 (after the end of transfer). p. 925 ? chapter 18 soft 3-wire variable- length serial i/o e (csie) enabling transfer be sure to write 1 to the censtr .cenpct bit to clear all the csibufn pointers to 0 before enabling transfer by setting the cenct l0.cenpwr bits to 1. if the centxe or cenrxe bit is set to 1 without clearing the pointers, and if the previously transferred data remains in the csibufn register, transf erring that data is immediately started. if transfer data is set to the csibufn register before transfer is enabled, transfer is started as soon as the centxe or cenrxe bit is set to 1. p. 925 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1569 (32/54) chapter classification function details of function cautions page caution on cenctl0 register setting be sure to set the port pins related to the csien function to the alternate-function mode before using csien. then set the cenpwr bit to 1 before setting the other bits. p. 925 ? chapter 18 soft 3-wire variable- length serial i/o e (csie) switching dma transfer start factor in the v850e/sj3-h and v850e/sk3-h, dma transfer start factor signals intce0t and interr are shared and cannot be used at the same time. this is also the case for dma transfer start factor signals intc e1t and intsta. when using the intce0t or intce1t signal as the dma transfer star t factor, set the dtfrob0 bit to 1 using the option byte 0000007ah (refer to chapter 33 option byte function for details). in this case, the interr and intsta signals cannot be used as dma transfer start factors. for details, see table 22-1 dma transfer start factors. p. 925 ? i 2 c bus set pins to n-ch open-drain output. p. 926 ? port settings during operation do not switch port settings during operation. also, be sure to disable operation of unused units for which port settings are not made. pp. 928, 930 ? iicc0 to iicc5 registers after enabling the i 2 cn operation (iicen bit = 1), immediately set the lreln bit to 1 with a bit manipulation instruction. p. 937 ? iics0 to iics5 registers accessing the iicsn register is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-chip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock p. 941 ? write the stcenn bit only when operation is stopped (iicen bit = 0). p. 945 ? iicf0 to iicf5 registers when the stcenn bit = 1, the bus released status (iicbsyn bit = 0) is recognized regardless of the actual bus status immediately after the i 2 cn bus operation is enabled. therefore, to issue the first start condition (sttn bit = 1), it is necessary to confirm that the bus has been released, so as to not disturb other communications. p. 945 ? iiccl0 to iiccl5 registers be sure to set bits 7 and 6 of iiccln to 0. p. 946 ? status during arbitration and interrupt request signal generation timing when there is a possibility that arbitration will occur, set the spien bit to 1 for master device operation. p. 990 ? when iicfn.stcenn bit = 0 immediately after the i 2 c0n operation is enabled, the bus communication status (iicfn.iicbsyn bit = 1) is recognized regardles s of the actual bus status. to execute master communication in the status where a stop condition has not been detected, generate a stop condition and then release the bus before starting the master communication. use the following sequence for generating a stop condition. <1> set the iiccln register. <2> set the iiccn.iicen bit. <3> set the iiccn.sptn bit. p. 996 ? chapter 19 soft i 2 c bus when iicfn.stcenn bit = 1 immediately after i 2 c0n operation is enabled, the bus released status (iicbsyn bit = 0) is recognized regardless of the actual bus status. to generate the first start condition (iiccn.sttn bit = 1), it is neces sary to confirm that the bus has been released, so as to not disturb other communications. p. 996 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1570 (33/54) chapter classification function details of function cautions page while communications with other devices are in progress when the iiccn.iicen bit of the v850e/sj3-h, v850e/sk3-h is set to 1 while communications with other devices are in progress, the start condition may be detected depending on the status of the communication line. be sure to set the iiccn.iicen bit to 1 when the scl0n and sda0n lines are high level. p. 996 ? setting operation clock frequency determine the operation cloc k frequency by the iiccln, iicxn, and ocksm registers before enabling the operation (iiccn.iicen bit = 1). to change the operation clock frequency, clear the iiccn.iicen bit to 0 once. p. 996 ? iiccn.sttn, sptn bit after the iiccn.sttn and iiccn.sptn bits have been set to 1, they must not be re- set without being cleared to 0 first. p. 996 ? transmission reservation if transmission has been reserved, set the iiccn.spien bit to 1 so that an interrupt request is generated by the detection of a st op condition. after an interrupt request has been generated, the wait state will be released by writing communication data to i 2 cn, then transferring w ill begin. if an interrupt is not g enerated by the detection of a stop condition, transmission will halt in the wait state because an interrupt request was not generated. however, it is not necessary to set the spien bit to 1 for the software to detect the iicsn.mstsn bit. p. 996 ? switching dma transfer start factor between intua1r and intiic2 signals setting the dma transfer start factor to other than the specified combinations is prohibited. for details, refer to 19.15 (7) (a) <1> to <3>. for details, see table 22-1 dma transfer start factors. p. 997 ? switching dma transfer start factor between intua2r and intiic0 signals setting the dma transfer start factor to other than the specified combinations is prohibited. for details, refer to 19.15 (7) (b) <1> to <3>. for details, see table 22-1 dma transfer start factors. p. 997 ? chapter 19 soft i 2 c bus master operation in single master system release the i 2 c0n bus (scl0n, sda0n pins = high level) in conformity with the specifications of the product in communication. for example, when the eeprom outputs a low level to the sda0n pin, set the scl0n pin to the output port and output clock pulses from that output port until when the sda0n pin is constantly high level. p. 999 ? effective transfer rate different modes (mode 1, mode 2) must not be mixed on one iebus. p. 1014 ? data field do not operate master reception in broadcast communication, because the slave unit cannot be defined and data transfer cannot be performed correctly. p. 1024 ? chapter 20 soft iebus controller bcr register while iebus is operating as the mast er, writing to the bcr register (including bit manipulation instructions) is disabled until either the end of that communication or frame, or until communication is stopped by the occurrence of an arbitration-loss communication error. master requests cannot therefore be multiplexed. however, the case when communication has been forcibly stopped (eniebus flag = 0) is not problem. p. 1032 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1571 (34/54) chapter classification function details of function cautions page if a bit manipulation instruction for the bcr r egister conflicts with a hardware reset of the mstrq bit, the bcr register may not operate normally. the following countermeasures are recommended in this case. ? because the hardware reset is instigated in the acknowledgment period of the slave address field, be sure to observe caution 1 of (b) master request flag (mstrq) below. ? be sure to observe the caution abov e regarding writing to the bcr register. p. 1032 ? bcr register be sure to set bits 0 to 2 to ?0?. p. 1032 ? communication enable flag (eniebus) before setting the eniebus bit (1), the following registers must be set depending on the mode of communication to be started. p. 1033 ? if the iebus controller has lost in arbitrat ion, issue the master request again by software. in doing so, set (1) the mstrq bit at a timing other than that illustrated below. p. 1034 ? master request flag (mstrq) when a master request has been sent and bu s mastership acquired, do not set the mstrq, enslvtx, or enslvrx bit until the end of communication (i.e. the communication end flag (isr.endtrns bit) or frame end flag (isr .endfram bit) is set (1)) as setting these flags disables in terrupt request signal generation. however, these flags can be set if communication has been aborted. p. 1034 ? broadcast request flag of bcr register when requesting broadcast communication, always set (1) the allrq bit, then the mstrq bit. p. 1034 ? the enslvtx bit must be set before the parity bit in the control field is received. p. 1035 ? slave transmission enable flag of bcr register clear the enslvtx bit (0) before setting the mstrq bit (1) when making a master request. this is to avoid tr ansmission of the data of the dr register that tries master transmission if the controller loses in arbi tration after master operation and if slave transmission is requested by the master. p. 1035 ? slave reception enable flag of bcr register the enslvrx bit must be set before the parity bit in the control field is received. p. 1035 ? do not set the psr register while communication is enabled (bcr.eniebus bit = 1). p. 1036 ? psr register be sure to clear bits 5 to 0 to ?0?. p. 1036 ? usr register be sure to set bits 0, 1, and 7 to ?0?. p. 1038 ? arbitration result flag of usr register the flag is cleared (0) at the detection timi ng of the start bit if the other unit outputs the start bit earlier and the unit does not output the start bit after the master request. p. 1039 ? lock status flag of usr register lock specification/release is not possible in broadcast communication. in the lock status, individual communication from a unit other than the one that requests locking is not acknowledged. however, even communication from a unit other than the one that requests locking is ac knowledged as long as the communication is a slave status request. p. 1040 ? isr register be sure to set bits 0, 1, and 7 to ?0?. p. 1041 ? each bit can only be cleared (0). it cannot be set (1) even if 1 is written to it. p. 1044 ? chapter 20 soft iebus controller esr register the value of the esr register is updated when an error occurs. if the esr register is read at this time, however, an undefined value is read. it is recommended to read the esr register in error interrupt servicing. p. 1044 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1572 (35/54) chapter classification function details of function cautions page if a communication error occurs, the iebus controller returns to the default status and makes preparation for communication. if co mmunication is started without the error corrected, the error flag accumulates the er ror. correct the error before the next communication is started. p. 1044 ? esr register be sure to set bit 1 to ?0?. p. 1044 ? the overrun status is cleared only when the dr register is read and when the system is reset. therefore, be sure to read the dr register in the communication error interrupt servicing program. p. 1047 ? overrun error occurrence flag of esr register the next data cannot be transmitted in the ov errun status if it is 2 bytes or more. because the data request interrupt request signal (intie1) does not occur, the transmit data cannot be set and an underrun er ror occurs. therefore, be sure to execute transmission after clearing the overrun status. p. 1047 ? timing of write error occurrence even when the werr bit is set (1), the intie1 interrupt request signal may be generated. p. 1048 ? uar register do not set the uar register wh ile communication is enabled (bcr.eniebus bit = 1). p. 1049 ? sar register be sure to set the sar register only at the following timing. ? when the bcr.eniebus bit is 0 ? between when the eniebus bit becomes 1 and the first master request is sent (the bcr.mstrq bit is set to 1) ? when the eniebus bit is 1, and the mstrq bit is 0 and between either the end of that communication, frame, or error and t he next master request (the mstrq bit is set to 1) p. 1049 ? par register the par register stores an address value if the parity is correct and the unit is not locked when the parity period of the master add ress field expires. if the par register is read at this time, an undefined value is read. p. 1050 ? rsa register the rsa register stores an address value if the parity is correct and the unit is not locked when the parity period of the slave addre ss field expires. if the rsa register is read at this time, an undefined value is read. p. 1050 ? cdr register because the slave unit must judge whether the received data is a ?command? or ?data?, read the value of the cdr register after completing communication. p. 1051 ? if the master unit sets an undefined value, the slave unit returns the nack signal and communication is aborted. during broadcast communication, the master unit ignores the acknowledge bit and continues communication. therefore, do not set an undefined value. p. 1051 ? cdr register be sure to set bits 4 to 7 to ?0?. p. 1051 ? when the master issues a request (0h, 4h , 5h, or 6h) for transmission of a slave status or a lock address (higher 4 bits and lower 8 bits), 01h is transmitted as the telegraph length regardless of the contents of the dlr register. it is therefore not necessary to set the dlr register by software. p. 1055 ? dlr register when the iebus controller serves as a re ceiver unit, the dlr register stores a telegraph length if the value of the parity bit of the telegraph length field is correct. if the dlr register is read at this time, an undefined value is read. p. 1055 ? dr register when the iebus controller serves as a receiver unit, the dr register stores receive data if the value of the parity bit of the data field is correct. if the dr register is read at this time, an undefined value is read. p. 1056 ? chapter 20 soft iebus controller fsr register the fsr register updates the status information when an interrupt request signal is generated. if the fsr register is read at this time, however, an undefined value is read. p. 1057 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1573 (36/54) chapter classification function details of function cautions page if another interrupt request signal is generated before the fsr register is read, the status information when the preceding interrupt occurred is updated by the status information when the new interrupt occurs. p. 1057 ? fsr register use the fsr register only for problem analysis; do not use it with the actual software. p. 1057 ? scr register the scr register is updated when the parity period of the te legraph field expires and when the ack signal of the data field is received. if the scr register is read at this time, however, an undefined value is read. p. 1058 ? ccr register the maximum number of transmit byte s is preset to the ccr register when the start bit is transmitted or received, and the regi ster is decremented when the parity period of the data field expires. if the ccr regi ster is read at this time, however, an undefined value is read. p. 1059 ? ocks2 register be sure to set bits 2 and 5 to 7 to ?0?. p. 1060 ? chapter 20 soft iebus controller switching dma transfer start factor in the v850e/sj3-h and v850e/sk3-h, the interr and intce0t signals note , and intsta and intce1t signals note , which are the dma transfer start factors, respectively share the same pin, and they cannot be used at the same time. to use interr or intsta signal as the dma transfe r start factor, set the dtfrob0 bit of the option byte 0000007ah to 0 (see chapter 33 option byte function). in this case, the intce0t note and intce1t note signals cannot be used as the dma transfer start factor. note not available in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) remark for details, see table 22-1 dma transfer start factors. p. 1081 ? can controller the can controller is allocated in the programmable peripheral i/o area. before using the can controller, enable us e of the programmable peripheral i/o area by using the bpc register. for details, refer to 3.4.7 progra mmable peripheral i/o registers. p. 1082 ? arbitration field (in standard format mode) an identifier is transmitted msb first. p. 1088 ? arbitration field (in extended format mode) an identifier is transmitted msb first. p. 1088 ? data length setting in the remote frame, there is no data field even if the data length code is not 0000b. p. 1089 ? forced recovery operation that skips bus-off recovery sequence this function is not defined by the ca n protocol iso 11898. when using this function, thoroughly evaluate its effect on the network system. p. 1102 ? initializing can module error counter register in initialization mode this function is enabled only in the initiali zation mode. even if the ccerc bit is set to 1 in a can operation mode, the cnerc and cninfo registers are not initialized. p. 1103 ? chapter 21 soft can controller register accessing the can cont roller registers is prohibited in the following statuses. for details, refer to 3.4.9 (2) accessing spec ific on-chip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock p. 1148 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1574 (37/54) chapter classification function details of function cautions page while the mbon bit is cleared (to 0), software access to the message buffers (cnmdata0m, cnmdata1m, cnmdata01m, cnmdata2m, cnmdata3m, cnmdata23m, cnmdata4m, cnmdat a5m, cnmdata45m, cnmdata6m, cnmdata7m, cnmdata67m, cnmdlcm, cnmconfm, cnmidlm, cnmidhm, and cnmctrlm), or registers related to trans mit history or receive history (cnlopt, cntgpt, cnlipt, and cnrgpt) is disabled. p. 1149 ? to request forced shut down, clear the gom bit to 0 immediately after the efsd bit has been set to 1. if access to another register (including reading the cngmctrl register) is executed by software (interrupt s including nmi) or dma without clearing the gom bit immediately after the efsd bi t has been set to 1, the efsd bit is forcibly cleared to 0, and the fo rced shut down request is invalid. p. 1150 ? the gom bit is cleared to 0 only in the in itialization mode or immediately after the efsd bit is set to 1. p. 1150 ? c0gmctrl, c1gmctrl registers be sure to set the gom bit and efsd bit separately. p. 1150 ? before changing the normal operation mode with abt to the initialization mode, be sure to set the cngmabt register to the default value (0000h). after setting, confirm that the cngmabt register is initialized to 0000h. p. 1152 ? do not set the abttrg bit to 1 in the initialization mode. if the abttrg bit is set to 1 in the initialization mode, the operation is not guaranteed after the can module has entered the normal operation mode with abt. p. 1152 ? c0gmabt, c1gmabt registers do not set the abttrg bit to 1 while the cnctrl.tstat bit is set to 1. directly confirm that the tstat bit = 0 before setting the abttrg bit to 1. p. 1152 ? do not change the contents of the cngmabtd register while the abttrg bit is set to 1. p. 1154 ? c0gmabtd, c1gmabtd registers be sure to set bits 4 to 7 to ?0?. p. 1154 ? c0mask3l, c1mask3l, c0mask3h, c1mask3h registers be sure to set bits 13 to 15 of the cnmaskah register to 0. p. 1156 ? transition to and from the can stop mode must be made via can sleep mode. a request for direct transition to and from the can stop mode is ignored. p. 1159 ? after releasing the power save mode, the cngmctrl.mbon flag must be checked before accessing the message buffer again. p. 1159 ? c0ctrl, c1ctrl registers it may take time to change the mode to the initialization mode or power save mode. therefore, be sure to check if the mode has been successfully changed, by reading the register value before executing the processing. p. 1159 ? c0lec, c1lec registers be sure to set bits 3 to 7 to ?0?. p. 1161 ? c0info, c1nfo registers be sure to set bits 5 to 7 to ?0?. p. 1162 ? c0ints, c1ints registers the status bit of this register is not automat ically cleared. clear it (0) by software if each status must be checked in the interrupt servicing. p. 1166 ? c0brp, c1brp registers the cnbrp register can be write-acce ssed only in the initialization mode. p. 1167 ? chapter 21 soft can controller c0mdlcm, c1mdlcm registers be sure to set bits 4 to 7 to ?0?. p. 1178 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1575 (38/54) chapter classification function details of function cautions page c0mconfm, c1mconfm registers be sure to set bits 2 and 1 to ?0?. p. 1180 ? be sure to write 0 to bits 14 and 13 of the cnmidhm register. p. 1180 ? c0midlm, c0midhm, c1midlm, c1midhm registers be sure to arrange the id values to be regi stered in accordance with the bit positions of this register. for the standard id, shift the bit positions of id28 to id18 of the id value. p. 1180 ? do not set the trq bit and rdy bit to 1 at the same time. be sure to set the rdy bit to 1 before setting the trq bit to 1. p. 1182 ? do not clear the rdy bit (0) during message transmission. follow transmission abort procedures in order to clear the rdy bit for redefinition. p. 1182 ? if the rdy bit is not cleared (0) even when the processing to clear it is executed, execute the clearing processing again. p. 1182 ? confirm, by reading the rdy bit again, t hat the rdy bit has been cleared (0) before writing data to the message buffer. however, it is unnecessary to confirm that the trq or rdy bit has been set (1) or that the dn or mow bit has been cleared (0). p. 1182 ? be sure to set the ie and rdy bits separately. p. 1182 ? c0mctrlm, c1mctrlm registers do not set the dn bit to 1 by software. be sure to write 0 to bit 10. p. 1182 ? if the dn bit is cleared to 0 before the arbi tration field that is being received ends, the message buffer in which the data frame is being stored becomes a target destination for storing another received data frame. p. 1182 ? c0mctrlm, c1mctrlm registers be sure to set the trq and rdy bits separately. p. 1183 ? when a message is received, reception filter ing is performed in accordance with the id and mask set to each receive message buffe r. if the procedure in figure 21-39 is not observed, the contents of the message buffer after it has been redefined may contradict the result of reception (result of reception filtering). if this happens, check that the id and ide received first and stored in the message buffer following redefinition are those stored after the message buffer has been redefined. if no id and ide are stored after redefinition, redefine the message buffer again. p. 1187 ? to redefine message buffer during transmission when a message is transmitted, the transmissi on priority is checked in accordance with the id, ide, and rtr bits set to each transmit message buffer to which a transmission request was set. the transmit message buffer having the highest priority is selected for transmission. if t he procedure in figure 21-27 is not observed, a message with an id not having the highest priority may be transmitted after redefinition. p. 1187 ? receive history list function even if the receive history list overflows (cnrgpt.rovf bit = 1), the receive history can be read until no more history is left unr ead and the cnrgpt.rhpm bit is set (1). however, the rovf bit is kept set (1) (= overflow occurs) until cleared (0) by software. in this status, the rhpm bit is not cleared (0), unless the rovf bit is cleared (0), even if a new receive history is stored and written to the list. if rovf bit = 1 and rhpm bit = 1 and the receive history list overflows, therefore, the rhpm bit indicates that no more history is left unread even if new history is received and stored. p. 1191 ? chapter 21 soft can controller multi buffer receive block function mbrb does not have a ring buffer structure. therefore, after a message is stored in the message buffer having the highest number in the mbrb configuration, a newly received message will no longer be stored in the message buffer in the order from the lowest message buffer number. p. 1195 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1576 (39/54) chapter classification function details of function cautions page transmit history list function if the tovf bit = 1 and the thpm bit = 1 and the receive history list overflows, therefore, the thpm bit indicates that no more history is left unread even if new history is received and stored. p. 1199 ? to resume the normal operation mode with abt from the message buffer 0, set the abtclr bit to 1 while the abttrg bit is cleared to 0. if the abtclr bit is set to 1 while the abttrg bit is set to 1, the subsequent operation is not guaranteed. p. 1202 ? do not set the abttrg bit in the initialization mode. if the abttrg bit is set in the initialization mode, the proper operation is not guaranteed after the mode is changed from the initialization mode to the abt mode. p. 1202 ? do not set the trq bit of the abt message buffers to 1 by software in the normal operation mode with abt. otherwise, the operation is not guaranteed. p. 1202 ? do not clear the rdy bit to 0 when the abttrg bit = 1. p. 1202 ? automatic block transmission if a message is received from another node in the normal operation mode with abt, the message may be transmitted after the time of one frame has elapsed even when cngmabtd register = 00h. p. 1202 ? transmission abort in normal operation mode with automatic block transmission be sure to abort abt by clearing the abttrg bit to 0. the operation is not guaranteed if aborting transmission is requested by clearing rdy. p. 1203 ? even if the falling edge belongs to the sof of a receive message, this message will not be received and stored. if the cpu has tu rned off the clock to the can while the can was in sleep mode, later on the can sleep mode will not be released and psmode[1:0] bits will continue to be 01b unless the clock for the can is provided again. in addition to this, the receive message will not be received afterwards. p. 1206 ? if a falling edge is detected at the can recept ion pin (crxdn) while the can clock is supplied, the psmode0 bit must be cleared by software. (for details, refer to the processing in figure 21-53.) p. 1206 ? releasing can sleep mode when the can sleep mode is released by an event of the can bus, a wakeup interrupt occurs even if the event of the can bus occurs immediately after the mode has been changed to the sleep mode. note that the interrupt can occur at any time. p. 1206 ? entering can stop mode to set the can module to the can stop m ode, the module must be in the can sleep mode. to confirm that the module is in the sleep mode, check that the psmode1 and psmode0 bits = 01b, and then request the can stop mode. if a bus change occurs at the can reception pin (crxdn) while this process is being performed, the can sleep mode is automatically released. in this case, the can stop mode transition request cannot be acknowledged (while the can clock is supplied, however, the psmode0 must be cleared by software after the bus level of the can reception pin (crxdn) is changed). p. 1207 ? chapter 21 soft can controller receive-only mode if only two can nodes are connected to the can bus and one of them is operating in the receive-only mode, there is no ack on the can bus. due to the missing ack, the transmitting node will transmit an active error flag, and repeat transmitting a message frame. the transmitting node becomes error passive after transmitting the message frame 16 times (assuming that the error counter was 0 in the beginning and no other errors have occurred). when the message frame is transmitted for the 17th time, the transmitting node generates a passive error flag. the receiving node in the receive-only mode detects the first valid message frame at this point, and the valid bit is set to 1 for the first time. p. 1211 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1577 (40/54) chapter classification function details of function cautions page time stamp function for these reasons, a data frame cannot be received in message buffer 0 when the can module is in the normal operation mode with abt, because message buffer 0 must be set as a transmit message buffer. in this operation mode, therefore, the function to stop toggle of the tsout signal by the tslock bit cannot be used. p. 1215 ? the values in table 21-22 do not guarantee the operation of the network system. thoroughly check the effect on the netwo rk system, taking into consideration oscillation errors and delays of the can bus and can transceiver. p. 1219 ? the values in table 21-23 do not guarantee the operation of the network system. thoroughly check the effect on the netwo rk system, taking into consideration oscillation errors and delays of the can bus and can transceiver. pp. 1220, 1221 ? settable bit rate combinations the values in table 21-24 do not guarantee the operation of the network system. thoroughly check the effect on the netwo rk system, taking into consideration oscillation errors and delays of the can bus and can transceiver. pp. 1222, 1223 ? re-initialization after setting the can module to the initialization mode, avoid setting the module to another operation mode immediately after. if it is necessary to immediately set the module to another operation mode, be sure to access registers other than the cnctrl and cngmctrl registers (e.g., set a message buffer). p. 1225 ? before a message buffer is initialized, the rdy bit must be cleared. p. 1226 ? message buffer initialization make the following settings for message buffers not used by the application. ? clear the cnmctrlm.rdy, cnmctrlm.trq, and cnmctrlm.dn bits to 0. ? clear the cnmconfm.ma0 bit to 0. p. 1226 ? the trq bit should be set after the rdy bit is set. p. 1229 ? message transmit processing the rdy bit and trq bit should not be set at the same time. p. 1229 ? abt message transmit processing the abttrg bit should be set to 1 after the ts tat bit is cleared to 0. the checking of the tstat bit and the setting for the abttrg bit to 1 must be continuous. p. 1230 ? the trq bit should be set after the rdy bit is set. p. 1231 ? the rdy bit and trq bit should not be set at the same time. p. 1231 ? transmission via interrupt (using cnlopt register) check the mbon bit at the start and end of the interrupt routine to see if the message buffer and transmit history register can be accessed, because a can sleep mode transition request which has been held pendi ng may be under execution. if the mbon bit is cleared (0), stop the processing under execution. re-execute the processing after the mbon bit is set (1) again. it is therefore recommended to cancel the can sleep mode transition request before execut ing transmission interrupt servicing. p. 1231 ? the trq bit should be set after the rdy bit is set. p. 1232 ? the rdy bit and trq bit should not be set at the same time. p. 1232 ? check the mbon bit at the start and end of the interrupt routine to see if the message buffer and transmit history register can be accessed, because a can sleep mode transition request which has been held pendi ng may be under execution. if the mbon bit is cleared (0), stop the processing under execution. re-execute the processing after the mbon bit is set (1) again. it is therefore recommended to cancel the can sleep mode transition request before execut ing transmission interrupt servicing. p. 1232 ? transmission via interrupt (using cntgpt register) if the tovf bit is set (1) again, the transmit history list contradicts. therefore, scan all the transmit message buffers t hat have completed transmission. p. 1232 ? the trq bit should be set after the rdy bit is set. p. 1233 ? chapter 21 soft can controller transmission via software polling the rdy bit and trq bit should not be set at the same time. p. 1233 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1578 (41/54) chapter classification function details of function cautions page check the mbon bit at the start and end of the polling routine to see if the message buffer and transmit history register can be accessed, because a can sleep mode transition request which has been held pendi ng may be under execution. if the mbon bit is cleared (0), stop the processing under execution. re-execute the processing after the mbon bit is set (1) again. p. 1233 ? transmission via software polling if the tovf bit is set (1) again, the transmit history list contradicts. therefore, scan all the transmit message buffers that have completed transmission. p. 1233 ? execute transmission abort processing by clearing the trq bit, not the rdy bit. p. 1234 ? before making a sleep mode transition reques t, confirm that there is no transmission request left using this processing. p. 1234 ? transmission abort processing (other than in normal operation mode with abt) the tstat bit can be periodically checked by a user applicati on or can be checked after the transmit completion interrupt. p. 1234 ? do not execute a new transmission request that includes other message buffers while transmission abort processing is in progress. p. 1234 ? transmission abort processing (other than in normal operation mode with abt) if data of the same message buffer are successively transmitted or if only one message buffer is used, judgments whethe r transmission has been successfully executed or failed may contradict. in such a case, make a judgment by using the history information of the cntgpt register. p. 1234 ? execute transmission abort processing by clearing the trq bit, not the rdy bit. p. 1235 ? before making a sleep mode transition reques t, confirm that there is no transmission request left using this processing. p. 1235 ? do not execute a new transmission request including in the other message buffers while transmission abort proc essing is in progress. p. 1235 ? transmission abort processing except for abt transmission (normal operation mode with abt) if data of the same message buffer are successively transmitted or if only one message buffer is used, judgments whethe r transmission has been successfully executed or failed may contradict. in such a case, make a judgment by using the history information of the cntgpt register. p. 1235 ? do not set any transmission requests while abt transmission abort processing is in progress. pp. 1236, 1237 ? abt transmission abort processing (normal operation mode with abt) make a can sleep mode/can stop mode transi tion request after the abttrg bit is cleared (after abt mode is stopped) following the procedure shown in figure 21-48 (a) or (b). when cleari ng a transmission request in an area other than the abt area, follow the procedure shown in figure 21-47. pp. 1236, 1237 ? reception via interrupt (using cnlipt register) check the mbon bit at the start and end of the interrupt routine to see if the message buffer and receive history register can be accessed, because a can sleep mode transition request which has been held pending may be under execution. if the mbon bit is cleared (0), stop the processing under execution. re-execute the processing after the mbon bit is set (1) agai n. it is therefore recommended to cancel the can sleep mode transition request before ex ecuting reception interrupt servicing. p. 1238 ? check the mbon bit at the start and end of the interrupt routine to see if the message buffer and receive history register can be accessed, because a can sleep mode transition request which has been held pending may be under execution. if the mbon bit is cleared (0), stop the processing under execution. re-execute the processing after the mbon bit is set (1) agai n. it is therefore recommended to cancel the can sleep mode transition request before ex ecuting reception interrupt servicing. p. 1239 ? chapter 21 soft can controller reception via interrupt (using cnrgpt register) if the rovf bit has been once set (1), the rece ive history list contr adicts. therefore, scan all the receive message buffers that have completed reception. p. 1239 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1579 (42/54) chapter classification function details of function cautions page check the mbon bit at the start and end of the polling routine to see if the message buffer and receive history register can be accessed, because a can sleep mode transition request which has been held pending may be under execution. if the mbon bit is cleared (0), stop the processing under execution. re-execute the processing after the mbon bit is set (1) again. p. 1240 ? reception via software polling if the rovf bit has been once set (1), the rece ive history list contr adicts. therefore, scan all the receive message buffers that have completed reception. p. 1240 ? setting can sleep mode/stop mode to abort transmission before making a request for the can sleep mode, perform processing according to figures 21-46 to 21-48. p. 1241 ? bus-off recovery if a request to change the mode from the initialization mode to any operation mode is made to execute the bus-off recovery sequence again during a bus-off recovery sequence, the receive error counter (cnerc.rec0 to rec6 bits) is cleared. it is therefore necessary to detect 11 conti guous recessive bits 128 times on the bus again. pp. 1243, 1244 ? forced shutdown process if access to another register is executed by software (interr upts including nmi) or dma immediately after the efsd bit has been set to 1 and before the gom bit is cleared to 0, setting the efsd bit is invalid and the gom bit is not cleared. p. 1246 ? setting cpu standby (from can sleep mode) check if the cpu is in the can sleep mode before setting it to the standby mode. the can sleep mode may be released by wakeup after it is checked if the cpu is in the can sleep mode and before the cpu is set in the standby mode. p. 1248 ? chapter 21 soft can controller setting cpu standby (from can stop mode) the can stop mode can only be released by writing 01 to the cnctrl.psmode1 and cnctrl.psmode0 bits. the can stop mode cannot be released by changing the can bus. p. 1249 ? when the value of the dsan register is read, two 16-bit registers, dsanh and dsanl, are read. if reading and updating conflict, the value being updated may be read (see 22.13 cautions). p. 1252 ? dsa0 to dsa3 registers following reset, set the dsanh, dsanl, ddanh, ddanl, and dbcn registers before starting dma transfer. if these registers are not set, the operation when dma transfer is started is not guaranteed. p. 1252 ? when the value of the ddan register is read, two 16-bit registers, ddanh and ddanl, are read. if reading and updating conflict, a value being updated may be read (see 22.13 cautions). p. 1253 ? dda0 to dda3 registers following reset, set the dsanh, dsanl, ddanh, ddanl, and dbcn registers before starting dma transfer. if these registers are not set, the operation when dma transfer is started is not guaranteed. p. 1253 ? dbc0 to dbc3 registers following reset, set the dsanh, dsanl, ddanh, ddanl, and dbcn registers before starting dma transfer. if these registers are not set, the operation when dma transfer is started is not guaranteed. p. 1254 ? the ds0 bit specifies the size of the transf er data, and does not control bus sizing. if 8-bit data (ds0 bit = 0) is set, therefor e, the lower data bus is not always used. p. 1255 ? chapter 22 soft dma function (dma controller) dadc0 to dadc3 registers if the transfer data size is set to 16 bits (d s0 bit = 1), transfer cannot be started from an odd address. transfer is always started from an address with the first bit of the lower address aligned to 0. p. 1255 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1580 (43/54) chapter classification function details of function cautions page if dma transfer is executed on an on-chip per ipheral i/o register (as the transfer source or destination), be sure to specify the same transfer size as the register size. for example, to execute dma transfer on an 8-bit register, be sure to specify 8-bit transfer. p. 1255 ? dadc0 to dadc3 registers when dma transfer is completed (when a terminal count is generated), the enn bit is cleared to 0 and then the tcn bit is set to 1. if the dchcn register is read while its bits are being updated, a value indicating ?transfer not completed and transfer is disabled? (tcn bit = 0 and enn bit = 0) may be read. p. 1256 ? be sure to follow the steps 22.3 (6) cautions 2 when changing the dtfrn register settings. p. 1258 ? an interrupt request that is generated in the standby mode (idel1, idle2, stop, or sub-idle mode) does not start the dma transf er cycle (nor is the dfn bit set to 1). p. 1258 ? if a dma start factor is selected by the ifc n5 to ifcn0 bits, the dfn bit is set to 1 when an interrupt occurs from the select ed on-chip peripheral i/o, regardless of whether the dma transfer is enabled or di sabled. if dma is enabled in this status, dma transfer is immediately started. p. 1258 ? in the v850e/sk3-h, when using uarta1 and i 2 c02 at the same time, and using the intua1r signal as the dma transfer start fa ctor, set the dtfrob1 bit of option byte 0000007ah (refer to chapter 33 option byte function) to 1. in this case, the intiic2 signal cannot be used as the dma transfer start factor. p. 1258 ? dtfr0 to dtfr3 registers in the v850e/sk3-h, when using uarta2 and i 2 c00 at the same time, and using the intua2r signal as the dma transfer start fa ctor, set the dtfrob1 bit of option byte 0000007ah (refer to chapter 33 option byte function) to 1. in this case, the intiic0 signal cannot be used as the dma transfer start factor. p. 1258 ? transfer targets the operation is not guaranteed for combinations of transfer destination and source marked with ?? in table 22-2. p. 1261 ? dma channel priorities if two or more dma channels are started with the same factor, a dma channel with a lower priority may be acknowledged earlier t han a dma channel with a higher priority. p. 1263 ? two start factors (software trigger and hard ware trigger) cannot be used for one dma channel. if two start factors are simult aneously generated for one dma channel, only one of them is valid. the start factor that is valid cannot be identified. p. 1264 ? a new transfer request that is generated a fter the preceding dma transfer request was generated or in the preceding dma transfer cycle is ignored (cleared). p. 1264 ? dma transfer start factors therefore, the transfer request intervals for the same dma channel must be sufficiently separated by the system. when the software trigger is used, completion of the dma transfer cycle that was genera ted before can be checked by updating the dbcn register. p. 1264 ? chapter 22 soft dma function (dma controller) caution for vswc register when using the dmac, be sure to set an appr opriate value, in accordance with the operating frequency, to the vswc register. when the default value (77h) of the vswc register is used, or if an inappropriate value is set to the vswc register, the operat ion is not correctly performed (for details of the vswc register, see 3.4.9 (1) (a) system wait control register (vswc)). p. 1270 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1581 (44/54) chapter classification function details of function cautions page caution for dma transfer executed on internal ram when executing the following instructions located in the internal ram, do not execute a dma transfer that transfers data to /from the internal ram (transfer source/destination), because the cpu ma y not operate correctly afterward. ? bit manipulation instruction located in internal ram (set1, clr1, or not1) ? data access instruction to misaligned address located in internal ram conversely, when executing a dma transfer to transfer data to/from the internal ram (transfer source/destination), do not execute the above two instructions. p. 1270 ? caution for reading dchcn.tcn bit (n = 0 to 3) when performing a dma transfer from the intern al ram, if the tcn bit is read by the interrupt servicing routine, either of t he following conditions must be satisfied. ? when the tcn bit is read at the start of t he interrupt servicing routine, perform the read operation twice consecutively. ? execute at least one instruction at the st art of the interrupt servicing routine to access (read/write) the internal ram, on-chip peripheral i/o register area, programmable peripheral i/o re gister area, or external memory area before reading the tcn bit. p. 1270 ? procedure of stopping dma transfer (clearing enn bit) forcibly clearing the enn bit to 0 during dma transfer can stop the dma transfer under execution. to stop the dma transfer, however, be sure to execute either of the (a) or (b) described in 22.13 (4) two procedures. if the enn bit is cleared to 0 by using a different procedure, the operation is not guaranteed. p. 1271 ? memory boundary the operation is not guaranteed if the address of the transfer source or destination exceeds the area of the dma target (external memory, internal ram, on-chip peripheral i/o, or expanded intern al ram) during dma transfer. p. 1271 ? transferring misaligned data dma transfer of misaligned data with a 16-bit bus width is not supported. if an odd address is specified as the transfe r source or destination, the least significant bit of the address is forcibly assumed to be 0. p. 1271 ? registers/bits that must not be rewritten during dma operation set the following registers at the followi ng timing when a dma operation is not under execution. [registers] ? dsanh, dsanl, ddanh, ddanl, dbcn, and dadcn registers ? dtfrn.ifcn5 to dtfrn.ifcn0 bits [timing of setting] ? period from after reset to start of the first dma transfer ? time after channel initializa tion to start of dma transfer ? period from after completion of dma transfer (tcn bit = 1) to start of the next dma transfer p. 1272 ? be sure to set the following register bits to 0. be sure to set the following register bits to 0. ? bits 14 to 10 of dsanh register ? bits 14 to 10 of ddanh register ? bits 15, 13 to 8, and 3 to 0 of dadcn register ? bits 6 to 3 of dchcn register p. 1272 ? dma start factor care must be exercised when setting the same start trigger for multiple dma channels. if dma transfers via such dma channels are activated, the dma channel with a lower priority may be acknowledged prior to t he dma channel with a higher priority. p. 1272 ? chapter 22 soft dma function (dma controller) read values of dsan and ddan registers values in the middle of updating may be read from the dsan and ddan registers during dma transfer (n = 0 to 3). p. 1272 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1582 (45/54) chapter classification function details of function cautions page chapter 23 soft crc function crcd register accessing the crcd register is prohibi ted in the following statuses. for details, refer to 3.4.9 (2) accessing specific on-chip peripheral i/o registers. ? when the cpu operates with the subclock and the main clock oscillation is stopped ? when the cpu operates with the internal oscillation clock p. 1274 ? for the non-maskable interrupt servici ng executed by the non-maskable interrupt request signal (intwdt2), s ee 24.2.2 (2) intwdt2 signal. p. 1284 ? non-maskable interrupts when the ep and np bits are changed by the ldsr instruction during non-maskable interrupt servicing, in order to restore th e pc and psw correctly during recovery by the reti instruction, it is necessary to se t the ep bit back to 0 and the np bit back to 1 using the ldsr instruction immedi ately before the reti instruction. p. 1287 ? maskable interrupts when the ep and np bits are changed by the ldsr instruction during maskable interrupt servicing, in order to restore th e pc and psw correctly during recovery by the reti instruction, it is necessary to se t the ep bit back to 0 and the np bit back to 0 using the ldsr instruction immedi ately before the reti instruction. p. 1291 ? maskable interrupts to perform multiple interrupt servicing, the values of the eipc and eipsw registers must be saved before executing the ei instruction. when returning from multiple interrupt servicing, restore the values of eipc and eipsw after executing the di instruction. pp. 1293 to 1295 ? disable interrupts (di) or mask the interrupt to read the xxicn.xxifn bit. if the xxifn bit is read while interrupts are enabled (ei) or while the interrupt is unmasked, the correct value may not be read when acknowledging an interrupt and reading the bit conflict. p. 1296 ? when manipulating the xxicn.xx mkn bit with the state where an interrupt request can be generated (including an interrupt disable (di) state), be sure to manipulate with a bit manipulation instruction or by using the imrm.xxmkn and imr7l.xxmkn bits (m = 0 to 6). pp. 1296, 1325 ? xxicn register be sure to set bits 3 to 5 to ?0?. p. 1296 ? imr0 to imr6, imr7l registers set bits 13 to 15 of the imr4 register and bits 3 and 4 of the imr7l register to 1, and set bits 5 to 7 of the imr7l register to 0. if the setting of these bits is changed, the operation is not guaranteed. p. 1302 ? ispr register if an interrupt is acknowledged while the ispr register is being read in the interrupt enabled (ei) status, the value of the ispr regi ster after the bits of the register have been set by acknowledging the interrupt may be read. to accurately read the value of the ispr register before an interrupt is acknowledged, read the register while interrupts are disabled (di). pp. 1303, 1325 ? software exception when the ep and np bits are changed by the ldsr instruction during the software exception processing, in order to restor e the pc and psw correctly during recovery by the reti instruction, it is necessary to set the ep bit back to 1 and the np bit back to 0 using the ldsr instruction imm ediately before the reti instruction. p. 1306 ? since it is possible to assign this instruct ion to an illegal opcode in the future, it is recommended that it not be used. p. 1308 ? exception trap dbpc and dbpsw can be accessed after the illegal opcode is executed and before the dbret instruction is executed. p. 1309 ? chapter 24 soft interrupt/ exception processing function debug trap dbpc and dbpsw can be accessed after the dbtrap instruction is executed and before the dbret instruction is executed. p. 1311 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1583 (46/54) chapter classification function details of function cautions page external interrupt request input pins (nmi and intp0 to intp9) the same external interrupt request input pins are assigned to two ports. therefore, the setting of each valid edge is set independent ly in the register corresponding to each port. be sure to use the external interrupt request input pin in either of the two ports. set the valid edge detection of the external interrupt request input pin of the port not being used to ?no edge detected?. p. 1312 ? when the function is changed from the exter nal interrupt function (alternate function) to the port function, an edge may be detected. therefore, clear the intf0n and intr0n bits to 00, and then set the port mode. p. 1314 ? intf0, intr0 registers be sure to clear the intf0n and intr0n bi ts to 00 when these registers are not used as the nmi or intp0 to intp3 pins. p. 1314 ? intf3, intr3 registers when the function is changed from the exter nal interrupt function (alternate function) to the port function, an edge may be detected. therefore, clear the intf31 and intr31 bits to 00, and then set the port mode. p. 1315 ? the intp7 pin and rxda0 pin are alternate- function pins. when using the pin as the rxda0 pin, disable edge detection for the in tp7 alternate-function pin (clear the intf3.intf31 bit and the inrt3.intr31 bit to 0). when using the pin as the intp7 pin, stop uarta0 reception (clear the ua0ctl0.ua0rxe bit to 0). p. 1315 ? intf3, intr3 registers be sure to clear the intf31 and intr31 bi ts to 00 when these registers are not used as intp7 pin. p. 1315 ? when the function is changed from the exter nal interrupt function (alternate function) to the port function, an edge may be detected. therefore, clear the intf42 and intr42 bits to 00, and then set the port mode. p. 1316 ? intf4, intr4 registers be sure to clear the intf42 and intr42 bi ts to 00 when these registers are not used as intp2 pin. p. 1316 ? when the function is changed from the exter nal interrupt function (alternate function) to the port function, an edge may be detected. therefore, clear the intf51 and intr51 bits to 00, and then set the port mode. p. 1317 ? intf5, intr5 registers be sure to clear the intf51 and intr51 bi ts to 00 when these registers are not used as intp7 pin. p. 1317 ? when the function is changed from the exter nal interrupt function (alternate function) to the port function, an edge may be detected. therefore, clear the intf66 and intr66 bits to 00, and then set the port mode. p. 1318 ? intf6, intr6 registers be sure to clear the intf66 and intr66 bi ts to 00 when these registers are not used as intp9 pin. p. 1318 ? when the function is changed from the exter nal interrupt function (alternate function) to the port function, an edge may be detected. therefore, clear the intf80 and intr80 bits to 00, and then set the port mode. p. 1319 ? the intp8 pin and rxda3 pin are alternate- function pins. when using the pin as the rxda3 pin, disable edge detection for the in tp8 alternate-function pin (clear the intf8.intf80 bit and the intr8.intr80 bit to 0). when using the pin as the intp8 pin, stop uarta3 reception (clear the ua3ctl0.ua3rxe bit to 0). p. 1319 ? be sure to set bits 1 to 7 of the intf8 and intr8 registers to 0. p. 1319 ? intf8, intr8 registers be sure to clear the intf80 and intr80 bi ts to 00 when these registers are not used as intp8 pin. p. 1319 ? chapter 24 soft interrupt/ exception processing function intf9, intr9 registers when the function is changed from the exter nal interrupt function (alternate function) to the port function, an edge may be detected. therefore, clear the intf9n and intr9n bits to 0, and then set the port mode. p. 1320 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1584 (47/54) chapter classification function details of function cautions page intf9, intr9 registers be sure to clear the intf9n and intr9n bi ts to 00 when these registers are not used as any of pins intp4 to intp6, and intp8. p. 1320 ? when the function is changed from the exter nal interrupt function (alternate function) to the port function, an edge may be detected. therefore, clear the intf15n and intr15n bits to 00, and then set the port mode. p. 1321 ? be sure to set bits 0, 1, and 4 to 7 of the intf15 and intr15 registers to 0. p. 1321 ? intf15, intr15 registers be sure to clear the intf15n and intr15n bits to 00 when these registers are not used as intp6 or intp9 pin. p. 1321 ? be careful about the following points when using the interrupt and dma functions. ? when using the interrupt function, after the 3 sampling clocks have elapsed, enable interrupts after the interrupt request flag (pic3.pif3 bit) has been cleared. ? when using the dma function (started by intp3), enable dma after 3 sampling clocks have elapsed. p. 1322 ? nfc register be sure to set bits 3 to 6 to ?0?. p. 1322 ? nmi pin the nmi pin alternately functions as the p 02 pin. it functions as the p02 pin after reset. to enable the nmi pin, validate the nmi pin with the pmc0 register. the initial setting of the nmi pin is ?no edge detected?. select the nmi pin valid edge using the intf0 and intr0 registers. p. 1325 ? chapter 24 soft interrupt/ exception processing function switching dma transfer start factors because the intp8 signal and the inttm2 eq0 signal of the dma transfer start factors are used alternately, they cannot be used at the same time. when the intp8 signal is used as a dma transfer start fa ctor, set the dtfrob0 bit in option byte 0000007ah to 0 (refer to chapter 33 option byte function). in this case, the inttm2eq0 signal cannot be used as the dma transfer start factors. for details, see table 22-1 dma transfer start factors. p. 1325 ? soft krm register rewrite the krm register after once clearing the krm register to 00h. p. 1327 ? hard kr0 to kr7 pin if a low level is input to any of the kr0 to kr7 pins, the intkr signal is not generated even if the falling edge of another pin is input. p. 1327 ? kr7 pin rxda1 pin the kr7 and rxda1 pins must not be used at the same time. in the v850e/sk3-h, the kr7 and rxda1 pins are assigned to two ports each, and cannot be used at the same time at different ports. to use the kr7 pin, set the ua1ctl0.ua1rxe bit to 0 (it is recommended to set the pfc91 bit to 1 and pfce91 bit to 0 when using the kr7 pin at p91). to use the rxda1 pin, set the krm.krm7 bit of the kr7 pin to 0. p. 1327 ? hard, soft krn pin tiq0m pin the krn and tiq0m pins must not be used at the same time (n = 0 to 3, m = 0 to 3). the kr2 and tiq03 pins and the kr3 and tiq00 pins are assigned to two ports each, and cannot be used at the same time at different ports. settings for using the krn or tiq0m pin are shown in 25.3 (3). p. 1328 ? krm register if the krm register is changed, an interrupt request signal (intkr) may be generated. to prevent this, change the krm r egister after disabling interrupts (di) or masking, then clear the interrupt request flag (kric.krif bit) to 0, and enable interrupts (ei) or clear the mask. p. 1328 ? chapter 25 soft key interrupt function switching between port mode and alternate- function mode to use the key interrupt function, be sure to set the port pin to the key return pin and then enable the operation with the krm register. to switch from the key return pin to the port pin, disable the operation with the krm register and then set the port pin. p. 1328 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1585 (48/54) chapter classification function details of function cautions page chapter 25 soft key interrupt function switching dma transfer start factor the intkr signal and the inttm1eq0 si gnal, both being the dma transfer start factors, are alternate functions of the same pin, and they cannot be used at the same time. to use the intkr signal as the dma tr ansfer start factor, set the dtfrob0 bit in the option byte area 0000007ah to 0 (refer to chapter 33 option byte function). in this case, the inttm1eq0 signal cannot be used as the dma transfer start factor. for details, see table 22-1 dma transfer start factors. p. 1328 ? before setting the idle1, idle2, stop, or sub-idle mode, set the psmr.psm1 and psmr.psm0 bits and then set the stp bit. p. 1330 ? if there is an unmasked interrupt request signal being held pending when the idle1/idle2/stop mode is set, set the bit corresponding to the interrupt request signal (nmi1m, nmi0m, or intm) to 1, and then set the stp bit to 1. p. 1330 ? psc register be sure to set bits 0, 2, 3, and 7 to ?0?. p. 1330 ? be sure to clear bits 2 to 7 to ?0?. p. 1331 ? chapter 26 soft psmr register the psm0 and psm1 bits are valid only when the psc.stp bit is 1. p. 1331 ? be sure to clear bits 3 to 7 to ?0?. p. 1332 ? the oscillation stabilization time following reset release is 2 16 /f x (because the initial value of the osts register = 06h). p. 1332 ? in clock mode 1, if the system shifts to idle2 mode while the pll is operating, be sure to set a setup time of at least 800 s to be inserted after idle2 mode is released. if the pll is stopped, set a setup time of at least 350 s to be inserted after idle2 mode is released. p. 1333 ? in clock mode 1, if the system shifts to stop mode while the pll is operating, be sure to set an oscillation stabilization time of at least 1 ms to be inserted after stop mode is released. p. 1333 ? in clock modes 2, 3, and 4, if the system shifts to idle2 mode while the sscg is operating, be sure to set a setup time of at least 1 ms to be inserted after idle2 mode is released. if the sscg is stopped, set a setup time of at least 800 s to be inserted after idle2 mode is released. p. 1333 ? osts register in clock modes 2, 3, and 4, if the system shifts to stop mode while the sscg is operating, be sure to set an oscillation stabilization time of at least 2 ms to be inserted after stop mode is released. p. 1333 ? insert five or more nop instructions after the halt instruction. p. 1334 ? halt mode if the halt instruction is executed while an unmasked interrupt request signal is being held pending, the status shifts to halt mode, but the halt mode is then released immediately by t he pending interrupt request. p. 1334 ? insert five or more nop instructions after the instruction that stores data in the psc register to set the idle1 mode. p. 1336 ? idle1 mode if the idle1 mode is set while an unmasked interrupt request signal is being held pending, the idle1 mode is released immediately by the pending interrupt request. p. 1336 ? insert five or more nop instructions after the instruction that stores data in the psc register to set the idle2 mode. p. 1339 ? idle2 mode if the idle2 mode is set while an unmasked interrupt request signal is being held pending, the idle2 mode is released immediately by the pending interrupt request. p. 1339 ? standby function securing setup time when releasing idle2 mode in clock mode 1, if the system shifts to idle2 mode while the pll is operating, be sure to set a setup time of at least 800 s to be inserted after idle2 mode is released. if the pll is stopped, set a setup time of at least 350 s to be inserted after idle2 mode is released. p. 1342 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1586 (49/54) chapter classification function details of function cautions page securing setup time when releasing idle2 mode in clock modes 2, 3, and 4, if the system shifts to idle2 mode while the sscg is operating, be sure to set a setup time of at least 1 ms to be inserted after idle2 mode is released. if the sscg is stopped, set a setup time of at least 800 s to be inserted after idle2 mode is released. p. 1342 ? insert five or more nop instructions after the instruction that stores data in the psc register to set the stop mode. p. 1343 ? stop mode if the stop mode is set while an unmasked interrupt request signal is being held pending, the stop mode is released immedi ately by the pending interrupt request. p. 1343 ? in clock mode 1, if the system shifts to stop mode while the pll is operating, be sure to set an oscillation stabilization time of at least 1 ms to be inserted after stop mode is released. p. 1346 ? securing oscillation stabilization time when releasing stop mode in clock modes 2, 3, and 4, if the system shifts to stop mode while the sscg is operating, be sure to set an oscillation stabilization time of at least 2 ms to be inserted after stop mode is released. p. 1346 ? secure the oscillation stabilization time of the subclock oscillator before shifting to subclock operation mode. the subclock oscillator starts oscillation after power is applied. p. 1347 ? before setting subclock operation mode, be sure to stop operation of the sscg (sscgctl.sscgon bit = 0). note that the sscg cannot be used in clock mode 1. p. 1347 ? when manipulating the ck3 bit, do not change the set values of the pcc.ck2 to pcc.ck0 bits (using a bit manipulation instruction to manipulate the bit is recommended). for details of the pcc regist er, see 6.3 (1) processor clock control register (pcc). p. 1347 ? if the following conditions are not satisfied, change the ck2 to ck0 bits so that the conditions are satisfied and set the subclock operation mode. internal system clock (f clk ) > subclock (f xt = 32.768 khz) 4 p. 1347 ? when stopping operation of the main clock os cillator, be sure to also stop operation of the on-chip peripheral functions operat ing on the main oscillation clock (f x ) and peripheral clock (f xp ). p. 1347 ? in clock modes 2, 3 and 4, do not clear (0 ) the pllctl.pllon bit by software (i.e., do not stop the pll). when the main cloc k oscillator stops operating (pcc.mck bit = 1), the pll automatically stops operating at the same time, with the pllctl.pllon bit still set to 1 (pll operation enabled). similarly, when the main clock oscillator is set to operation enabled again (pcc.mck bit = 0) , the pll also starts operating, and enters a locked state until the oscillation stabilization time secured by software elapses (at least 1 ms). p. 1347 ? when manipulating the ck3 bit, do not change the set values of the ck2 to ck0 bits (using a bit manipulation instruction to manipulate the bit is recommended). for details of the pcc register, see 6.3 (1) processor clock control register (pcc). p. 1347 ? subclock operation mode when the cpu is operating on the subclock and main clock oscillation is stopped, accessing a register in which a wait occurs is disabled. if a wait is generated, it can be released only by reset (see 3.4.9 (2)). p. 1349 ? following the store instruction to the psc register for setting the sub-idle mode, insert the five or more nop instructions. p. 1350 ? chapter 26 soft standby function sub-idle mode if the sub-idle mode is set while an unmas ked interrupt request signal is being held pending, the sub-idle mode is then releas ed immediately by the pending interrupt request. p. 1350 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1587 (50/54) chapter classification function details of function cautions page when stopping operation of the main clock os cillator, be sure to also stop operation of the on-chip peripheral functions operat ing on the main oscillation clock (f x ) and peripheral clock (f xp ). p. 1350 ? in clock modes 2, 3, and 4, do not clear (0 ) the pllctl.pllon bit by software (i.e., do not stop the pll). when the main cloc k oscillator stops operating (pcc.mck bit = 1), the pll automatically stops operating at the same time, with the pllctl.pllon bit still set to 1 (pll operation enabled). similarly, when the main clock oscillator is set to operation enabled again (pcc.mck bit = 0) , the pll also starts operating, and enters a locked state until the oscillation stabilization time secured by software elapses (at least 1 ms). p. 1350 ? sub-idle mode when the sub-idle mode is released, 12 cycles of the subclock (about 366 s) elapse from when the interrupt request signal that releases the sub-idle mode is generated to when the mode is released. p. 1351 ? chapter 26 soft standby function status transition diagram in clock modes 2, 3, and 4, do not clear (0 ) the pllctl.pllon bit by software (i.e., do not stop the pll). p. 1357 ? emergency operation mode in emergency operation mode, do not access on-chip peripheral i/o registers other than registers used for interrupts, ports, wdt2, or tmm0, each of which can operate on the internal oscillation clock. in addition, csib0 to csib5, csie0 note , csie1 note , and uarta0 cannot operate on an externally input clock in this mode. note other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h) p. 1358 ? lvi circuit internal reset an lvi circuit internal reset does not reset the lvi circuit. p. 1359 ? resf register be sure to set bits 2, 3, and 5 to 7 to ?0?. p. 1360 ? chapter 27 soft reset function reset operation via reset pin the ocdm register is initialized by the reset pin input. therefore, note with caution that, if a high level is input to the p05/drst pin after a reset release before the ocdm.ocdm0 bit is cleared, the v850e /sj3-h or v850e/sk3-h may enter on- chip debug mode. for details, refer to chapter 4 port functions. p. 1361 ? once the clme bit has been set to 1, it cannot be cleared to 0 by any means other than reset. p. 1371 ? chapter 28 soft clock monitor clm register lvim register be sure to set bits 1 to 7 to ?0?. p. 1371 ? when the lvion and lvimd bits to 1, the low-voltage detector cannot be stopped until the reset request due to other than the low-voltage detection is generated. p. 1376 ? when the lvion bit is set to 1, the comparator in the lvi circuit starts operating. wait 0.2 ms or longer by software before checking the voltage at the lvif bit after the lvion bit is set. p. 1376 ? lvim register be sure to clear bits 6 to 2 to ?0?. p. 1376 ? this register cannot be written until a reset request due to something other than low- voltage detection is generated after the lvim.lvion and lvim.lvimd bits are set to 1. p. 1377 ? lvis register be sure to clear bits 7 to 1 to ?0?. p. 1377 ? to use for internal reset signal (lvires) if lvimd bit is set to 1, the contents of the lvim and lvis registers cannot be changed until a reset request other than lvi is generated. p. 1378 ? to use for interrupt (intlvi) when the intlvi signal is generated, confirm, using the lvim/lvif bit, whether the intlvi signal is generated due to a supply voltage drop or rise across the detected voltage. p. 1379 ? chapter 29 soft low- voltage detector pemu1 register this bit (evaramin) is not automatically cleared. p. 1381 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1588 (51/54) chapter classification function details of function cautions page chapter 30 hard regulator regulator use the regulator with a setting of v dd = ev dd = av ref0 = av ref1 bv dd . p. 1382 ? coradn register when setting an address to be corrected in t he coradn register, clear the higher bits to 0 in accordance with t he capacity of the internal rom. p. 1390 ? rom correction function the rom correction function cannot be used to correct data in the internal rom. it can only be used to correct instruction code s. if rom correction is used to correct data, that data is replaced with a dbtrap instruction code. p. 1390 ? rom code rom correction is not performed in regards to the rom code before writing in the corcnn register ends. p. 1390 ? dbtrap instruction after executing a dbtrap instruction, the psw.np, ep, and di bits are set to 111, and interrupt/exception cannot be acknowledged. after executing a dbtrap instruction, change the psw register value as required. p. 1390 ? dbpc, dbpsw registers the dbpc and dbpsw registers can be accessed while dbtrap instructions are being executed. p. 1390 ? chapter 31 soft rom correction function correction addresses if the addresses of the instructions execut ed immediately after the corcnn register setting (enabled) are set as the correction addresses, normal operation may not be obtained (dbtrap is not generated). p. 1390 ? be sure to connect the regc pin to gnd via 4.7 f capacitor. pp. 1400, 1401 ? clock cannot be supplied from the clk pin of the flash memory programmer. create an oscillator on the board and supply clock. pp. 1400, 1401 ? csib0 + hs, csib3 + hs do not input a high level to the drst pin. pp. 1403, 1405 ? flmd1 pin if the v dd signal is input to the flmd1 pin from another device during on-board writing and immediately after re set, isolate this signal. p. 1410 ? hard serial interface pin when connecting a dedicated flash memory pr ogrammer to a serial interface pin that is connected to another device on-board, care should be taken to avoid conflict of signals and malfunction of the other device. p. 1411 ? soft flash memory rewriting by self programming make sure that constant data of rewriting target is situated in a different block than program code. see 32.2 memory configur ation for the block configuration. p. 1414 ? chapter 32 hard flash memory flmd0 pin when self programming make sure that the flmd0 pin is at 0 v when reset is released. p. 1419 ? option byte (0000007ah) be sure to set bits 2, 3, 6 and 7 to ?0?. p. 1422 ? be sure to set to the plli0 bit to 0 (no division) in clock mode 4. p. 1423 ? option byte (0000007bh) be sure to set bits 4 to 7 to ?0?. p. 1423 ? be sure to write 6 bytes of data to the section of the option byte. if fewer than 6 bytes are written, an error will occur at linking. p. 1424 ? chapter 33 soft option byte function an example of the program when using the ca850 set addresses 007ch to 007fh to 0x00. p. 1424 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1589 (52/54) chapter classification function details of function cautions page when using the ddi, ddo, dck, and dms pins not as on-chip debug pins but as port pins after external reset, any of the following actions must be taken. ? input a low level to the p05/intp2/drst pin. ? set the ocdm0 bit. in this case, take the following actions. <1> clear the ocdm0 bit to 0. <2> fix the p05/intp2/drst pin to the low level until <1> is completed. p. 1430 ? hard, soft on-chip debug mode register (ocdm) the drst pin has an on-chip pull-down resistor . this resistor is disconnected when the ocdm0 flag is cleared to 0. p. 1430 ? if a reset signal is input (from the target syst em or a reset signal from an internal reset source) during run (program execution) , the break function may malfunction. p. 1432 ? even if the reset signal is masked by the ma sk function, the i/o buffer (port pin) may be reset if a reset signal is input from a pin. p. 1432 ? pin reset during a break is masked and the cpu and peripheral i/o are not reset. if pin reset or internal reset is generated as soon as the flash memory is rewritten by dmm or read by the ram monitor function wh ile the user program is being executed, the cpu and peripheral i/o may not be correctly reset. p. 1432 ? soft emulation of rom correction cannot be executed. p. 1432 ? hard in the on-chip debug mode, the ddo pin is forcibly set to the high-level output p. 1432 ? soft cautions (debugging with dcu) initialize the asid register to 00h during on-chip debugging. p. 1432 ? hard do not mount a device that was used for debugging on a mass-produced product, because the flash memory was rewritten during debugging and the number of rewrites of the flash memory cannot be guaranteed. moreover, do not embed the debug monitor program into mass-produced products. p. 1443 ? forced breaks cannot be executed if one of the following conditions is satisfied. ? interrupts are disabled (di) ? interrupts issued for the serial interface, which is used for communication between minicube2 and the target device, are masked ? standby mode is entered while standby re lease by a maskable interrupt is prohibited ? mode for communication between minicube2 and the target device is uarta0, and the main clock has been stopped p. 1443 ? chapter 34 soft on-chip debug function cautions (debugging without using dcu) the pseudo rrm function and dmm function do not operate if one of the following conditions is satisfied. ? interrupts are disabled (di) ? interrupts issued for the serial interface, which is used for communication between minicube2 and the target device, are masked ? standby mode is entered while standby re lease by a maskable interrupt is prohibited ? mode for communication between minicube2 and the target device is uarta0, and the main clock has been stopped ? mode for communication between minicube2 and the target device is uarta0, and a clock different from the one specified in the debugger is used for communication p. 1443 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1590 (53/54) chapter classification function details of function cautions page the standby mode is released by the pseudo rrm function and dmm function if one of the following conditions is satisfied. ? mode for communication between minicube2 and the target device is csib0 or csib3 ? mode for communication between minicube2 and the target device is uarta0, and the main clock has been supplied. p. 1443 ? peripheral i/o registers that requires a specific sequence cannot be rewritten with the dmm function. p. 1443 ? chapter 34 soft on-chip debug function cautions (debugging without using dcu) if a space where the debug monitor program is allocated is rewritten by flash self programming, the debugger can no longer operate normally. p. 1443 ? do not directly connect the output (or i/o) pins of ic products to each other, or to v dd , v cc , and gnd. open-drain pins or open-co llector pins, however, can be directly connected to each other. direct connection of the output pins between an ic product and an external circuit is possible, if the output pins can be set to the high-impedance state and the output timing of the external circuit is designed to avoid output conflict. p. 1448 ? absolute maximum ratings product quality may suffer if the absol ute maximum rating is exceeded even momentarily for any parameter. that is, the absolute maximum ratings are rated values at which the product is on the verge of suffering physical damage, and therefore the product must be used under c onditions that ensure that the absolute maximum ratings are not exceeded. the ratings and conditions indicated for dc characteristics and ac char acteristics represent the qua lity assurance range during normal operation. p. 1448 ? when using the main clock oscillator, wire as follows in the area enclosed by the broken lines in the above figur e to avoid an adverse effect from wiring capacitance. ? keep the wiring length as short as possible. ? do not cross the wiring with the other signal lines. ? do not route the wiring near a signal li ne through which a high fluctuating current flows. ? always make the ground point of the oscillator capacitor the same potential as v ss . ? do not ground the capacitor to a ground pattern through which a high current flows. ? do not fetch signals from the oscillator. p. 1450 ? when the main clock is stopped and the devi ce is operating on the subclock, wait until the oscillation stabilization time has been secured by the program before switching back to the main clock. p. 1450 ? for the resonator selection and oscillator constant, customers are requested to either evaluate the oscillation themselves or apply to the resonator manufacturer for evaluation. p. 1450 ? chapter 35 hard electrical specification main clock oscillator characteristics this oscillator constant is a reference value based on evaluation under a specific environment by the resonator manufacturer. if optimization of oscillator characteristics is necessary in the ac tual application, apply to the resonator manufacturer for evaluation on the implementation circuit. the oscillation voltage and oscillati on frequency indicate only oscillator characteristics. use the v850e/sj3-h and v850e/sk3-h so that the internal operating conditions are within the specificat ions of the dc and ac characteristics. pp. 1451, 1452 ?
appendix d list of cautions user?s manual u19201ej3v0ud 1591 (54/54) chapter classification function details of function cautions page when using the subclock oscill ator, wire as follows in the area enclosed by the broken lines in the above figur es to avoid an adverse effect from wiring capacitance. ? keep the wiring length as short as possible. ? do not cross the wiring wi th the other signal lines. ? do not route the wiring near a signal line through which a high fluctuating current flows. ? always make the ground point of the oscillator capacitor the same potential as v ss . ? do not ground the capacitor to a ground pattern through which a high current flows. ? do not fetch signals from the oscillator. p. 1453 ? the subclock oscillator is designed as a low-amplitude circuit for reducing power consumption, and is more prone to malfunction due to noise than the main clock oscillator. particular care is therefore required with the wiring method when the subclock is used. p. 1453 ? subclock oscillator characteristics for the resonator selection and oscillator constant, customers are requested to either evaluate the oscillation themselves or apply to the resonator manufacturer for evaluation. p. 1453 ? data retention characteristics shifting to stop mode and restoring from stop mode must be performed within the rated operating range. p. 1459 ? hard ac characteristics if the load capacitance exceeds 50 pf due to the circuit configuration, bring the load capacitance of the device to 50 pf or less by inserting a buffer or by some other means. p. 1460 ? when operating at f cpu > 20 mhz, be sure to insert address hold waits and address setup waits. p. 1462 ? in multiplexed bus mode when operating at f cpu > 32 mhz, be sure to insert at least one data wait. p. 1462 ? when operating at f cpu > 20 mhz, be sure to insert address hold waits and address setup waits. p. 1467 ? in separate bus mode when operating at f cpu > 20 mhz, be sure to insert at least one data wait. p. 1467 ? chapter 35 soft electrical specification a/d converter do not set (read/write) alternate-f unction ports during a/d conversion; otherwise the conversion resolution may be degraded. p. 1483 ? appendix a soft development tool embedded software to purchase the rx850 or rx850 pro, first fill in the purchase application form and sign the user agreement. p. 1505 ?
user?s manual u19201ej3v0ud 1592 appendix e revision history e.1 major revisions in this edition (1/4) page description throughout ? addition of the following products pd70f3931gja-gae-g, 70f3932gja-gae-g, 70f3933gja-gae-g, 70f3934gja-gae-g, 70f3935gja-gae-g, 70f3936gja-gae-g, 70f39 37gja-gae-g, 70f3938gja-gae-g, 70f3939gja- gae-g ? change of the remark about n and m values in chapter 19 i 2 c bus n = 0 to 5, m = 0, 1, 3 only pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), 70f3933 (v850e/sj3-h): n = 0 to 3, m = 0, 1 other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), 70f3933 (v850e/sj3-h): n = 0 to 5, m = 0, 1, 3 pp.23, 24 addition of description to table 1-1 v850e/sj3-h and v850e/sk3-h products pp.25 to 27 modification of description in 1.2 features p.28 addition of description to 1.4.1 v850e/sj3-h pp.29, 30 addition of description to 1.5.1 v850e/sj3-h p.35 addition of description to 1.6.1 (1) v850e/sj3-h p.39 addition of description to 1.6.2 (3) rom p.39 modification of description in 1.6.2 (7) clock generator (cg) p.40 addition of description to 1.6.2 (13) serial interface p.42 addition of description to 1.6.2 (24) ports pp.44, 45 addition of description to 2.1 (1) port pins pp.53 to 59 addition of description to 2.1 (2) non-port pins pp.66, 67 addition of description to 2.4 pin i/o circuit types, i/o buffer power supplies and connection of unused pins p.85 addition of description to figure 3-1 image on address space p.88 addition of figure 3-2 (b) when not using expanded internal ram p.90 addition of figure 3-3 (b) when not using expanded internal ram p.91 addition of 3.4.4 (1) (a) internal rom (512 kb) p.92 addition of 3.4.4 (1) (b) internal rom (768 kb) p.92 addition of description to 3.4.4 (1) (c) internal rom (1024 kb) p.96 addition of description to 3.4.4 (5) external memory area p.96 addition of description to 3.4.4 (6) expanded internal ram area p.96 addition of description to 3.4.4 (6) (a) expanded internal ram (16 kb) p.99 addition of description to 3.4.4 (7) product selection register (prdsel) p. 100 addition of description to table 3-3 product name setting examples p.103 addition of figure 3-14 (b) not using expanded internal ram pp.104, 107, 108, 110, 115 to 117, 122 addition of description to 3.4.6 peripheral i/o registers p.130 addition of description to 3.4.9 (2) accessing specific on-chip peripheral i/o registers p.136 addition of description to table 4-3 port configuration (v850e/sj3-h)
appendix e revision history user?s manual u19201ej3v0ud 1593 (2/4) page description p.141 addition of description to table 4-6 port 0 alternate-function pins p.142 addition of description to 4.3.1 (3) port 0 mode control register (pmc0) p.143 addition of description to 4.3.1 (5) port 0 function control expansion register (pfce0) (not included in the pd70f3931 (v850e/sj3-h), 70f3932 (v850e/ sj3-h), and 70f3933 (v850e/sj3-h).) p.143 addition of description to 4.3.1 (6) port 0 alternate function specifications p.167 addition of description to table 4-12 port 6 alternate-function pins pp.169 to 174 addition of description to 4.3.7 (3) to (6) p.225 addition of figure 4-23 block diagram of type g-7 p.257 modification of description in figure 4-55 block diagram of type u-27 p.265 modification of description in figure 4-63 block diagram of type u-35 p.266 addition of figure 4-64 block diagram of type u-36 p.267 addition of figure 4-65 block diagram of type u-37 p.268 addition of figure 4-66 block diagram of type u-38 pp.271, 275, 276 addition of description to table 4-25 using port pin as alternate-function pin p.290 modification of description in 5.1 features p.293 addition of description to 5.3 memory block function p.294 addition of description to figure 5-1 (a) when using expanded internal ram p.295 addition of figure 5-1 (b) when not using expanded internal ram pp.296, 299, 300 addition of description to 5.3.1 (1) chip area select control registers 0, 1 (csc0 and csc1) p.303 modification of description in 5.5.2 (1) bus size configuration register (bsc) p.312 addition of description to 5.6.1 (2) (a) when using the expansion internal ram (other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3- h), 70f3933 (v850e/sj3-h)) p.313 addition of 5.6.1 (2) (b) when not using the expanded internal ram p.317 modification of description in 5.6.4 (1) address wait control register (awc) p.318 modification of description in 5.7 (1) bus cycle control register (bcc) p.328 addition of description to 6.1 overview pp.330, 331 addition of description to table 6-1 frequency range of operating clocks in each clock mode and corresponding source cocks p.332 modification of description in figure 6-1 clock generation circuit for clock mode 1 p.333 addition of 6.2.1 (1) (b) plli0 bit = 1 (divided by 2) p.333 modification of description in 6.2.1 (5) pll p.334 addition of description to 6.2.1 (7) prescaler 1 pp.335, 336 modification of description in figure 6-2 clock generation circuit for clock mode 2 p.336 addition of 6.2.2 (1) (b) plli0 bit = 1 (divided by 2) p.337 modification of description in 6.2.2 (5) and (6) p.337 addition of description to 6.2.2 (7) prescaler 1 pp.338, 339 modification of description in figure 6-3 clock generation circuit for clock mode 3 p.339 addition of 6.2.3 (1) (b) plli0 bit = 1 (divided by 2) p.340 modification of description in 6.2.3 (5) and (6) p.340 addition of description to 6.2.3 (7) prescaler 1
appendix e revision history user?s manual u19201ej3v0ud 1594 (3/4) page description pp.341, 342 modification of description in figure 6-4 clock generation circuit for clock mode 4 p.343 modification of description in 6.2.4 (5) and (6) p.343 addition of description to 6.2.4 (7) prescaler 1 p.353 addition of description to 6.3 (9) sscg frequency control register 0 (sfc0) p.717 addition of description to table 15-1 pin configuration p.718 addition of description to 15.1.1 (5) uarta4 p.718 addition of description to 15.1.1 (6) uarta5 p.746 modification of description in 15.6.10 receive data noise filter p.746 modification of description in figure 15-12 timing of rxdan signal judged as noise p.759 modification of description in 16.1 features p.805 modification of description in table 16-5 baud rate generator setting data p.820 addition of description to table 17-1 pin configuration p.821 addition of description to 17.1.1 (6) csib5 p.878 addition of table 18-1 number of channels available for 3-wire variable-length serial i/o e (csie) pp.878, 879 addition of description to 18.1.1 v850e/sj3-h (other than pd70f3931, 70f3932, 70f3933) pp.883, 884 addition of description to 18.3 (2) and (3) pp.886, 888, 890, 891, 893 addition of description to 18.4 (1) to (5) p.926 addition of description to chapter 19 i 2 c bus p.927 addition of description to table 19-2 pin configuration p.928 addition of description to 19.1.1 (5) i 2 c04 (other than pd70f3931, 70f3932, and 70f3933) p.928 addition of description to 19.1.1 (6) i 2 c05 (other than pd70f3931, 70f3932, and 70f3933) pp.931, 932, 934 to 948, 952 to 990, 992 to 996, 998 to 1002, 1005 to 1013 modification of description of remark in chapter 19 i 2 c bus pp.937, 941, 944, 946, 947, 952, 953 addition of description to 19.4 (1) to (5), (7) to (9) p.1081 addition of description to 20.6 (1) switching dma transfer start factor p.1082 addition of description to 21.1 overview p.1260 addition of description to table 22-1 dma transfer start factors p.1278 addition of description to chapter 24 interrupt/exception processing function p.1278 addition of description to 24.1 features p.1282 addition of description to table 24-1 interrupt source list p.1289 addition of description to 24.3 maskable interrupts p.1299 addition of description to table 24-2 interrupt control register (xxicn) pp.1301, 1302 addition of description to 24.3.5 interrupt mask registers 0 to 6, 7l (imr0 to imr6, imr7l) p.1335 addition of description to table 26-3 operating status in halt mode p.1338 addition of description to table 26-5 operating status in idle1 mode p.1341 addition of description to table 26-7 operating status in idle2 mode p.1345 addition of description to table 26-9 operating status in stop mode
appendix e revision history user?s manual u19201ej3v0ud 1595 (4/4) page description pp.1348, 1349 addition of description to table 26-10 operating status in subclock operation mode pp.1352, 1353 addition of description to table 26-12 operating status in sub-idle mode p.1358 addition of description to 27.1 (2) emergency operation mode pp.1385, 1386 addition of description to 31.2 (1) correction address registers 0 to 7 (corad0 to corad7) p.1391 addition of description to (1) v850e/sj3-h in chapter 32 flash memory p.1391 addition of description to 32.1 features p.1392 addition of figure 32-1 (a) 512 kb/768 kb/1024 kb pp.1398 to 1401 deletion of description to 32.4.2 communication mode p.1421 addition of description to chapter 33 option byte function p.1423 modification of description in 33.2 option byte (0000007bh) p.1425 addition of description to chapter 34 on-chip debug function p.1429 addition of 34.1.3 maskable functions p.1433 addition of 34.2 debugging without using dcu p.1454 addition of description to 35.4.3 pll characteristics p.1454 addition of description to 35.4.4 sscg characteristics p.1458 modification of description in 35.6.2 supply current p.1477 modification of description in 35.9 (6) uartb timing p.1479 modification of description in 35.9 (8) csie timing (other than pd70f3931 (v850e/sj3-h), 70f3932 (v850e/sj3-h), and 70f3933 (v850e/sj3-h)) pp.1480, 1481 modification of description in 35.9 (9) i 2 c bus mode p.1487 modification of description in 35.10 (3) programming characteristics p.1490 addition of description to table 37-1 surface mounting type soldering condition p.1496 addition of figure a-1 (4) when using minicube2 qb-mini2 pp.1498 to 1500 addition of description to a.4.1 when using iecube qb-v850esx3h p.1503 addition of a.4.4 when using minicube2 qb-mini2 p.1506 modification of description in a.7 flash memory writing tools p.1596 addition of e.2 revision history of previous editions
appendix e revision history user?s manual u19201ej3v0ud 1596 e.2 revision history of previous editions a history of the revisions up to this edition is shown below . ?applied to:? indicates the ch apters to which the revision was applied. (1/2) edition description applied to: ? change of under development state of the following products development completed pd70f3474gja-gae-g, 70f3475gja-g ae-g, 70f3476gja-gae-g, 70f3477gja- gae-g, 70f3478gja-gae-g, 70f3479 gja-gae-g, 70f3480gma-gar-g, 70f3481gma-gar-g, 70f3482gma-gar-g ? addition of the following products pd70f3486gma-gar-g, 70f3487gma-gar -g, 70f3488gma-gar-g, 70f3925gma- gar-g, 70f3926gma-gar-g, 70f3927gma-gar-g ? change of the following product names fa-144gj-gae-ax fa-144gj-gae-b fa-176gm-gar-ax fa-176gm-gar-b throughout addition of description to table 1-1 v850e/sj3-h and v850e/sk3-h products addition of description of memory space to 1.2 features addition of description to 1.4.2 v850e/sk3-h addition of description to 1.5.1 v850e/sj3-h addition of description to 1.5.2 v850e/sk3-h addition of description to 1.6.1 (1) v850e/sj3-h addition of description to 1.6.1 (2) v850e/sk3-h addition of description to 1.6.2 (3) rom addition of description to 1.6.2 (5) expanded internal ram chapter 1 introduction addition of 3.4.4 (1) (a) internal rom (1024 kb) addition of description to 3.4.4 (1) (b) internal rom (1280 kb) addition of 3.4.4 (6) (a) expanded internal ram (16 kb) addition of description to 3.4.4 (6) (b) expanded internal ram (32 kb) addition of description to table 3-3 product name setting examples addition of description to 3.4.6 peripheral i/o registers chapter 3 cpu function addition of description to figure 5-1 data memory map: physical address addition of description to 5.3.1 (1) chip area select control register 0 (csc0) chapter 5 bus control function addition of description to 6.2 clock mode addition of description to table 6-1 frequency range of operating clocks in each clock mode and corresponding source cocks modification of figure 6-3 clock generation circuit for clock mode 3 addition of description to 6.3 (9) sscg frequency control register 0 (sfc0) chapter 6 clock generation function modification of description in 9.4.2 (1) maximum time before counting start chapter 9 16-bit interval timer m (tmm) 2nd addition of description to 15.4 (4) uartan option control register 0 (uanopt0) chapter 15 asynchronous serial interface a (uarta)
appendix e revision history user?s manual u19201ej3v0ud 1597 (2/2) edition description modification of description in table 19-6 extension code bit definitions chapter 19 i 2 c bus modification of description in 20.3 (8) iebus slave address register (sar) chapter 20 iebus controller addition of description to 21.1 overview addition of description to 21.6 (1) cann global control register (cngmctrl) addition of description to 21.6 (23) cann message control register m (cnmctrlm) modification of description in figure 21-57 forced shutdown process chapter 21 can controller addition of description to 22.13 (7) bus arbitration for cpu chapter 22 dma function (dma controller) modification of description in 27.1 (2) emergency operation mode modification of description in table 27-1 hardware status on reset pin input modification of description in table 27-2 hardware status during watchdog timer 2 reset operation modification of description in table 27-3 hardware status during reset operation by low-voltage detector chapter 27 reset functions addition of description to 31.2 (1) correction address registers 0 to 7 (corad0 to corad7) chapter 31 rom correction function addition of description to chapter 32 flash memory (2) v850e/sk3-h addition of description to 32.1 features addition of figure 32-1 flash memory mapping modification of description in table 32-6 wiring of v850e/sj3-h, v850e/sk3-h flash writing adapters (fa-144gj-gae-b, fa-176gm-gar-b) modification of description in figure 32-6 example of wiring of v850e/sj3-h flash writing adapter (fa-144gj-gae-b) (in csib0 + hs mode) modification of description in figure 32-7 example of wiring of v850e/sk3-h flash writing adapter (fa-176gm-gar-b) (in csib0 + hs mode) chapter 32 flash memory addition of chapter 35 electrical specifications chapter 35 electrical specifications addition of chapter 37 recommended soldering conditions chapter 37 recommended soldering conditions modification of description in a.7 flash memory writing tools appendix a development tools addition of appendix d list of cautions appendix d list of cautions 2nd addition of appendix e revision history appendix e revision history
published by: nec electronics corporation (http://www.necel.com/) contact: http://www.necel.com/support/


▲Up To Search▲   

 
Price & Availability of UPD70F3474GJA-GAE-G

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X